mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-01 10:20:59 +01:00
2b0f98900b
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
27 lines
609 B
PHP
27 lines
609 B
PHP
<?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());
|
|
}
|