mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Add a config flag to treat "Accepted" revisions as "Closed"
Summary: See D7653. This is exclusively for Asana, who uses Differential for a post-commit, Audit-like workflow but has a small set of requirements for it to be a good fit (just this) and a large set of requirements for Diffusion/Audit to be a good fit. Test Plan: Set the flag, verified "Accepted" revisions are no longer on the dashboard. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7654
This commit is contained in:
parent
1da691113a
commit
b435c03eca
2 changed files with 27 additions and 1 deletions
|
@ -146,6 +146,26 @@ final class PhabricatorDifferentialConfigOptions
|
||||||
"is accidentally closed or if a developer changes his or her ".
|
"is accidentally closed or if a developer changes his or her ".
|
||||||
"mind after closing a revision. If it is false, reopening ".
|
"mind after closing a revision. If it is false, reopening ".
|
||||||
"is not allowed.")),
|
"is not allowed.")),
|
||||||
|
$this->newOption('differential.close-on-accept', 'bool', false)
|
||||||
|
->setBoolOptions(
|
||||||
|
array(
|
||||||
|
pht('Treat Accepted Revisions as "Closed"'),
|
||||||
|
pht('Treat Accepted Revisions as "Open"'),
|
||||||
|
))
|
||||||
|
->setSummary(pht('Allows "Accepted" to act as a closed status.'))
|
||||||
|
->setDescription(
|
||||||
|
pht(
|
||||||
|
'Normally, Differential revisions remain on the dashboard when '.
|
||||||
|
'they are "Accepted", and the author then commits the changes '.
|
||||||
|
'to "Close" the revision and move it off the dashboard.'.
|
||||||
|
"\n\n".
|
||||||
|
'If you have an unusual workflow where Differential is used for '.
|
||||||
|
'post-commit review (normally called "Audit", elsewhere in '.
|
||||||
|
'Phabricator), you can set this flag to treat the "Accepted" '.
|
||||||
|
'state as a "Closed" state and end the review workflow early.'.
|
||||||
|
"\n\n".
|
||||||
|
'This sort of workflow is very unusual. Very few installs should '.
|
||||||
|
'need to change this option.')),
|
||||||
$this->newOption('differential.days-fresh', 'int', 1)
|
$this->newOption('differential.days-fresh', 'int', 1)
|
||||||
->setSummary(
|
->setSummary(
|
||||||
pht(
|
pht(
|
||||||
|
|
|
@ -72,10 +72,16 @@ final class DifferentialRevisionStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getClosedStatuses() {
|
public static function getClosedStatuses() {
|
||||||
return array(
|
$statuses = array(
|
||||||
ArcanistDifferentialRevisionStatus::CLOSED,
|
ArcanistDifferentialRevisionStatus::CLOSED,
|
||||||
ArcanistDifferentialRevisionStatus::ABANDONED,
|
ArcanistDifferentialRevisionStatus::ABANDONED,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (PhabricatorEnv::getEnvConfig('differential.close-on-accept')) {
|
||||||
|
$statuses[] = ArcanistDifferentialRevisionStatus::ACCEPTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $statuses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getOpenStatuses() {
|
public static function getOpenStatuses() {
|
||||||
|
|
Loading…
Reference in a new issue