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

fix bin/audit to not query whole DB if no commits found

Summary: reported by csilvers in irc

Test Plan: ran a bum query with --trace and verified table scan not run

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

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

+10 -8
+10 -8
src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
··· 103 103 $audits = $query->execute(); 104 104 $commits = $query->getCommits(); 105 105 106 - // TODO: AuditQuery is currently not policy-aware and uses an old query 107 - // to load commits. Load them in the modern way to get repositories. Remove 108 - // this after modernizing PhabricatorAuditQuery. 109 - $commits = id(new DiffusionCommitQuery()) 110 - ->setViewer($viewer) 111 - ->withPHIDs(mpull($commits, 'getPHID')) 112 - ->execute(); 113 - $commits = mpull($commits, null, 'getPHID'); 106 + if ($commits) { 107 + // TODO: AuditQuery is currently not policy-aware and uses an old query 108 + // to load commits. Load them in the modern way to get repositories. 109 + // Remove this after modernizing PhabricatorAuditQuery. 110 + $commits = id(new DiffusionCommitQuery()) 111 + ->setViewer($viewer) 112 + ->withPHIDs(mpull($commits, 'getPHID')) 113 + ->execute(); 114 + $commits = mpull($commits, null, 'getPHID'); 115 + } 114 116 115 117 foreach ($audits as $key => $audit) { 116 118 $commit = idx($commits, $audit->getCommitPHID());