Coder Social home page Coder Social logo

uber-archive / phabricator-jenkins-plugin Goto Github PK

View Code? Open in Web Editor NEW
368.0 2.5K 101.0 2.49 MB

Jenkins plugin to integrate with Phabricator, Harbormaster, and Uberalls

Home Page: https://wiki.jenkins-ci.org/display/JENKINS/Phabricator+Differential+Plugin

License: MIT License

Java 99.87% HTML 0.13%

phabricator-jenkins-plugin's Introduction

NOTE: This project is now archived. The original maintainers from Uber have moved on to new opportunities.

If you or your organization is interested in becoming the project owner, please contact us at [email protected]

Phabricator-Jenkins Plugin Build Status Coverage Status

This plugin provides Phabricator integration with Jenkins. It allows Jenkins to report build status and coverage information over Harbormaster (or via comments if Harbormaster is not enabled).

Table of Contents

Requirements

  • Arcanist is installed on the Jenkins nodes where the tests will be run (e.g. not just the master) the arc binary is in $PATH or configured explicitly in the global settings.

Configuration

Before the plugin can be used, a few configuration steps on your Phabricator and Jenkins instances need to be completed.

Phabricator Configuration

In this section, you'll create a bot user in Phabricator and generate a Conduit API token. If you already have a bot user and a Conduit API token, skip to the "Jenkins Setup Section".

  1. Create a bot user in Phabricator.
  2. Click Edit Settings on the manage page for that user
  3. Click Conduit API Tokens on the left of the settings page
  4. Click Generate API Token, and accept.
  5. Copy the token.

Jenkins Setup

  1. Navigate to https://ci.example.com/configure with your base Jenkins URL in place of "ci.example.com".
  2. Navigate to the Phabricator section and click the Add button. Add Credentials
  3. From the Kind dropdown, select Phabricator Conduit Key.
  4. Enter the base URL for your Phabricator instance in the Phabricator URL field. For example https://phabricator.example.com.
  5. Enter a description in the Description field for readability.Configure Credentials
  6. Paste the Conduit API token (created in the Phabricator Configuration section) in the Conduit Token field.
  7. Click the Add button.
  8. Click the Save button.

Usage

Now that Jenkins and Phabricator are configured you can configure your Jenkins job and Harbormaster.

Jenkins Job

  1. Navigate to the Jenkins job you want to integrate with Phabricator.
  2. Click the Configure button.
  3. Click the Add Parameter button and select String Parameter.
  4. Enter DIFF_ID in the Name field of the parameter.
  5. Repeat step 3.
  6. Enter PHID in the Name field of the second parameter. Configure job parameters
  7. If you want to apply the differential to your workspace before each test run, navigate to the Build Environment section and select the Apply Phabricator Differential checkbox. This resets to the base commit the differential was generated from. If you'd rather apply the patch to master, select the Apply patch to master checkbox. Enable build environment
  8. To report the build status to Phabricator after the test completes:
  9. Navigate to the Post-build Actions section.
  10. Click the Add post-build action button and select Post to Phabricator.
  11. Make sure the Comment on Success and Comment with console link on Failure checkboxes are selected.
  12. Optionally: 1. If you have Uberalls enabled, enter a path to scan for Coverage reports. 2. If you want to post additional text to Phabricator other than "Pass" and "Fail", select the Add Custom Comment checkbox. Then create a .phabricator-comment file and enter the text you want Jenkins to add to the build status comment in Phabricator. Add post-build action

Harbormaster

