1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-11 01:12:41 +01:00
phorge-phorge/src/applications
epriestley 76194a0dc1 Add "Autoplans" to Harbormaster
Summary:
Ref T8095. Two general problems:

  - I want Harbormaster to own all lint and unit test results.
  - I don't want users to have to configure anything for `arc` to keep working automatically.

These are in conflict because generic lint/unit test ownership in Harbormaster requires that build targets exist which we can attach build results to. However, we can't currently create build targets on demand: Harbormaster assumes it is responsible for creating targets, then running code or making third-party service calls to actually run the builds.

I considered two broad approaches to let `arc` push results into Harbormaster without requiring administrators to configure some kind of "arc results" build plan:

  # Add magic target PHIDs like `PHID-MAGIC-this-is-really-arc-unit`.
  # Add new code to build real targets with real PHIDs.

(1) is probably a bit less work to get off the ground, but I think it's worse overall and very likely to create more problems in the long run. I particularly worry that it will lead to a small amount of special casing in a very large number of places, which seems more fragile.

(2) is more work upfront but I think does a better job of putting all the special casing in one place that we can, e.g., more reasonably unit test, and letting the rest of the code rarely/never care about this case since it's just dealing with normal plans/steps/targets as far as it can tell.

This diff introduces "autoplans", which are source templates for plans/steps. This let us "push" these targets into Harbormaster. Hypthetically, any process "like" arc can use autoplans to upload test/lint/etc results. In practice, probably only `arc` will ever use this, but I think it's still quite a bit cleaner than the alternative despite all the generality.

