From a9f87857af4b168d2a0f551515beaa31dceffe5f Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 25 Jan 2018 10:25:49 -0800 Subject: [PATCH] Mark the "Reviewer" field for Commits as deprecated Summary: Depends on D18931. Ref T13048. Ref T13041. This field means "the first accepting reviewer, where order is mostly arbitrary". Modern rules should almost certainly use "Accepting Reviewers" instead. Getting rid of this completely is a pain, but we can at least reduce confusion by marking it as not-the-new-hotness. Add a "Deprecated" group, move it there, and mark it for exile. Test Plan: Edited a commit rule, saw it in "Deprecated" group at the bottom of the list: {F5395001} Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13048, T13041 Differential Revision: https://secure.phabricator.com/D18932 --- src/__phutil_library_map__.php | 2 ++ .../herald/DiffusionCommitReviewerHeraldField.php | 6 +++++- .../herald/field/HeraldDeprecatedFieldGroup.php | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/applications/herald/field/HeraldDeprecatedFieldGroup.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 1d9159f714..a134df5e1e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1362,6 +1362,7 @@ phutil_register_library_map(array( 'HeraldController' => 'applications/herald/controller/HeraldController.php', 'HeraldCoreStateReasons' => 'applications/herald/state/HeraldCoreStateReasons.php', 'HeraldDAO' => 'applications/herald/storage/HeraldDAO.php', + 'HeraldDeprecatedFieldGroup' => 'applications/herald/field/HeraldDeprecatedFieldGroup.php', 'HeraldDifferentialAdapter' => 'applications/differential/herald/HeraldDifferentialAdapter.php', 'HeraldDifferentialDiffAdapter' => 'applications/differential/herald/HeraldDifferentialDiffAdapter.php', 'HeraldDifferentialRevisionAdapter' => 'applications/differential/herald/HeraldDifferentialRevisionAdapter.php', @@ -6561,6 +6562,7 @@ phutil_register_library_map(array( 'HeraldController' => 'PhabricatorController', 'HeraldCoreStateReasons' => 'HeraldStateReasons', 'HeraldDAO' => 'PhabricatorLiskDAO', + 'HeraldDeprecatedFieldGroup' => 'HeraldFieldGroup', 'HeraldDifferentialAdapter' => 'HeraldAdapter', 'HeraldDifferentialDiffAdapter' => 'HeraldDifferentialAdapter', 'HeraldDifferentialRevisionAdapter' => array( diff --git a/src/applications/diffusion/herald/DiffusionCommitReviewerHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitReviewerHeraldField.php index 2a09eff83e..420c2576ec 100644 --- a/src/applications/diffusion/herald/DiffusionCommitReviewerHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitReviewerHeraldField.php @@ -6,7 +6,11 @@ final class DiffusionCommitReviewerHeraldField const FIELDCONST = 'diffusion.commit.reviewer'; public function getHeraldFieldName() { - return pht('Reviewer'); + return pht('Reviewer (Deprecated)'); + } + + public function getFieldGroupKey() { + return HeraldDeprecatedFieldGroup::FIELDGROUPKEY; } public function getHeraldFieldValue($object) { diff --git a/src/applications/herald/field/HeraldDeprecatedFieldGroup.php b/src/applications/herald/field/HeraldDeprecatedFieldGroup.php new file mode 100644 index 0000000000..2b3bd5835c --- /dev/null +++ b/src/applications/herald/field/HeraldDeprecatedFieldGroup.php @@ -0,0 +1,15 @@ +