From 7c44657ca57352511b248393d919ff0d198b02b1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 18 Feb 2021 13:34:07 -0800 Subject: [PATCH] Add more useful PHIDs to Harbormaster build variables Summary: Ref T13609. Add the Object PHID (object being built), Container PHID (container of the object being built), Build PHID, and Buildable PHID to Harbormaster build variables. Test Plan: {F8448191} {F8448192} Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13609 Differential Revision: https://secure.phabricator.com/D21569 --- .../storage/build/HarbormasterBuild.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php index 8243d2a577..7af5af092f 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php @@ -128,6 +128,11 @@ final class HarbormasterBuild extends HarbormasterDAO 'step.timestamp' => null, 'build.id' => null, 'initiator.phid' => null, + + 'buildable.phid' => null, + 'buildable.object.phid' => null, + 'buildable.container.phid' => null, + 'build.phid' => null, ); foreach ($this->getBuildParameters() as $key => $value) { @@ -145,6 +150,11 @@ final class HarbormasterBuild extends HarbormasterDAO $results['build.id'] = $this->getID(); $results['initiator.phid'] = $this->getInitiatorPHID(); + $results['buildable.phid'] = $buildable->getPHID(); + $results['buildable.object.phid'] = $object->getPHID(); + $results['buildable.container.phid'] = $buildable->getContainerPHID(); + $results['build.phid'] = $this->getPHID(); + return $results; } @@ -161,6 +171,16 @@ final class HarbormasterBuild extends HarbormasterDAO 'initiator.phid' => pht( 'The PHID of the user or Object that initiated the build, '. 'if applicable.'), + 'buildable.phid' => pht( + 'The object PHID of the Harbormaster Buildable being built.'), + 'buildable.object.phid' => pht( + 'The object PHID of the object (usually a diff or commit) '. + 'being built.'), + 'buildable.container.phid' => pht( + 'The object PHID of the container (usually a revision or repository) '. + 'for the object being built.'), + 'build.phid' => pht( + 'The object PHID of the Harbormaster Build being built.'), ); foreach ($objects as $object) {