• Stars
    star
    367
  • Rank 116,257 (Top 3 %)
  • Language
    Java
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Jenkins plugin to integrate with Phabricator, Harbormaster, and Uberalls

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

More Repositories

1

go-torch

Stochastic flame graph profiler for Go programs
Go
3,958
star
2

pyflame

πŸ”₯ Pyflame: A Ptracing Profiler For Python. This project is deprecated and not maintained.
C++
2,974
star
3

image-diff

Create image differential between two images
JavaScript
2,453
star
4

makisu

Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Go
2,409
star
5

cpustat

high frequency performance measurements for Linux. This project is deprecated and not maintained.
Go
1,659
star
6

cherami-server

Distributed, scalable, durable, and highly available message queue system. This project is deprecated and not maintained.
Go
1,416
star
7

AthenaX

SQL-based streaming analytics platform at scale
Java
1,224
star
8

plato-research-dialogue-system

This is the Plato Research Dialogue System, a flexible platform for developing conversational AI agents.
Python
977
star
9

npm-shrinkwrap

A consistent shrinkwrap tool
JavaScript
775
star
10

chaperone

A Kafka audit system
Java
640
star
11

coding-challenge-tools

Uber's tools team coding challenge
562
star
12

hyperbahn

Service discovery and routing for large scale microservice operations
JavaScript
394
star
13

sql-differential-privacy

Dataflow analysis & differential privacy for SQL queries. This project is deprecated and not maintained.
Scala
391
star
14

ohana-ios

Contacts simplified. This project is deprecated and not maintained.
Objective-C
362
star
15

rave

A data model validation framework that uses java annotation processing.
Java
355
star
16

jetstream-ios

An elegant model framework written in Swift
Swift
333
star
17

node-stap

Tools for analyzing Node.js programs with SystemTap. This project is deprecated and not maintained.
JavaScript
291
star
18

r-dom

React DOM wrapper
JavaScript
263
star
19

focuson

A tool to surface security issues in python code
Python
226
star
20

cherami-client-go

Go Client Implementation of Cherami - A distributed, scalable, durable, and highly available message queue system. This project is deprecated and not maintained.
Go
207
star
21

viewport-mercator-project

NOTE: The viewport-mercator-project repo is archived and code has moved to
JavaScript
137
star
22

infer-plugin

Gradle plugin that allows easy integration with the infer static analyzer.
Groovy
126
star
23

express-statsd

Statsd route monitoring middleware for connect/express
JavaScript
126
star
24

android-build-environment

Docker repository for android build environment
122
star
25

in-n-out

A library to perform point-in-geofence searches.
JavaScript
106
star
26

buck-http-cache

An Implementation of Buck's HTTP Cache API as a distributed cache service. This project is deprecated and not maintained.
Shell
101
star
27

statsrelay

A consistent-hashing relay for statsd and carbon metrics
C
101
star
28

hacheck

HAproxy healthcheck proxying service
Python
86
star
29

potter

a CLI to create node.js services
JavaScript
83
star
30

opentracing-go

A general-purpose instrumentation API for distributed tracing systems
Go
82
star
31

idl

A CLI for managing Thrift IDL files
JavaScript
78
star
32

jetstream

Jetstream Sync server framework
JavaScript
73
star
33

canduit

Node.js Phabricator Conduit API client. This project is deprecated and not maintained.
JavaScript
65
star
34

kafka-spraynozzle

A nozzle to spray a kafka topic at an HTTP endpoint. This project is deprecated and not maintained.
Java
49
star
35

usb2fac

Enabling 2fac confirmation for newly connected USB devices
Python
44
star
36

nanny

Cluster management for Node processes
JavaScript
40
star
37

auto-value-bundle

Extends Autovalue to extract data from a bundle into a value object.
Java
36
star
38

node-flame

Tools for analyzing Node.js programs with ptrace. This project is deprecated and not maintained.
JavaScript
29
star
39

Bug-Bounty-Page

A repo to make our changes more transparent to bug bounty researchers in our program (so they can see commits, etc).
29
star
40

paranoid-request

An SSRF-preventing wrapper around Node's request module
JavaScript
26
star
41

lint-trap

JavaScript linter module for Uber projects
JavaScript
26
star
42

