1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00

Synchronize working copies before doing a "bypassCache" commit read

Summary:
Ref T4292. When the daemons make a query for repository information, we need to make sure the working copy on disk is up to date before we serve the response, since we might not have the inforamtion we need to respond otherwise.

We do this automatically for almost all Diffusion methods, but this particular method is a little unusual and does not get this check for free. Add this check.

Test Plan:
  - Made this code throw.
  - Ran `bin/repository reparse --message ...`, saw the code get hit.
  - Ran `bin/repository lookup-user ...`, saw this code get hit.
  - Made this code not throw.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4292

Differential Revision: https://secure.phabricator.com/D15783
This commit is contained in:
epriestley 2016-04-22 03:58:54 -07:00
parent 0f0105e783
commit 711f13660e
3 changed files with 5 additions and 0 deletions

View file

@ -42,6 +42,9 @@ final class DiffusionQueryCommitsConduitAPIMethod
->executeOne(); ->executeOne();
if ($repository) { if ($repository) {
$query->withRepository($repository); $query->withRepository($repository);
if ($bypass_cache) {
$repository->synchronizeWorkingCopyBeforeRead();
}
} }
} }

View file

@ -43,6 +43,7 @@ final class PhabricatorRepositoryManagementLookupUsersWorkflow
)), )),
'diffusion.querycommits', 'diffusion.querycommits',
array( array(
'repositoryPHID' => $repo->getPHID(),
'phids' => array($commit->getPHID()), 'phids' => array($commit->getPHID()),
'bypassCache' => true, 'bypassCache' => true,
)); ));

View file

@ -23,6 +23,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
)), )),
'diffusion.querycommits', 'diffusion.querycommits',
array( array(
'repositoryPHID' => $repository->getPHID(),
'phids' => array($commit->getPHID()), 'phids' => array($commit->getPHID()),
'bypassCache' => true, 'bypassCache' => true,
'needMessages' => true, 'needMessages' => true,