With Phabricator, Jenkins, and your Jenkins jobs configured it's time to configure a new Harbormaster build plan. This build plan will trigger the Jenkins job using a Herald rule that will be configured in the next section.

  1. Navigate to https://phabricator.example/harbormaster/plan/ with your base Phabricator URL in place of phabricator.example.

  2. Click the Create Build Plan button in the top right corner of the page.

  3. Enter a name for the build plan in the Plan Name field. For these instructions, we'll use "test-example" as the build name.

  4. Click the Create Build Plan button.

  5. Click the Add Build Step button.

  6. Click the Make HTTP Request step.

  7. Use this template URI to fill in the URI field for the build plan: https://ci.example.com/buildByToken/buildWithParameters?job=test-example&DIFF_ID=${buildable.diff}&PHID=${target.phid}

    Be sure to replace https://ci.example.com with the URI of your Jenkins instance and test-example with the name of your Jenkins job.

    If your Jenkins instance is exposed to the internet, make sure to install the Build Token Root Plugin and fill in the token parameter.

  1. Click the When Complete dropdown menu and select Wait For Message.
  2. Click the Create Build Step button. Harbormaster plan

Herald

With the build plans created it's time to create a Herald Rule to trigger the plans. The steps below will configure a Herald Rule to trigger the build plans on Differential Revisions to your repository.

  1. Navigate to https://phabricator.example/herald/ with your base Phabricator URL in place of phabricator.example.
  2. Click the Create Herald Rule button in the top right corner of the page.
  3. Select the Differential Revisions checkbox and click Continue.
  4. Select the Global checkbox and click Continue.
  5. Enter a name for the Herald Rule in the Rule Name field.
  6. In the Conditions section, click the dropdown menu that says "Author" and select "Repository".
  7. Enter your repository name in to the blank field in the Conditions section.
  8. In the Actions section, click the dropdown menu that says "Add blocking reviewers" and select "Run build plans".
  9. Enter the build plans that were created in the previous section in to the blank field in the Action section.
  10. Click Save Rule.

Herald rule

Test Your Configuration

Try arc diff-ing on your repo. If everything goes well, you should see Jenkins commenting on your diff:

Example

Advanced Usage

Now that you have build status and optionally coverage data set up, check out some advanced features.

Development

Use gradle to perform various development related tasks. More info

Testing

Start up Jenkins with the plugin installed:

./gradlew server

Open your browser to your local instance.

Pull Requests

Please open all pull requests and issues against https://github.com/uber/phabricator-jenkins-plugin.

License

MIT Licensed

phabricator-jenkins-plugin's People

Contributors

artms avatar ascandella avatar balihb avatar betterphp avatar cburroughs avatar cellscape avatar chaitanyapramod avatar clonetwin26 avatar colin-harms avatar d-claassen avatar gregmagolan avatar iarkhanhelsky avatar ignas avatar jjx avatar jonathanbaker7 avatar kageiit avatar liuhaotian avatar lwhsu avatar maltzj avatar maroux avatar mennopruijssers avatar mfesenko avatar michaeluber avatar na-itms avatar nguyentruongtho avatar robbertvanginkel avatar sweenzor avatar veeenex avatar youngmit avatar zheller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phabricator-jenkins-plugin's Issues

Error displaying UTF-8 characters in comments

After my Jenkins posts the content of .phabricator-comment to my phabricator instance, the chinese characters will all change to "?".

I doubt I should change
"UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formData);"
to
"UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formData, "UTF-8");"

I imported the project with "Existing Maven Projects" in eclipse and modifed the code.
But, there was a problem with maven-checkstyle-plugin2.15.

I use a rough method. I comment all the test code. I replace "@test" with "//@test", then use "mvn package" to generate hpi.

But my plugin cannot appear in the job configration webpage.
Please forgive me for my being unfamiliar with java and maven.

Add support for other code-coverage tools

Hi,

I want to implement my own CoverageProvider to calculate coverage for the tools we use in-house (VSTest coverage and/or dotCover). However, what I'm missing is a way to select which coverage tool to use, perhaps in the Jenkins config. Is there an easy way to register this? Do you have plans to add maybe a dropdown or something like that in the config? I'm not very familiar with Jenkins plugin config, though the rest of your plugin seems straightforward and easy enough to add additional coverage providers to.

Phabricator self-signed certificate not verifiable by the JRE

