Page MenuHomePhabricator

add initiator.phid parameter to HM builds
ClosedPublic

Authored by avivey on Nov 2 2015, 6:30 PM.
Tags
None
Referenced Files
F14063823: D14380.diff
Mon, Nov 18, 8:29 PM
F14057192: D14380.id34732.diff
Sun, Nov 17, 1:16 AM
F14031434: D14380.diff
Sat, Nov 9, 10:29 AM
F14012648: D14380.diff
Fri, Nov 1, 2:55 PM
F13960812: D14380.id34731.diff
Oct 15 2024, 1:38 AM
F13960584: D14380.id34732.diff
Oct 15 2024, 12:10 AM
Unknown Object (File)
Sep 25 2024, 8:11 AM
Unknown Object (File)
Sep 19 2024, 3:22 AM
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
Branch
hm-init
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8542
Build 9858: arc lint + arc unit

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.