Page MenuHomePhabricator

add initiator.phid parameter to HM builds
ClosedPublic

Authored by avivey on Nov 2 2015, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 9:24 PM
Unknown Object (File)
Fri, Dec 13, 3:37 AM
Unknown Object (File)
Thu, Dec 5, 10:18 PM
Unknown Object (File)
Thu, Dec 5, 8:25 AM
Unknown Object (File)
Thu, Nov 28, 8:53 AM
Unknown Object (File)
Nov 24 2024, 12:24 PM
Unknown Object (File)
Nov 18 2024, 10:43 PM
Unknown Object (File)
Nov 18 2024, 10:17 PM
Subscribers

Details

Summary

Fix T9662.

Record who initiated the build, and allow this information as a parameter.

In this implementation, a 're-run' keeps the original initiator, which we maybe not desired?

Test Plan

Make a HTTP step with initiator.phid, trigger manually, via HM, via ./bin/harbormaster build.
Look at requests made.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avivey retitled this revision from to add initiator.phid parameter to HM builds.
avivey updated this object.
avivey edited the test plan for this revision. (Show Details)
avivey added a reviewer: epriestley.
avivey edited edge metadata.
epriestley edited edge metadata.

In this implementation, a 're-run' keeps the original initiator, which we maybe not desired?

Seems OK to me for now, although I think it's reasonable to consider making the user who clicked "restart" the initiator in the future if there's a reason for it. None of the eventual results (stay like this, use user who clicked button, keep both original and button clicker) seem particularly more desirable to me offhand.

src/applications/harbormaster/engine/HarbormasterTargetEngine.php
166–169

What is $viewer when not a PhabricatorUser? This seems really suspicious, I think you can drop the instanceof check.

173

e.g., this will fatal anyway?

src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
101–106

Consider using the Harbormaster application PHID here.

src/applications/harbormaster/storage/HarbormasterBuildable.php
166

Probably not too important.

src/applications/harbormaster/storage/build/HarbormasterBuild.php
297–298

Maybe be slightly more vague/inclusive because other things (releases, evil spirits) are likely to be able to initiate builds in the future.

This revision is now accepted and ready to land.Nov 2 2015, 6:36 PM
src/applications/harbormaster/engine/HarbormasterTargetEngine.php
166–169

Yes, I probably got this from another version.

I'll make the setter explicitly check for this.

src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
101–106

err... why?

src/applications/harbormaster/storage/build/HarbormasterBuild.php
297–298

"user or object"?

avivey updated this object.
avivey edited edge metadata.
  • replace instanceof with typehint
src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
101–107

This stuff tends to end up rendered in the UI in some form sooner or later, and we generally can't reasonably special case it. Using the application PHID let us render, say, this, in a transaction log:

Harbormaster initiated this build.

...instead of this:

Unknown Object (VOID????) initiated this build.

This is consistent with other actions ("Herald added subscribers...", lease owners from bin/drydock, etc).

src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
101–107

I'm not 100% sold about it from the correctness POV, but it makes sense for consistency.

  • replace instanceof with typehint
  • user application phid; say Object
This revision was automatically updated to reflect the committed changes.