mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 21:32:43 +01:00
Don't trigger "Auto Review" if the author is already an owner; document "Auto Review"
Summary: Ref T10939. If you already own a package, don't trigger the subscribe/review rules. Document how these rules work. Test Plan: - Read documentation. - Removed reviewers, updated a revision, got autoreviewed. - Joined package. - Removed reveiwers, updated a revision, no more autoreview. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10939 Differential Revision: https://secure.phabricator.com/D15918
This commit is contained in:
parent
92b9fa47d0
commit
c9365e48d8
2 changed files with 47 additions and 0 deletions
|
@ -1510,6 +1510,27 @@ final class DifferentialTransactionEditor
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove packages that the revision author is an owner of. If you own
|
||||||
|
// code, you don't need another owner to review it.
|
||||||
|
$authority = id(new PhabricatorOwnersPackageQuery())
|
||||||
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||||
|
->withPHIDs(mpull($packages, 'getPHID'))
|
||||||
|
->withAuthorityPHIDs(array($object->getAuthorPHID()))
|
||||||
|
->execute();
|
||||||
|
$authority = mpull($authority, null, 'getPHID');
|
||||||
|
|
||||||
|
foreach ($packages as $key => $package) {
|
||||||
|
$package_phid = $package->getPHID();
|
||||||
|
if ($authority[$package_phid]) {
|
||||||
|
unset($packages[$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$packages) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
$auto_subscribe = array();
|
$auto_subscribe = array();
|
||||||
$auto_review = array();
|
$auto_review = array();
|
||||||
$auto_block = array();
|
$auto_block = array();
|
||||||
|
|
|
@ -45,6 +45,32 @@ belonging to the package when you look at them in Diffusion, or look at changes
|
||||||
which affect them in Diffusion or Differential.
|
which affect them in Diffusion or Differential.
|
||||||
|
|
||||||
|
|
||||||
|
Auto Review
|
||||||
|
===========
|
||||||
|
|
||||||
|
You can configure **Auto Review** for packages. When a new code review is
|
||||||
|
created in Differential which affects code in a package, the package can
|
||||||
|
automatically be added as a subscriber or reviewer.
|
||||||
|
|
||||||
|
The available settings are:
|
||||||
|
|
||||||
|
- **No Autoreview**: This package will not be added to new reviews.
|
||||||
|
- **Subscribe to Changes**: This package will be added to reviews as a
|
||||||
|
subscriber. Owners will be notified of changes, but not required to act.
|
||||||
|
- **Review Changes**: This package will be added to reviews as a reviewer.
|
||||||
|
Reviews will appear on the dashboards of package owners.
|
||||||
|
- **Review Changes (Blocking)** This package will be added to reviews
|
||||||
|
as a blocking reviewer. A package owner will be required to accept changes
|
||||||
|
before they may land.
|
||||||
|
|
||||||
|
NOTE: These rules **do not trigger** if the change author is a package owner.
|
||||||
|
They only apply to changes made by users who aren't already owners.
|
||||||
|
|
||||||
|
The intent of this feature is to make it easy to configure simple, reasonable
|
||||||
|
behaviors. If you want more tailored or specific triggers, you can write more
|
||||||
|
powerful rules by using Herald.
|
||||||
|
|
||||||
|
|
||||||
Files in Multiple Packages
|
Files in Multiple Packages
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue