mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Fail outstanding buildables with aborted builds
Summary: Ref T13072. See PHI361. The bug in T10746 where aborting builds didn't propagate properly to the buildable was fixed, but existing builds are still stuck "Building". Since it doesn't look like anything will moot this before these changes promote to `stable`, just migrate these builds into "failed". Test Plan: Ran migration, saw it affect only relevant builds and correctly fail them. Maniphest Tasks: T13072 Differential Revision: https://secure.phabricator.com/D19091
This commit is contained in:
parent
fe294d4034
commit
2b0f98900b
1 changed files with 27 additions and 0 deletions
27
resources/sql/autopatches/20180214.harbor.01.aborted.php
Normal file
27
resources/sql/autopatches/20180214.harbor.01.aborted.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
$table = new HarbormasterBuildable();
|
||||
$conn = $table->establishConnection('w');
|
||||
|
||||
foreach (new LiskMigrationIterator($table) as $buildable) {
|
||||
if ($buildable->getBuildableStatus() !== 'building') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$aborted = queryfx_one(
|
||||
$conn,
|
||||
'SELECT * FROM %T WHERE buildablePHID = %s AND buildStatus = %s',
|
||||
id(new HarbormasterBuild())->getTableName(),
|
||||
$buildable->getPHID(),
|
||||
'aborted');
|
||||
if (!$aborted) {
|
||||
continue;
|
||||
}
|
||||
|
||||
queryfx(
|
||||
$conn,
|
||||
'UPDATE %T SET buildableStatus = %s WHERE id = %d',
|
||||
$table->getTableName(),
|
||||
'failed',
|
||||
$buildable->getID());
|
||||
}
|
Loading…
Reference in a new issue