@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow users to create buildables from diffs

Summary:
Now that diffs have PHIDs we can create buildables for them.

This also adds `buildable.diff` in the variables list so the diff ID is available, and it also fixes the Cancel button on "Edit Plan" page so it redirects to the right place.

Test Plan: Created a buildable from a diff, ran a build plan against it that had `echo ${buildable.diff}` and got the right ID. Also tested the "Edit Plan" cancel redirect.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D7546

authored by

James Rhodes and committed by
epriestley
eccbbce9 79ef667d

+10 -3
+5 -2
src/applications/harbormaster/controller/HarbormasterBuildableEditController.php
··· 42 42 ->executeOne(); 43 43 44 44 if ($object instanceof DifferentialRevision) { 45 - throw new Exception( 46 - "TODO: We need to assign PHIDs to diffs before this will work."); 45 + $revision = $object; 46 + $object = $object->loadActiveDiff(); 47 + $buildable 48 + ->setBuildablePHID($object->getPHID()) 49 + ->setContainerPHID($revision->getPHID()); 47 50 } else if ($object instanceof PhabricatorRepositoryCommit) { 48 51 $buildable 49 52 ->setBuildablePHID($object->getPHID())
+1 -1
src/applications/harbormaster/controller/HarbormasterPlanEditController.php
··· 68 68 $id = $plan->getID(); 69 69 70 70 $title = pht('Edit Build Plan'); 71 - $cancel_uri = "/B{$id}"; 71 + $cancel_uri = $this->getApplicationURI('plan/'.$plan->getID().'/'); 72 72 $save_button = pht('Save Build Plan'); 73 73 } 74 74
+4
src/applications/harbormaster/step/VariableBuildStepImplementation.php
··· 4 4 5 5 public function retrieveVariablesFromBuild(HarbormasterBuild $build) { 6 6 $results = array( 7 + 'buildable.diff' => null, 7 8 'buildable.revision' => null, 8 9 'buildable.commit' => null, 9 10 'repository.callsign' => null, ··· 17 18 18 19 $repo = null; 19 20 if ($object instanceof DifferentialDiff) { 21 + $results['buildable.diff'] = $object->getID(); 20 22 $revision = $object->getRevision(); 21 23 $results['buildable.revision'] = $revision->getID(); 22 24 $repo = $revision->getRepository(); ··· 72 74 73 75 public function getAvailableVariables() { 74 76 return array( 77 + 'buildable.diff' => 78 + pht('The differential diff ID, if applicable.'), 75 79 'buildable.revision' => 76 80 pht('The differential revision ID, if applicable.'), 77 81 'buildable.commit' => pht('The commit identifier, if applicable.'),