@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.

Turn "bypassCache" into a no-op in "diffusion.querycommits"

Summary: Ref T13552. The internal caller for this now uses "internal.commit.search", which is always authority-reading. No legitimate external caller should rely on the behavior of "bypassCache"; no-op it to simplify behavior.

Test Plan: Called "diffusion.querycommits", saw the same data as before.

Maniphest Tasks: T13552

Differential Revision: https://secure.phabricator.com/D21447

+1 -34
+1 -34
src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
··· 38 38 39 39 protected function execute(ConduitAPIRequest $request) { 40 40 $need_messages = $request->getValue('needMessages'); 41 - $bypass_cache = $request->getValue('bypassCache'); 42 41 $viewer = $request->getUser(); 43 42 44 43 $query = id(new DiffusionCommitQuery()) ··· 53 52 ->executeOne(); 54 53 if ($repository) { 55 54 $query->withRepository($repository); 56 - if ($bypass_cache) { 57 - id(new DiffusionRepositoryClusterEngine()) 58 - ->setViewer($viewer) 59 - ->setRepository($repository) 60 - ->synchronizeWorkingCopyBeforeRead(); 61 - } 62 55 } 63 56 } 64 57 ··· 111 104 'hashes' => array(), 112 105 ); 113 106 114 - if ($bypass_cache) { 115 - $lowlevel_commitref = id(new DiffusionLowLevelCommitQuery()) 116 - ->setRepository($commit->getRepository()) 117 - ->withIdentifier($commit->getCommitIdentifier()) 118 - ->execute(); 119 - 120 - $dict['authorEpoch'] = $lowlevel_commitref->getAuthorEpoch(); 121 - $dict['author'] = $lowlevel_commitref->getAuthor(); 122 - $dict['authorName'] = $lowlevel_commitref->getAuthorName(); 123 - $dict['authorEmail'] = $lowlevel_commitref->getAuthorEmail(); 124 - $dict['committer'] = $lowlevel_commitref->getCommitter(); 125 - $dict['committerName'] = $lowlevel_commitref->getCommitterName(); 126 - $dict['committerEmail'] = $lowlevel_commitref->getCommitterEmail(); 127 - 128 - if ($need_messages) { 129 - $dict['message'] = $lowlevel_commitref->getMessage(); 130 - } 131 - 132 - foreach ($lowlevel_commitref->getHashes() as $hash) { 133 - $dict['hashes'][] = array( 134 - 'type' => $hash->getHashType(), 135 - 'value' => $hash->getHashValue(), 136 - ); 137 - } 138 - } 139 - 140 - if ($need_messages && !$bypass_cache) { 107 + if ($need_messages) { 141 108 $dict['message'] = $commit_data->getCommitMessage(); 142 109 } 143 110