HomePhabricator

Add `harbormaster.createartifact`

Description

Add harbormaster.createartifact

Summary:
Ref T8659. In the general case, this eventually allows build processes to do things like:

  • Upload build results (like a ".app" or ".exe" or other binary).
  • Pass complex results between build steps (e.g., build step A does something hard and build step B uses it to do something else).

Today, we're a long way away from having the infrastructure for that. However, it is useful to let third party build processes (like Jenkins) upload URIs that link back to the external build results.

This adds harbormaster.createartifact so they can do that. The only useful thing to do with this method today is have your Jenkins build do this:

params = array(
  "uri": "https://jenkins.mycompany.com/build/23923/details/",
  "name": "View Build Results in Jenkins",
  "ui.external": true,
);
harbormaster.createartifact(target, 'uri', params);

Then (after the next diff) we'll show a link in Differential and a prominent link in Harbormaster. I didn't actually do the UI stuff in this diff since it's already pretty big.

This change moves a lot of code around, too:

  • Adds PHIDs to artifacts.
  • It modularizes build artifact types (currently "file", "host" and "URI").
  • It formalizes build artifact parameters and construction:
    • This lets me generate usable documentation about how to create artifacts.
    • This prevents users from doing dangerous or policy-violating things.
  • It does some other general modernization.

Test Plan:

Screen Shot 2015-08-14 at 9.14.25 AM.png (181×688 px, 21 KB)

Screen Shot 2015-08-14 at 9.17.08 AM.png (1×1 px, 273 KB)

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8659

Differential Revision: https://secure.phabricator.com/D13900

Details