1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 10:12:41 +01:00

Work around workflow blocking error with duplicate "master" refs in "Land Revision"

Summary:
Ref T11823. See PHI68. T11823 has a full description of this issue and a plan to fix it, but the full plan is relatively complicated.

Until that can happen, provide a workaround for the biggest immediate issue, where multiple copies of a ref cursor can cause `executeOne()` to throw, since it expects a single result. In practice, these copies are always identical so we can just pick the first one.

This will get cleaned up once T11823 is fixed properly.

Test Plan:
Forced the table into a duplicate/ambiguous state, reproduced a similar-looking error:

{F5180999}

Applied the patch, got the "Land" to work as expected:

{F5181000}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T11823

Differential Revision: https://secure.phabricator.com/D18599
This commit is contained in:
epriestley 2017-09-13 12:14:06 -07:00
parent 6fb3f857fb
commit c310f08b7a

View file

@ -137,9 +137,19 @@ final class DifferentialRevisionOperationController
return null; return null;
} }
return $this->newRefQuery($repository) // NOTE: See PHI68. This is a workaround to make "Land Revision" work
// until T11823 is fixed properly. If we find multiple refs with the same
// name (normally, duplicate "master" refs), just pick the first one.
$refs = $this->newRefQuery($repository)
->withRefNames(array($default_name)) ->withRefNames(array($default_name))
->executeOne(); ->execute();
if ($refs) {
return head($refs);
}
return null;
} }
private function getDefaultRefName( private function getDefaultRefName(