thriftify

JavaScript implementation of Thrift encoding and decoding
JavaScript
25
star
43

HackerOneAlchemy

A tool to generate statistics and help manage bug bounty reports in HackerOne.
Python
23
star
44

express-translate

Add simple translation support to Express
JavaScript
21
star
45

cherami-thrift

Thrift APIs for Cherami - A distributed, scalable, durable, and highly available message queue system. This project is deprecated and not maintained.
Go
20
star
46

h1-python

A HackerOne API client for Python
Python
19
star
47

cidrtrie

Trie implementation of a CIDR lookup table
Python
19
star
48

ios-template

This template provides a starting point for open source iOS projects at Uber.
Ruby
18
star
49

tcheck

TChannel health check utility
Go
17
star
50

job_progress

Store the progress of a job
Python
16
star
51

java-code-styles

IntelliJ IDEA code style settings for Uber's Java and Android projects.
15
star
52

fixed-server

Server for HTTP fixtures
JavaScript
14
star
53

vis-academy

A set of tutorials on how our frameworks make effective data visualization applications.
JavaScript
13
star
54

shared-docs

Shared Markdown Documents from Uber Engineering
12
star
55

typed-request-stack

Middleware stack runner for typed HTTP requests
JavaScript
11
star
56

cherami-client-python

Python Client for Cherami - A distributed, scalable, durable, and highly available message queue system. This project is deprecated and not maintained.
Python
11
star
57

failpointsjs

JavaScript
10
star
58

instafork

JavaScript
8
star
59

py-find-unicode

Find incorrect unicode() invocations
Python
8
star
60

shallow-settings

Shallow inheritance-based settings for your application
JavaScript
7
star
61

clusto-query

Silly CLI for querying clusto more quickly
Python
7
star
62

gg

Go dependency debugger
Go
7
star
63

connect-csrf-lite

CSRF validation middleware for Connect/Express
JavaScript
7
star
64

javax-extras

(DEPRECATED) Extra utilities for javax
Java
6
star
65

fixtures-fs

Create a temporary fs with JSON fixtures
JavaScript
6
star
66

redis-delete-pattern

Delete a set of keys from a pattern in Redis
6
star
67

opentracing-python

NOTE: This repository has been retired. The latest OpenTracing APIs can be found in the official repository.
Python
5
star
68

tchannel-gen

Scaffolding for new TChannel w/ Hyperbahn applications
JavaScript
5
star
69

node-dot-arcanist

Uber's .arcanist folder as an npm module
PHP
5
star
70

cherami-client-java

Java Client for Cherami. This project is deprecated and not maintained.
Java
5
star
71

pyrehol

Python wrapper for Firehol
Python
4
star
72

dubstep

This repo is DEPRECATED. See https://github.com/dubstepjs/core
JavaScript
4
star
73

ottr

Easy, robust end-to-end UI tests for web apps
JavaScript
3
star
74

clouseau

A Node.js performance profiler by Uber
JavaScript
3
star
75

vertica-aesgcm-udx

C++
2
star
76

stacked

Go
2
star
77

request-redis-cache

Make requests and cache them in Redis
JavaScript
2
star
78

nodesol-write

Kafka producer.
JavaScript
2
star
79

request-mocha

Request utilities for Mocha
JavaScript
2
star
80

UberBuilder

Make building flexible, immutable objects a simple task
Objective-C
2
star
81

uLeak

DEPRECATED: This is continued in https://github.com/behroozkhorashadi/uLeak
Java
2
star
82

fusion-orchestrate

Tools and scripts for working across multiple fusion repos at once
JavaScript
2
star
83

deck.gl-data-osm

OSM data for the data visualization library deck.gl examples (https://uber.github.io/deck.gl/#/)
1
star
84

uberclass-clouseau

A subclass of uberclass that adds profiling support
JavaScript
1
star
85

backbone-api-client

Backbone mixin built for interacting with API clients
JavaScript
1
star
86

fusion-release

Releases and verifies FusionJS packages
JavaScript
1
star
87

cache-redis

An ES6 Map-like cache with redis backing
JavaScript
1
star
88

redis-broadcast

Write redis commands to a set of redises efficiently
JavaScript
1
star