Workflow is basically:

  - `arc` creates a diff.
  - `arc` calls `harbormaster.queryautotargets`, passing the diff PHID and saying "I have some lint and unit results I want to stick on this thing".
  - Harbormaster builds the plan, steps, and targets (if any of them don't already exist), and hands back the target PHIDs so `arc` has a completely standard-looking place to put results.
  - `arc` uploads the test results to the right targets, as though Harbormaster had asked it to run unit/lint in the first place.

(This doesn't actually do any of that yet, just sets things up.)

I'll maybe doc turn that ^^^^^^ into a doc for posterity since I think it's hard to guess what an "autotarget" is, but I'm going to grab some lunch first.

Test Plan:
  - Added unit tests to make sure we can build these things properly.
  - Used `harbormaster.queryautotargets` to build autotargets for a bunch of diffs.
  - Verified targets come up in "waiting for message" state.
  - Verified plans and steps are not editable.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: hach-que, epriestley

Maniphest Tasks: T8095

Differential Revision: https://secure.phabricator.com/D13345
2015-06-21 09:04:21 -07:00
..
almanac Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
aphlict Extend from Phobject 2015-06-15 18:02:27 +10:00
arcanist/conduit Mark "arcanist.projectinfo" as deprecated 2015-05-25 22:52:41 +10:00
audit Change text ADD_CC and REMOVE_CC actions 2015-06-16 15:32:52 -07:00
auth Use PhutilInvalidStateException 2015-06-18 07:09:02 +10:00
base Cache application visibility in the request cache 2015-06-16 19:32:37 -07:00
cache Extend from Phobject 2015-06-15 18:02:27 +10:00
calendar Adds details to Calendar event feed titles 2015-06-20 09:45:37 -07:00
celerity Remove some unused properties 2015-06-17 20:41:52 +10:00
chatlog phtize all the things 2015-05-22 21:16:39 +10:00
conduit Clarify that 'order' is an optional parameter in Conduit API methods 2015-06-18 13:05:44 -07:00
config Add more languages to syntax highlighting options 2015-06-18 22:39:22 +10:00
conpherence Use PhutilInvalidStateException 2015-06-18 07:09:02 +10:00
console Truncate large strings in DarkConsole 2015-06-18 13:05:32 -07:00
countdown Add a "template" parameter to application default policies 2015-06-11 13:25:30 -07:00
daemon Linter fixes 2015-06-02 22:14:01 +10:00
dashboard Use PhutilInvalidStateException 2015-06-18 07:09:02 +10:00
differential Add "Autoplans" to Harbormaster 2015-06-21 09:04:21 -07:00
diffusion Add an "--importing" flag to bin/repository reparse 2015-06-20 05:25:44 -07:00
diviner Hide repository from atom view if it hasn't been set 2015-06-21 11:08:54 +10:00
doorkeeper Extend from Phobject 2015-06-15 18:02:27 +10:00
draft/storage Fix visiblity of LiskDAO::getConfiguration() 2015-01-14 06:54:13 +11:00
drydock Drop Windows-specific escaping in preallocated host 2015-06-19 15:06:32 +10:00
fact Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
feed Fix a few more undeclared properties 2015-06-15 19:39:04 +10:00
files Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
flag Extend from Phobject 2015-06-15 18:02:27 +10:00
fund Add a "template" parameter to application default policies 2015-06-11 13:25:30 -07:00
harbormaster Add "Autoplans" to Harbormaster 2015-06-21 09:04:21 -07:00
help Use __CLASS__ instead of hard-coding class names 2015-05-14 07:21:13 +10:00
herald Change text ADD_CC and REMOVE_CC actions 2015-06-16 15:32:52 -07:00
home phtize all the things 2015-05-22 21:16:39 +10:00
legalpad Add a "template" parameter to application default policies 2015-06-11 13:25:30 -07:00
lipsum Extend from Phobject 2015-06-15 18:02:27 +10:00
macro Support Spaces in Pholio 2015-06-10 15:52:49 -07:00
mailinglists/storage Put PhabricatorMetaMTAMailingList back to keep bin/storage adjust happy for now 2015-06-03 18:51:40 -07:00
maniphest Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
meta Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
metamta Dramatically limit the range of failures which can cause duplicate mail 2015-06-16 16:43:24 -07:00
multimeter Provide general documentation on how to use perfomance tools 2015-06-20 05:30:17 -07:00
notification Extend from Phobject 2015-06-15 18:02:27 +10:00
nuance Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
oauthserver Extend from Phobject 2015-06-15 18:02:27 +10:00
owners Make owners typeahead mostly reasonable 2015-06-18 17:16:37 -07:00
passphrase Added a Note Credential Type for Passphrase 2015-06-16 13:44:51 -07:00
paste Add a "template" parameter to application default policies 2015-06-11 13:25:30 -07:00
people Force date/time preferences to valid values 2015-06-18 15:11:01 -07:00
phame Extend from Phobject 2015-06-15 18:02:27 +10:00
phid Remove some unused properties 2015-06-17 20:41:52 +10:00
phlux Transactions - make implementing TYPE_XXXX_POLICY transactions optional 2015-05-19 12:58:18 -07:00
pholio Fix an issue with {M13} and Spaces 2015-06-13 06:54:02 -07:00
phortune Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
phpast Mark some strings for translation 2015-06-09 23:06:52 +10:00
phragment Mark some strings for translation 2015-06-09 23:06:52 +10:00
phrequent phtize all the things 2015-05-22 21:16:39 +10:00
phriction Phriction - improve workflow for when user entered slug needs to be normalized. 2015-06-16 15:33:53 -07:00
policy When showing policy hints, if the Space policy is strictly stronger, show it instead 2015-06-17 11:25:19 -07:00
ponder Extend from Phobject 2015-06-15 18:02:27 +10:00
project Email Preferences - round out options for Projects and Phriction 2015-06-16 14:25:13 -07:00
releeph Dramatically limit the range of failures which can cause duplicate mail 2015-06-16 16:43:24 -07:00
remarkup/conduit phtize all the things 2015-05-22 21:16:39 +10:00
repository Add an "--importing" flag to bin/repository reparse 2015-06-20 05:25:44 -07:00
search Add a bunch of tests for subclass implementations 2015-06-15 18:13:27 +10:00
settings Add date format preference and respect it in date selection controls 2015-06-15 09:26:33 -07:00
slowvote Add a "template" parameter to application default policies 2015-06-11 13:25:30 -07:00
spaces Cache viewer spaces 2015-06-17 10:43:44 -07:00
subscriptions Extend from Phobject 2015-06-15 18:02:27 +10:00
support/application Implement the getName method in PhabricatorApplication subclasses 2014-07-23 23:52:50 +10:00
system Extend from Phobject 2015-06-15 18:02:27 +10:00
tokens phtize all the things 2015-05-22 21:16:39 +10:00
transactions Probably fix notifications not being properly marked as unread 2015-06-17 10:43:25 -07:00
typeahead Extend from Phobject 2015-06-15 18:02:27 +10:00
uiexample Extend from Phobject 2015-06-15 18:02:27 +10:00
xhprof Remove backticks from SQL statements 2015-06-15 07:38:28 +10:00