mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-20 13:52:40 +01:00
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
This commit is contained in:
parent
5c02113bf9
commit
a8b27130cb
1 changed files with 25 additions and 1 deletions
|
@ -86,7 +86,31 @@ final class HarbormasterPlanViewController
|
|||
$step_list = id(new PHUIObjectItemListView())
|
||||
->setUser($viewer);
|
||||
foreach ($steps as $step) {
|
||||
$implementation = null;
|
||||
try {
|
||||
$implementation = $step->getStepImplementation();
|
||||
} catch (Exception $ex) {
|
||||
// We can't initialize the implementation. This might be because
|
||||
// it's been renamed or no longer exists.
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setObjectName("Step ".$i++)
|
||||
->setHeader(pht('Unknown Implementation'))
|
||||
->setBarColor('red')
|
||||
->addAttribute(pht(
|
||||
'This step has an invalid implementation (%s).',
|
||||
$step->getClassName()))
|
||||
->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setIcon('delete')
|
||||
->addSigil('harbormaster-build-step-delete')
|
||||
->setWorkflow(true)
|
||||
->setRenderNameAsTooltip(true)
|
||||
->setName(pht("Delete"))
|
||||
->setHref(
|
||||
$this->getApplicationURI("step/delete/".$step->getID()."/")));
|
||||
$step_list->addItem($item);
|
||||
continue;
|
||||
}
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setObjectName("Step ".$i++)
|
||||
->setHeader($implementation->getName());
|
||||
|
|
Loading…
Reference in a new issue