@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+5
+3
src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
··· 42 42 ->executeOne(); 43 43 if ($repository) { 44 44 $query->withRepository($repository); 45 + if ($bypass_cache) { 46 + $repository->synchronizeWorkingCopyBeforeRead(); 47 + } 45 48 } 46 49 } 47 50
+1
src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
··· 43 43 )), 44 44 'diffusion.querycommits', 45 45 array( 46 + 'repositoryPHID' => $repo->getPHID(), 46 47 'phids' => array($commit->getPHID()), 47 48 'bypassCache' => true, 48 49 ));
+1
src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
··· 23 23 )), 24 24 'diffusion.querycommits', 25 25 array( 26 + 'repositoryPHID' => $repository->getPHID(), 26 27 'phids' => array($commit->getPHID()), 27 28 'bypassCache' => true, 28 29 'needMessages' => true,