@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 build steps to explicitly fail the build

Summary: We've received feedback that the "core - exception" is incredibly confusing, to the point where developers see this and write off the build failure as a Phabricator error that is unrelated to their changes.

Test Plan: Ran a build with a `exit 1` run step, didn't see the "core - exception" appear.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

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

+12 -1
+2
src/__phutil_library_map__.php
··· 654 654 'HarbormasterBuildCommand' => 'applications/harbormaster/storage/HarbormasterBuildCommand.php', 655 655 'HarbormasterBuildDependencyDatasource' => 'applications/harbormaster/typeahead/HarbormasterBuildDependencyDatasource.php', 656 656 'HarbormasterBuildEngine' => 'applications/harbormaster/engine/HarbormasterBuildEngine.php', 657 + 'HarbormasterBuildFailureException' => 'applications/harbormaster/exception/HarbormasterBuildFailureException.php', 657 658 'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php', 658 659 'HarbormasterBuildItem' => 'applications/harbormaster/storage/build/HarbormasterBuildItem.php', 659 660 'HarbormasterBuildItemPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildItemPHIDType.php', ··· 3394 3395 'HarbormasterBuildCommand' => 'HarbormasterDAO', 3395 3396 'HarbormasterBuildDependencyDatasource' => 'PhabricatorTypeaheadDatasource', 3396 3397 'HarbormasterBuildEngine' => 'Phobject', 3398 + 'HarbormasterBuildFailureException' => 'Exception', 3397 3399 'HarbormasterBuildGraph' => 'AbstractDirectedGraph', 3398 3400 'HarbormasterBuildItem' => 'HarbormasterDAO', 3399 3401 'HarbormasterBuildItemPHIDType' => 'PhabricatorPHIDType',
+5
src/applications/harbormaster/exception/HarbormasterBuildFailureException.php
··· 1 + <?php 2 + 3 + final class HarbormasterBuildFailureException extends Exception { 4 + 5 + }
+1 -1
src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php
··· 68 68 $log_stderr->finalize($start_stderr); 69 69 70 70 if ($err) { 71 - throw new Exception(pht('Command failed with error %d.', $err)); 71 + throw new HarbormasterBuildFailureException(); 72 72 } 73 73 } 74 74
+4
src/applications/harbormaster/worker/HarbormasterTargetWorker.php
··· 56 56 // If the target wants to yield, let that escape without further 57 57 // processing. We'll resume after the task retries. 58 58 throw $ex; 59 + } catch (HarbormasterBuildFailureException $ex) { 60 + // A build step wants to fail explicitly. 61 + $target->setTargetStatus(HarbormasterBuildTarget::STATUS_FAILED); 62 + $target->save(); 59 63 } catch (Exception $ex) { 60 64 phlog($ex); 61 65