I have Harbormaster set up to run builds on Circle CI (via excessive hacks), it'd be great to be able to click the build status link that shows on a Diff and get to the Circle CI build page.
Description
Revisions and Commits
rP Phabricator | |||
D13903 | rP74bf0d6ec692 Show external build links in applications | ||
D13900 | rP57b0353034c5 Add `harbormaster.createartifact` |
Related Objects
- Mentioned In
- T9134: Upgrading: Support for "Postponed" Lint and Unit Removed
T9276: Display when builds happen with status somewhere handy, like the differential timeline
2015 Week 34 (Very Late August)
D13874: Implement methods for logging to Harbormaster via Conduit - Mentioned Here
- D13900: Add `harbormaster.createartifact`
D13903: Show external build links in applications
P1832 circle-phab-glue.js
Event Timeline
There is a URI artifact type, so if you're writing your own custom build step in PHP, you can create a URI artifact that points to the CircleCI plan:
Hi @nornagon -- would you be willing to post details of you have your "excessive hacks" configured? I would love to have a similar setup at my company.
@dpaola2 at this point I don't even remember all the things I had set up, but it involves this monstrosity running on heroku:
I'm going to wait until the Harbormaster doc gets split up a bit before writing details on how to use this, but here's the rough version.
After D13900 + D13903, you'll use harbormaster.createartifact(...) to publish a "uri" artifact as soon as your external build server (e.g., in Jenkins) receives a request and knows what the external build detail URI is. You'll use these parameters:
- buildTargetPHID: The build target PHID from Phabricator, same value you're using with harbormaster.sendmessage.
- artifactKey: Any unique name, like "jenkins.uri"
- artifactType: The string literal "uri".
- artifactData: A dictionary like this one:
{ "uri": "http://your.build-server.com/build/details/12345232/", "name": "View Build Details in Jenkins", "ui.external": true }
The ui.external key tells Harbormaster that this URI artifact is an external link which should be shown in the UI when build targets are rendered:
For example, this is a complete, valid call to add a link to Bing! to a build target:
$ echo '{ "buildTargetPHID": "PHID-HMBT-bwxike43bzahut64duk5", "artifactKey": "link.bing", "artifactType": "uri", "artifactData": { "uri": "http://bing.com", "name": "Bing! It!", "ui.external": true } }' | arc call-conduit --conduit-uri <your-phabricator-uri> --conduit-token <conduit-token> harbormaster.createartifact
The Conduit API page for the call (/conduit/method/harbormaster.createartifact/) is greatly expanded after those changes land, too.
Overall, your Jenkins thing will look something like:
// Publish the link to the external result page. conduit.harbormaster.createartifact(...); // Run the tests. result = run_some_tests(); // Publish the test results. conduit.harbormaster.sendmessage(result);
You can add several links if you want, they just each need to have unique keys (jenkins.detail-uri, jenkins.summary-uri). You should probably also give them unique names so humans can tell them apart.