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

When triggering audits, respect committer identities when importing commits

Summary:
Ref T13311. We currently don't use committer identity mappings when triggering audits, so if a user is only associated with an identity via manual mapping we won't treat them as the author.

Instead, use the identity and manual mapping if they're available.

Test Plan:
- Pushed a commit as `xyz <xyz@example.org>`, an address with no corresponding user.
- In the UI, manually associated that identity with user `@alice`.
- Ran `bin/repository reparse --publish <hash>` to trigger audits and publishing for the commit.
- Before: observed the `$author_phid` was `null`.
- After: observed the `$author_phid` is Alice.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13311

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

+13 -1
+12
src/applications/repository/storage/PhabricatorRepositoryCommit.php
··· 466 466 return $data->getCommitDetail('authorPHID'); 467 467 } 468 468 469 + public function getEffectiveAuthorPHID() { 470 + if ($this->hasAuthorIdentity()) { 471 + $identity = $this->getAuthorIdentity(); 472 + if ($identity->hasEffectiveUser()) { 473 + return $identity->getCurrentEffectiveUserPHID(); 474 + } 475 + } 476 + 477 + $data = $this->getCommitData(); 478 + return $data->getCommitDetail('authorPHID'); 479 + } 480 + 469 481 public function getAuditStatusObject() { 470 482 $status = $this->getAuditStatus(); 471 483 return DiffusionCommitAuditStatus::newForStatus($status);
+1 -1
src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php
··· 147 147 148 148 $data = $commit->getCommitData(); 149 149 150 - $author_phid = $data->getCommitDetail('authorPHID'); 150 + $author_phid = $commit->getEffectiveAuthorPHID(); 151 151 152 152 $revision = DiffusionCommitRevisionQuery::loadRevisionForCommit( 153 153 $viewer,