Phabricator – Jenkins integration issue:
First a little background, we have not been able to successfully integrate Phabricator with Jenkins. Jenkins has been installed with the Phabricator Differential Plugin, version 1.9.1, installed. There is a test repository on Phabricator, but we have been unable to get a copy of it on the Jenkins server.
• We configured a parameterized build and tried to kick it off manually, both from Jenkins and Phabricator.
o It appears the plugin is getting stymied by the self-signed certificate despite the certificate being saved on the server as the custom.pem file, and the skip-certificate check plug-in installed and enabled.
• Trying to kick off a “Make HTTP Request” in Harbormaster (Phabricator).
o When I follow the instructions provided here: https://github.com/uber/phabricator-jenkins-plugin the build fails immediately because of the URI format.
o When I use the URI format found in: http://www.guywarner.com/2014/05/integrating-jenkins-and-phabricator.html, the build works, but the status always stay at “Waiting for Message.”
o In Jenkins, when I kick off a build in the corresponding job, it fails. It fails with the Console Output of:
Building in workspace /var/lib/jenkins/jobs/DansItem/workspace
FATAL: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1916)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1472)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:913)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:849)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1035)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:71)
at com.uber.jenkins.phabricator.conduit.DifferentialClient.callConduit(DifferentialClient.java:133)
at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:72)
at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:99)
at hudson.model.Build$BuildExecution.doRun(Build.java:156)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1454)
... 29 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
... 35 more
Performing Post build task...
Match found for : : True
Logical operation result is TRUE
Skipping post build task 0 - job status is worse than unstable : FAILURE
ERROR: Step ‘Post to Phabricator’ aborted due to exception:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1916)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1472)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:913)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:849)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1035)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:71)
at com.uber.jenkins.phabricator.conduit.DifferentialClient.callConduit(DifferentialClient.java:133)
at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:72)
at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:158)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1454)
... 32 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
... 38 more
Finished: FAILURE

1.7 update causes the plugin task to crash

I was really looking forward to the 1.7 update. However, the job started failing due to the following. It was fine after I reverted back to 1.6.1 version of the plugin.

FATAL: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:912)
    at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:67)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.callConduit(DifferentialClient.java:113)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:62)
    at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:91)
    at hudson.model.Build$BuildExecution.doRun(Build.java:156)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
ERROR: Publisher 'Post to Phabricator' aborted due to exception: 
java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:912)
    at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:67)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.callConduit(DifferentialClient.java:113)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:62)
    at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:122)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Finished: FAILURE
FATAL: INSTANCE
java.lang.NoSuchFieldError: INSTANCE
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
    at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:912)
    at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:67)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.callConduit(DifferentialClient.java:113)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:62)
    at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:91)
    at hudson.model.Build$BuildExecution.doRun(Build.java:156)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
ERROR: Publisher 'Post to Phabricator' aborted due to exception: 
java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:912)
    at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:67)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.callConduit(DifferentialClient.java:113)
    at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:62)
    at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:122)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Finished: FAILURE

I can't explain this though, as the Apache HTTP client is already a dependency.

Manage Conduit token within Jenkins UI

Currently, this plugin relies on the ~/.arcrc file. Instead, it would be better to allow the Conduit token to be managed in the Jenkins UI and be passed to arcanist with the --conduit-token flag.

Missing HarborMaster status in Diff

Hello,

I have successfully setup phabricator-jenkins-plugin but I have an issue and I don't really know where to look (if it's harbormaster or the plugin).

So when a jenkins build start or end I only have comments in my diff details like this :

screenshot 2015-08-19 10 52 03

I would like to get status update from harbormaster with a status like this :
uberalls-integration

How can I do that ?

Thanks a lot for your plugin and your help !

Best Regards,

Collapse multiple pending builds for one revision

[Close if out of plugin's scope]

I'm looking for guidance/help in achieving this for now. (Cooler if the plugin provides an option 😉)

If there are multiple queued Jenkins builds corresponding to multiple updates on a revision, how can the builds be collapsed to build only the latest build of a revision?

Deprecate "build started" messages

Now that Harbormaster supports artifacts (e.g. build links), we can reduce clutter and remove this option.

TODO: Add the build artifact in the Wrapper step as well.

jna dep needed?

    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <version>3.2.2</version>
    </dependency>
$ grep -rni jna src/

I can't figure out what this is used for.

Phabricator-Jenkins plugin issue; Jenkins builds generate no artifacts

I finally have Phabricator and Jenkins integrated. However, when I kick off a build in either Phabricator or Jenkins, there are no results. There are archived .jar files when I kicked off a build of Java code. I did try to configure Jenkins with post-build actions to "archive the artifacts." That however causes the builds to fail because there are no artifacts. I am doing a parameterized build. The builds pass, but nothing is generated.

Add support for jacoco coverage report

Currently, the plugin tracks only Cobertura reports (perhaps due to Uberalls only supporting Cobertura). Even though Cobertura is quite popular, jacoco is also used in good numbers. It'd be super-cool to have support for jacoco reports.

Build Crash

I have no idea why this is crashing. Calls to arc later in the log work just fine seemingly.

[android_app] $ arc call-conduit differential.querydiffs ********
FATAL: net.sf.json.JSONArray cannot be cast to net.sf.json.JSONObject
java.lang.ClassCastException: net.sf.json.JSONArray cannot be cast to net.sf.json.JSONObject
at com.uber.jenkins.phabricator.conduit.Differential.(Differential.java:52)
at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:91)
at hudson.model.Build$BuildExecution.doRun(Build.java:156)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)

Apply dependent revisions successively

Currently, even if revision 456 is dependant on revision 123, the plugin tries to apply 456 on master and fails often. It'd be useful if it could apply the diffs from depending revisions first.

Jenkins Job Builder Support

http://docs.openstack.org/infra/jenkins-job-builder/

I'd like the plugin to support the jenkins job builder because manually configuring hundreds of jobs isn't fun. Nothing needs to be done in the plugin code and I intend to go write up the patch myself and report back. However, if someone was planning on introducing a bunch of backwards incompatible changes Real Soon that would be good to know.

Conduit unable to fetch differential

I've followed the instructions here to a tee, but when the Jenkins build finishes successfully, the build status in Harbormaster is never updated. I'm getting this message at the end of the Jenkins build console:

[phabricator:uberalls] No cobertura results found
[phabricator:conduit] Unable to fetch differential
Finished: SUCCESS

I've tried configuring conduit API keys multiple times, so I'm not sure what's going on here.

Any help would be appreciated.

Jenkins build fails when applying patch

I've been trying to integrate Phabricator with our Jenkins server without success. The output (in Jenkins) before the build fails is this:

[hidden] $ /home/jenkins/phabricator/arcanist/bin/arc patch --nobranch --diff 204 ********
Exception
 Select a Default Commit Range 

You're running a command which operates on a range of revisions (usually,
from some revision to HEAD) but have not specified the revision that should
determine the start of the range.

Previously, arc assumed you meant 'HEAD^' when you did not specify a start
revision, but this behavior does not make much sense in most workflows
outside of Facebook's historic git-svn workflow.

arc no longer assumes 'HEAD^'. You must specify a relative commit explicitly
when you invoke a command (e.g., `arc diff HEAD^`, not just `arc diff`) or
select a default for this working copy.

In most cases, the best default is 'origin/master'. You can also select
'HEAD^' to preserve the old behavior, or some other remote or branch. But you
almost certainly want to select 'origin/master'.

(Technically: the merge-base of the selected revision and HEAD is used to
determine the start of the commit range.)

    What default do you want to use? [origin/master] The program is attempting to read user input, but stdin is being piped from some other source (not a TTY).
(Run with `--trace` for a full exception trace.)
[phabricator:arcanist] Error applying arc patch; got non-zero exit code FAILURE
[phabricator:process-build-result] No unit results available.
[phabricator:process-build-result] No coverage provider available.

I am running the latest version of anarcist, so that should not be the issue.

Any ideas?

[Feature Request] Update diff with Linter and Unit Test information

Not sure if this is what the Phabricator workflow should be used for, but I think I'd like the option to publish the results of linting and unit tests performed on Jenkins as a part of a Differential build to that differential build in the lint and unit test sections of that diff.

