Page MenuHomePhabricator

Permit custom harbormaster actions from the diffusion/differential pages
Open, Needs TriagePublic

Description

We have some processes to be able to run unit tests remotely in both (a) sandbox mode and (b) merge-to-master mode. We are highly unlikely to implement the Drydock ssh-as-a-user mechanism for a variety of reasons.

Ideally we'd be able to add custom some notion of a build plan which pings a remote HTTP endpoint, run the test, and then reports back the results. In the merge-to-master mode we do server side merging of the patch and commit the final iteration.

What we're looking for is the ability to add a "Land Revision" and "Run Sandbox" on an arbitrary diff without the need to set up a staging area which runs some harbormaster build plan.

As a less important but still useful use-case we'd like the ability to add the same buttons to Diffusion and run sandbox on an older commit.

Related Objects

Event Timeline

eadler added a project: Restricted Project.
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Mar 18 2016, 4:35 PM

You can already do some of this: "Land Revision" itself is added to the menu via DifferentialLandingActionMenuEventListener. You can use listeners like this to extend the menu.

We are generally moving away from event listeners as extension mechanisms and toward dedicated extension classes, so you may need to make minor API changes in the future, but I plan to support this extension mechanism in some form forever (we use it in the upstream for Subscriptions, Tokens, Flags, etc., although some of those may move to Curtain extensions soon). You can use this to add actions to any object, including commits in Diffusion.

Reporting is a bit more difficult. Most simply, you can, e.g., use a custom field like the the one in P1947 to add a message to the top of the page, like this:

Screen Shot 2016-03-20 at 2.17.30 AM.png (469×550 px, 48 KB)

Instead, that could say "this is merging" or "this merged as XYZ" or whatever. This will be less flexible than the upstream version of the element, though, and won't automatically update.

To get the upstream version you need to subclass DrydockRepositoryOperationType, but repository operations currently assume they operate on a repository, so you can't implement one that does nothing and just reports the status of a different operation. I don't currently plan to change this.

I'd maybe suggest something like this:

  • Use a Listener to add your action.
  • Use a custom field to add status.
  • If you want an auto-updating status, build it on a separate page, have the action redirect the user there, and link to that page from the status. Or use the external queue system page for this.
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Apr 7 2016, 6:07 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 4 2016, 9:19 PM