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

Excluded authored commits from "Ready to Audit"; handle unreachable commits better

Summary:
Ref T10978. I'm inching toward cleaning up our audit state. Two issues are:

- Authored commits show up in "Ready to Audit", but should not.
- Unreachable commits (like that stacked of unsquashed stuff) show up too, but we don't really care about them.

Kick authored stuff out of the "Ready to Audit" bucket and hide unreachable commits by default, with constraints for filtering. Also give them a closed/disabled/strikethru style.

Test Plan:
- Viewed audit buckets.
- Searched for reachable/unreachable commits.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10978

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

+43 -1
+17 -1
src/applications/audit/query/PhabricatorCommitSearchEngine.php
··· 49 49 $query->withPackagePHIDs($map['packagePHIDs']); 50 50 } 51 51 52 + if ($map['unreachable'] !== null) { 53 + $query->withUnreachable($map['unreachable']); 54 + } 55 + 52 56 return $query; 53 57 } 54 58 ··· 88 92 ->setConduitKey('packages') 89 93 ->setAliases(array('package', 'packages', 'packagePHID')) 90 94 ->setDatasource(new PhabricatorOwnersPackageDatasource()), 95 + id(new PhabricatorSearchThreeStateField()) 96 + ->setLabel(pht('Unreachable')) 97 + ->setKey('unreachable') 98 + ->setOptions( 99 + pht('(Show All)'), 100 + pht('Show Only Unreachable Commits'), 101 + pht('Hide Unreachable Commits')) 102 + ->setDescription( 103 + pht( 104 + 'Find or exclude unreachable commits which are not ancestors of '. 105 + 'any branch, tag, or ref.')), 91 106 ); 92 107 } 93 108 ··· 126 141 $query 127 142 ->setParameter('responsiblePHIDs', array($viewer_phid)) 128 143 ->setParameter('statuses', $open) 129 - ->setParameter('bucket', $bucket_key); 144 + ->setParameter('bucket', $bucket_key) 145 + ->setParameter('unreachable', false); 130 146 return $query; 131 147 case 'authored': 132 148 $query
+1
src/applications/audit/view/PhabricatorAuditListView.php
··· 140 140 ->setObjectName($commit_name) 141 141 ->setHeader($commit_desc) 142 142 ->setHref($commit_link) 143 + ->setDisabled($commit->isUnreachable()) 143 144 ->addByline(pht('Author: %s', $author_name)) 144 145 ->addIcon('none', $committed); 145 146
+21
src/applications/diffusion/query/DiffusionCommitQuery.php
··· 14 14 private $responsiblePHIDs; 15 15 private $statuses; 16 16 private $packagePHIDs; 17 + private $unreachable; 17 18 18 19 private $needAuditRequests; 19 20 private $auditIDs; ··· 127 128 128 129 public function withPackagePHIDs(array $package_phids) { 129 130 $this->packagePHIDs = $package_phids; 131 + return $this; 132 + } 133 + 134 + public function withUnreachable($unreachable) { 135 + $this->unreachable = $unreachable; 130 136 return $this; 131 137 } 132 138 ··· 501 507 $conn, 502 508 'package.dst IN (%Ls)', 503 509 $this->packagePHIDs); 510 + } 511 + 512 + if ($this->unreachable !== null) { 513 + if ($this->unreachable) { 514 + $where[] = qsprintf( 515 + $conn, 516 + '(commit.importStatus & %d) = %d', 517 + PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE, 518 + PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE); 519 + } else { 520 + $where[] = qsprintf( 521 + $conn, 522 + '(commit.importStatus & %d) = 0', 523 + PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE); 524 + } 504 525 } 505 526 506 527 return $where;
+4
src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php
··· 128 128 $should_audit = array_fuse($should_audit); 129 129 130 130 foreach ($objects as $key => $object) { 131 + if (isset($phids[$object->getAuthorPHID()])) { 132 + continue; 133 + } 134 + 131 135 if (!$this->hasAuditorsWithStatus($object, $phids, $should_audit)) { 132 136 continue; 133 137 }