ConduitAPIException: org.apache.http.conn.EofSensorInputStream

[phabricator:non-differential-harbormaster] Sending diffusion result as: SUCCESS

com.uber.jenkins.phabricator.conduit.ConduitAPIException: org.apache.http.conn.EofSensorInputStream@495afdb3
at com.uber.jenkins.phabricator.conduit.ConduitAPIClient.perform(ConduitAPIClient.java:79)
at com.uber.jenkins.phabricator.conduit.HarbormasterClient.sendHarbormasterUri(HarbormasterClient.java:74)
at com.uber.jenkins.phabricator.tasks.NonDifferentialHarbormasterTask.execute(NonDifferentialHarbormasterTask.java:81)
at com.uber.jenkins.phabricator.tasks.Task.run(Task.java:58)
at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:151)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)

phabricator plugin start "git" process failed

phabricator plugin version 1.9.1
jenkins version 1.647
phabricator is upated to Feb 3 2016
i use git for Windows everyday
but i still get errors as follows:

[phabricator:conduit] Fetching differential from Conduit API
[workspace2] $ git reset --hard origin/master
java.io.IOException: Cannot run program "git" (in directory "D:\temp\workspace2"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.(Proc.java:244)
at hudson.Proc$LocalProc.(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.Launcher$ProcStarter.join(Launcher.java:388)
at com.uber.jenkins.phabricator.tasks.ApplyPatchTask.execute(ApplyPatchTask.java:90)
at com.uber.jenkins.phabricator.tasks.Task.run(Task.java:58)
at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:125)
at hudson.model.Build$BuildExecution.doRun(Build.java:156)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 15 more
[phabricator:arcanist] Error applying arc patch; got non-zero exit code FAILURE

Email diff author instead of commit author in case build fails

Currently, whenever the build fails, an email is sent to the author of the last commit on which diff was applied, instead of the diff author. It'd be useful to email diff author who is more likely to understand what went wrong.

One example of where this happens is when the diff doesn't apply cleanly.

Update:

I forgot to mention that the emails are sent from Jenkins Mailer Plugin when Send separate e-mails to individuals who broke the build is enabled.

Set Arc location in Jenkins UI

Currently the plugin does not allow to set the location of arcanist (or install it). Please allow Jenkins UI to set the location of (and possibly install) arcanist.

Reject differential on build failure

Awesome plugin, has saved me a bunch of ballache getting the two systems to play nice with each other.

Opposed to commenting on the diff when a build fails, is there any chance we could get Jenkins to to reject/'request changes to' the diff. This is for two reasons;

1, we use 'arc list' to get a list of open diffs from the command line. When jenkins only posts a comment on build failure the status from the list command will still show as "Needs Review". Having jenkins handle the failure differently would show the diff as "Changes Requested" in the list command.

2, better visual representation of build failure when browsing diffs from the UI. Failure comments could be easily scrolled passed due to the standard grey colouring of the comment box (plus the build status icon on the page is tiny so easily missed).

Thanks

Support for applying diffs inside custom workspace directory

When you work with the Multiple SCMs plugin it's easier to work with if you check out multiple projects in separate subdirectories inside the main workspace directory. There doesn't seem to be a good way to apply a diff to one of these subdirectories - the plugin only tries to apply the diff in the current working directory (the workspace root).

Adding URL artefact to build before CI finishes build

Context: Our builds are sometimes long (order of minutes). It'll be useful to see the Jenkins build job link in Phabricator as soon the build is started (as opposed to the link being added at the end of the build job).

Do you guys think if Phabricator allows this with their Harbormaster APIs?

java.io.IOException: Cannot run program "arc"

the below is the error message:

[api_build_job] $ arc patch --diff 10811 --nocommit --nobranch ********
java.io.IOException: Cannot run program "arc" (in directory "/root/.jenkins/workspace/api_build_job"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
    at hudson.Launcher$ProcStarter.start(Launcher.java:381)
    at hudson.Launcher$ProcStarter.join(Launcher.java:388)
    at com.uber.jenkins.phabricator.conduit.ArcanistClient.callConduit(ArcanistClient.java:59)
    at com.uber.jenkins.phabricator.tasks.ApplyPatchTask.execute(ApplyPatchTask.java:129)
    at com.uber.jenkins.phabricator.tasks.Task.run(Task.java:58)
    at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:151)
    at hudson.model.Build$BuildExecution.doRun(Build.java:156)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 15 more
[phabricator:arcanist] Error applying arc patch; got non-zero exit code FAILURE

I have arcanist in the host,and can run arc command,also add the path of arc to the PATH.
In the job's directory ,i can run the arc command.

On build failure, Harbormaster is not notified.

Having now restarted Harbormaster builds on my setup many times, I have noticed a trend that when the build fails (now every time, see #19), it does not send back a failure message to harbormaster. Instead Harbormaster patiently waits for the callback on that build and gives a status of "Building".

Additional comments without code blocks

Would it be possible to submit the contents of .phabricator-comment to Phabricator without the surrounding code block?

We use a lot of custom styling in our messages, that we are currently sending with a Groovy Postbuild script. Because of the code block, we lose all of our styling. We would like to use the phabricator comment file, because currently we need to set up the entire communication with Phabricator ourselves, which is unnecessary when this plugins provides that exact functionality.

I'll be able to submit a pull request, but wanted to check if this fix is something you're willing to accept.

Plugin isn't compatible with Custom Tools

This is similar to #19... it seems that this plugin isn't compatible with the Custom Tools plugin.

I have the Custom Tools plugin configured as follows:

tools

The output from the job is as follows:

00:00:00.001 [EnvInject] - Inject global passwords.
00:00:00.002 Started by remote host 10.182.88.66
00:00:00.002 [CustomTools] - arcanist: Starting installation
00:00:00.009 [arcanist] $ sh -e /mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist/hudson8373437206605157068.sh
00:00:00.023 [CustomTools] - arcanist: Tool is installed at /mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist
00:00:00.023 [CustomTools] - arcanist: Setting arcanist_HOME=/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist
00:00:00.023 [EnvInject] - Loading node environment variables.
...
00:00:00.623 [redacted] $ sh -c 'echo '{"ids":["558494"]}' | arc call-conduit differential.querydiffs'
00:00:01.033 Applying patch for differential
00:00:01.036 [redacted] $ sh -c 'echo '{"silent":true,"action":"none","message":"Build started: https://redacted/job/redacted/19/ (console: https://redacted/job/redacted/19/console)","revision_id":"20969"}' | arc call-conduit differential.createcomment'
00:00:01.569 [redacted] $ git reset --hard origin/master
00:00:01.579 HEAD is now at 02a3a6c chore(build): bump version
00:00:01.585 [redacted] $ git clean -fd -f
00:00:01.597 [redacted] $ git submodule update --init --recursive
00:00:01.661 [redacted] $ arc patch --nobranch --diff 558494 --nocommit
00:00:01.663 FATAL: Cannot run program "arc" (in directory "/mnt/jenkins-slave-workspace/workspace/redacted"): error=2, No such file or directory
00:00:01.664 java.io.IOException: Cannot run program "arc" (in directory "/mnt/jenkins-slave-workspace/workspace/redacted"): error=2, No such file or directory
00:00:01.664    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
00:00:01.664    at hudson.Proc$LocalProc.<init>(Proc.java:244)
00:00:01.664    at hudson.Proc$LocalProc.<init>(Proc.java:216)
00:00:01.664    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
00:00:01.664    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
00:00:01.664    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
00:00:01.664    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
00:00:01.664    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
00:00:01.664    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
00:00:01.664    at hudson.remoting.Request$2.run(Request.java:324)
00:00:01.664    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
00:00:01.664    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
00:00:01.664    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
00:00:01.664    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
00:00:01.664    at hudson.remoting.Engine$1$1.run(Engine.java:63)
00:00:01.664    at java.lang.Thread.run(Thread.java:745)
00:00:01.664    at ......remote call to i-b7ea994a-ef4326cf(Native Method)
00:00:01.664    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
00:00:01.664    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
00:00:01.664    at hudson.remoting.Channel.call(Channel.java:753)
00:00:01.664    at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
00:00:01.664    at com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper$2.launch(CustomToolInstallWrapper.java:255)
00:00:01.664    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
00:00:01.664    at hudson.Launcher$ProcStarter.join(Launcher.java:389)
00:00:01.664    at com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:120)
00:00:01.664    at hudson.model.Build$BuildExecution.doRun(Build.java:156)
00:00:01.664    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
00:00:01.664    at hudson.model.Run.execute(Run.java:1744)
00:00:01.664    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
00:00:01.664    at hudson.model.ResourceController.execute(ResourceController.java:98)
00:00:01.664    at hudson.model.Executor.run(Executor.java:374)
00:00:01.665 Caused by: java.io.IOException: error=2, No such file or directory
00:00:01.665    at java.lang.UNIXProcess.forkAndExec(Native Method)
00:00:01.665    at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
00:00:01.665    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
00:00:01.665    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
00:00:01.665    at hudson.Proc$LocalProc.<init>(Proc.java:244)
00:00:01.665    at hudson.Proc$LocalProc.<init>(Proc.java:216)
00:00:01.665    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
00:00:01.665    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
00:00:01.665    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
00:00:01.665    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
00:00:01.665    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
00:00:01.665    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
00:00:01.665    at hudson.remoting.Request$2.run(Request.java:324)
00:00:01.665    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
00:00:01.665    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
00:00:01.665    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
00:00:01.665    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
00:00:01.665    at hudson.remoting.Engine$1$1.run(Engine.java:63)
00:00:01.665    at java.lang.Thread.run(Thread.java:745)

Fix flaky TravisCI builds

These pass locally, but have gotten very unreliable in Travis.

Results :
Tests run: 160, Failures: 0, Errors: 0, Skipped: 0
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Skipping Phabricator Differential Plugin
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:31 min
[INFO] Finished at: 2016-01-23T00:27:32+00:00
[INFO] Final Memory: 48M/444M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project phabricator-plugin: ExecutionException; nested exception is java.util.concurrent.ExecutionException: java.lang.RuntimeException: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
[ERROR] Command was/bin/sh -c cd /home/travis/build/uber/phabricator-jenkins-plugin && /usr/lib/jvm/java-7-oracle/jre/bin/java -jar /home/travis/build/uber/phabricator-jenkins-plugin/target/surefire/surefirebooter3038777196213555366.jar /home/travis/build/uber/phabricator-jenkins-plugin/target/surefire/surefire5123615469711299314tmp /home/travis/build/uber/phabricator-jenkins-plugin/target/surefire/surefire_11508608469706892838tmp
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Adding other linting metrics into the .phabricator-comment

I'm trying to set up the phabricator comment to provide more useful information back to Phabricator that it doesn't normally get, such as:

Build is green

This build has $CHECKSTYLE_COUNT warnings of which $CHECKSTYLE_NEW are new and $CHECKSTYLE_FIXED were fixed in this build

However, these variables (which should be environment variables that were set) aren't present. Is there any documentation on how to do this?

Handle base commit not found error

Sometimes, diffs are made against commits which haven't been pushed up to remote yet. The build fails in this case, but no notification of result is made to Harbormaster.

[workspace] $ /var/lib/arc/arcanist/bin/arc call-conduit differential.querydiffs ********
Applying patch for differential
[workspace] $ git reset --hard 1a9049ef170d7351ca18ba164bfe8e73bcf4fdcd
fatal: Could not parse object '1a9049ef170d7351ca18ba164bfe8e73bcf4fdcd'.
Got non-zero exit code resetting to base commit 1a9049ef170d7351ca18ba164bfe8e73bcf4fdcd: 128
[workspace] $ git clean -fd -f
[workspace] $ git submodule update --init --recursive
[workspace] $ /var/lib/arc/arcanist/bin/arc patch --nobranch --diff 3955 --nocommit ********


    This diff is against commit 1a9049ef170d7351ca18ba164bfe8e73bcf4fdcd, but
    the commit is nowhere in the working copy. Try to apply it against the
    current working copy state? (cabbdf90274bcef598ae45a47c1ceb0c7ba2b1ec)
    [Y/n] Exception
The program is attempting to read user input, but stdin is being piped from some other source (not a TTY).
(Run with `--trace` for a full exception trace.)
49[arcanist] Error applying arc patch; got non-zero exit code 1

The plugin should handle this case and either

  • report build failure on Phabricator (Harbormaster)
  • allow applying the patch on some git reference (like master branch) through a configuration

Allow diffs to be applied even when the base commit isn't found

Log snippet of one such issue:

[workspace] $ /var/lib/arc/arcanist/bin/arc patch --diff 14616 --nobranch ********


    This diff is against commit c54a041bd3fd117c55101093a1334d9c67de53d3, but
    the commit is nowhere in the working copy. Try to apply it against the
    current working copy state? (583466119699885a29c0fde01242c045a89e693b)
    [Y/n] 49Exception
The program is attempting to read user input, but stdin is being piped from some other source (not a TTY).
(Run with `--trace` for a full exception trace.)
[phabricator:arcanist] Error applying arc patch; got non-zero exit code FAILURE

It'd be useful to let the plugin continue to apply the diff. If this behaviour is not generally accepted, then it could be behind a config preference.

Consolidate and refactor differential and commit builds

Currently, there are two separate tasks (and a fancy BuildResultProcessor, which is tied to diffs). Now that we support non-differential harbormaster builds (#108), we need to refactor and make fewer assumptions about having a diff.

This will give diffusion commit builds the ability to track coverage and receive unit results.

Support to skip the build wrapper for multiple SCM

This plugin is great.

However, I have a project with multiple git repos with its own directory layout.
It seems PhabricatorBuildWrapper.java assumes only one git repository case.

I would like to add one more parameter in my Jenkins job to get the repo's Callsign from Phabricator.
The Callsign is unique for each repo. With that, I should be able to handle the apply differential and build in Jenkin job's build section via Execute Shell commands.
After build finished, I will use post-build script to reset the repo with patch to master branch again.

Thus, I need this plugin has an option to do nothing in the build wrapper part but just pass the values for arguments, and keep current directory as the workspace, direct go to Jenkins job's own build scripts.

Thanks,
Lianghu

Remove blocking reviewer (leave) from review on success

I currently have a Herald rule that sets my Jenkins build bot user as a Mandatory blocking Reviewer. After phabricator executes the build plan via jenkins, is there a way to automatically remove the Mandatory Review from the review if the build succeeds?

Sequence:

  1. Herald rule to add Jenkins build bot user as mandatory reviewer
  2. Herald rule to execute build plan
  3. Jenkins runs build and reports back to phabricator via comment
  4. FEATURE REQUEST: could there be a way for the mandatory Jenkins reviewer to leave the review if the build succeeds?

Thank you :)

Do not depend on cobertura plugin

Even when the "Uberalls" checkbox is not set, the build will fail if the cobertura plugin is not installed in Jenkins.

[phabricator:plugin-provider] 'cobertura' plugin not installed.
ERROR: Step ‘Post to Phabricator’ aborted due to exception: 
java.lang.NoClassDefFoundError: hudson/plugins/cobertura/CoberturaBuildAction
    at com.uber.jenkins.phabricator.coverage.CoberturaCoverageProvider.getCoverageResult(CoberturaCoverageProvider.java:89)
    at com.uber.jenkins.phabricator.coverage.CoberturaCoverageProvider.hasCoverage(CoberturaCoverageProvider.java:46)
    at com.uber.jenkins.phabricator.PhabricatorNotifier.getCoverageProvider(PhabricatorNotifier.java:216)
    at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:89)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
    at hudson.model.Run.execute(Run.java:1763)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: java.lang.ClassNotFoundException: hudson.plugins.cobertura.CoberturaBuildAction
    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.