@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.

Make "Edit Build Plan" more resiliant so old build configurations can be deleted

Summary: Currently the "Edit Build Plan" page crashes if there are any build steps with invalid implementations (because the implementation class has been removed or renamed). This updates the Edit Build Plan page so that steps with invalid implementations can be deleted.

Test Plan: Looked at a build plan with invalid configurations and deleted it's steps.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4111, T1049

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

+25 -1
+25 -1
src/applications/harbormaster/controller/HarbormasterPlanViewController.php
··· 86 86 $step_list = id(new PHUIObjectItemListView()) 87 87 ->setUser($viewer); 88 88 foreach ($steps as $step) { 89 - $implementation = $step->getStepImplementation(); 89 + $implementation = null; 90 + try { 91 + $implementation = $step->getStepImplementation(); 92 + } catch (Exception $ex) { 93 + // We can't initialize the implementation. This might be because 94 + // it's been renamed or no longer exists. 95 + $item = id(new PHUIObjectItemView()) 96 + ->setObjectName("Step ".$i++) 97 + ->setHeader(pht('Unknown Implementation')) 98 + ->setBarColor('red') 99 + ->addAttribute(pht( 100 + 'This step has an invalid implementation (%s).', 101 + $step->getClassName())) 102 + ->addAction( 103 + id(new PHUIListItemView()) 104 + ->setIcon('delete') 105 + ->addSigil('harbormaster-build-step-delete') 106 + ->setWorkflow(true) 107 + ->setRenderNameAsTooltip(true) 108 + ->setName(pht("Delete")) 109 + ->setHref( 110 + $this->getApplicationURI("step/delete/".$step->getID()."/"))); 111 + $step_list->addItem($item); 112 + continue; 113 + } 90 114 $item = id(new PHUIObjectItemView()) 91 115 ->setObjectName("Step ".$i++) 92 116 ->setHeader($implementation->getName());