1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Fix a bug with owners analysis of commits

Summary: If the commit has a known author but that author is different from the revision author or the revision doesn't exist, we'll throw away the commit author and then raise an audit for "Owners Not Involved". Instead, we should just use the commit author in all cases.

Test Plan:
Debugged this with Zor in IRC, he reported it fixed his issue.

Before:

http://pastie.org/4574680

("Author" is empty.)

After:

http://pastie.org/4574712

("Author" is correctly recognized.)

Reviewers: jungejason, nh, vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3374
This commit is contained in:
epriestley 2012-08-23 10:12:41 -07:00
parent ca1775b468
commit ad409126b1

View file

@ -106,7 +106,6 @@ final class PhabricatorRepositoryCommitOwnersWorker
$revision_author_phid = null; $revision_author_phid = null;
$commit_reviewedby_phid = null; $commit_reviewedby_phid = null;
$commit_author_phid = null;
if ($revision_id) { if ($revision_id) {
$revision = id(new DifferentialRevision())->load($revision_id); $revision = id(new DifferentialRevision())->load($revision_id);
@ -115,7 +114,6 @@ final class PhabricatorRepositoryCommitOwnersWorker
$revision_author_phid = $revision->getAuthorPHID(); $revision_author_phid = $revision->getAuthorPHID();
$revision_reviewedby_phid = $revision->loadReviewedBy(); $revision_reviewedby_phid = $revision->loadReviewedBy();
$commit_reviewedby_phid = $data->getCommitDetail('reviewerPHID'); $commit_reviewedby_phid = $data->getCommitDetail('reviewerPHID');
$commit_author_phid = $data->getCommitDetail('authorPHID');
if ($revision_author_phid !== $commit_author_phid) { if ($revision_author_phid !== $commit_author_phid) {
$reasons[] = "Author Not Matching with Revision"; $reasons[] = "Author Not Matching with Revision";
} }