mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-04 11:51:02 +01:00
Delete artifacts when restarting build
Summary: Fixes T4336. This updates the build engine to delete all artifacts when targets are being deleted. This prevents conflicts when builds are restarted. Test Plan: Restarted a build that had a lease host step and it didn't crash. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4336 Differential Revision: https://secure.phabricator.com/D8092
This commit is contained in:
parent
e9be9ecfbc
commit
51c4f697f9
1 changed files with 16 additions and 0 deletions
|
@ -101,6 +101,22 @@ final class HarbormasterBuildEngine extends Phobject {
|
||||||
->setViewer($this->getViewer())
|
->setViewer($this->getViewer())
|
||||||
->withBuildPHIDs(array($build->getPHID()))
|
->withBuildPHIDs(array($build->getPHID()))
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
if (!$targets) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$target_phids = mpull($targets, 'getPHID');
|
||||||
|
|
||||||
|
$artifacts = id(new HarbormasterBuildArtifactQuery())
|
||||||
|
->setViewer($this->getViewer())
|
||||||
|
->withBuildTargetPHIDs($target_phids)
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
foreach ($artifacts as $artifact) {
|
||||||
|
$artifact->delete();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($targets as $target) {
|
foreach ($targets as $target) {
|
||||||
$target->delete();
|
$target->delete();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue