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

Fix two issues in owners worker

Summary:
Fix two issues in PhabricatorRepositoryCommitOwnersWorker:

- if a commit was reviewed by some owner of the package, it should not be
  marked as needing audit
- do not run herald worker when it is not needed (for example, when the
  worker is executed from reparse.php)

Test Plan:
reparse a commit which is reviewed by the owner of a package
and verify that it is not marked as needing audit, and herald is not
executed.

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1496
This commit is contained in:
Jason Ge 2012-01-26 10:43:10 -08:00
parent 3e15d7b3df
commit b4053190ec

View file

@ -63,6 +63,7 @@ class PhabricatorRepositoryCommitOwnersWorker
} }
} }
if ($this->shouldQueueFollowupTasks()) {
$herald_task = new PhabricatorWorkerTask(); $herald_task = new PhabricatorWorkerTask();
$herald_task->setTaskClass('PhabricatorRepositoryCommitHeraldWorker'); $herald_task->setTaskClass('PhabricatorRepositoryCommitHeraldWorker');
$herald_task->setData( $herald_task->setData(
@ -71,6 +72,7 @@ class PhabricatorRepositoryCommitOwnersWorker
)); ));
$herald_task->save(); $herald_task->save();
} }
}
private function checkAuditReasons( private function checkAuditReasons(
PhabricatorRepositoryCommit $commit, PhabricatorRepositoryCommit $commit,
@ -117,7 +119,7 @@ class PhabricatorRepositoryCommitOwnersWorker
$owners_phids = mpull($owners, 'getUserPHID'); $owners_phids = mpull($owners, 'getUserPHID');
if (!($commit_author_phid && in_array($commit_author_phid, $owners_phids) || if (!($commit_author_phid && in_array($commit_author_phid, $owners_phids) ||
$revision_author_phid && in_array($revision_author_phid, $commit_reviewedby_phid && in_array($commit_reviewedby_phid,
$owners_phids))) { $owners_phids))) {
$reasons[] = "Owners Not Involved"; $reasons[] = "Owners Not Involved";
} }