3 final class PhabricatorDifferentialConfigOptions
4 extends PhabricatorApplicationConfigOptions
{
6 public function getName() {
7 return pht('Differential');
10 public function getDescription() {
11 return pht('Configure Differential code review.');
14 public function getIcon() {
18 public function getGroup() {
22 public function getOptions() {
23 $caches_href = PhabricatorEnv
::getDoclink('Managing Caches');
25 $custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
28 new DifferentialSummaryField(),
29 new DifferentialTestPlanField(),
30 new DifferentialReviewersField(),
31 new DifferentialProjectReviewersField(),
32 new DifferentialRepositoryField(),
34 new DifferentialManiphestTasksField(),
35 new DifferentialCommitsField(),
37 new DifferentialJIRAIssuesField(),
38 new DifferentialAsanaRepresentationField(),
40 new DifferentialChangesSinceLastUpdateField(),
41 new DifferentialBranchField(),
43 new DifferentialBlameRevisionField(),
44 new DifferentialPathField(),
45 new DifferentialHostField(),
46 new DifferentialLintField(),
47 new DifferentialUnitField(),
48 new DifferentialRevertPlanField(),
51 $default_fields = array();
52 foreach ($fields as $field) {
53 $default_fields[$field->getFieldKey()] = array(
54 'disabled' => $field->shouldDisableByDefault(),
58 $inline_description = $this->deformat(
60 To include patches inline in email bodies, set this option to a positive
61 integer. Patches will be inlined if they are at most that many lines and at
62 most 256 times that many bytes.
64 For example, a value of 100 means "inline patches if they are at not more than
65 100 lines long and not more than 25,600 bytes large".
67 By default, patches are not inlined.
73 'differential.fields',
77 id(new DifferentialRevision())->getCustomFieldBaseClass())
80 "Select and reorder revision fields.\n\n".
81 "NOTE: This feature is under active development and subject ".
83 $this->newOption('differential.require-test-plan-field', 'bool', true)
86 pht("Require 'Test Plan' field"),
87 pht("Make 'Test Plan' field optional"),
89 ->setSummary(pht('Require "Test Plan" field?'))
92 "Differential has a required 'Test Plan' field by default. You ".
93 "can make it optional by setting this to false. You can also ".
94 "completely remove it above, if you prefer.")),
95 $this->newOption('differential.enable-email-accept', 'bool', false)
98 pht('Enable Email "!accept" Action'),
99 pht('Disable Email "!accept" Action'),
101 ->setSummary(pht('Enable or disable "!accept" action via email.'))
104 'If inbound email is configured, users can interact with '.
105 'revisions by using "!actions" in email replies (for example, '.
106 '"!resign" or "!rethink"). However, by default, users may not '.
107 '"!accept" revisions via email: email authentication can be '.
108 'configured to be very weak, and email "!accept" is kind of '.
109 'sketchy and implies the revision may not actually be receiving '.
110 'thorough review. You can enable "!accept" by setting this '.
112 $this->newOption('differential.generated-paths', 'list<regex>', array())
113 ->setSummary(pht('File regexps to treat as automatically generated.'))
116 'List of file regexps that should be treated as if they are '.
117 'generated by an automatic process, and thus be hidden by '.
118 'default in Differential.'.
120 'NOTE: This property is cached, so you will need to purge the '.
121 'cache after making changes if you want the new configuration '.
122 'to affect existing revisions. For instructions, see '.
123 '**[[ %s | Managing Caches ]]** in the documentation.',
125 ->addExample("/config\.h$/\n#(^|/)autobuilt/#", pht('Valid Setting')),
126 $this->newOption('differential.sticky-accept', 'bool', true)
129 pht('Accepts persist across updates'),
130 pht('Accepts are reset by updates'),
133 pht('Should "Accepted" revisions remain "Accepted" after updates?'))
136 'Normally, when revisions that have been "Accepted" are updated, '.
137 'they remain "Accepted". This allows reviewers to suggest minor '.
138 'alterations when accepting, and encourages authors to update '.
139 'if they make minor changes in response to this feedback.'.
141 'If you want updates to always require re-review, you can disable '.
142 'the "stickiness" of the "Accepted" status with this option. '.
143 'This may make the process for minor changes much more burdensome '.
144 'to both authors and reviewers.')),
145 $this->newOption('differential.allow-self-accept', 'bool', false)
148 pht('Allow self-accept'),
149 pht('Disallow self-accept'),
151 ->setSummary(pht('Allows users to accept their own revisions.'))
154 "If you set this to true, users can accept their own revisions. ".
155 "This action is disabled by default because it's most likely not ".
156 "a behavior you want, but it proves useful if you are working ".
157 "alone on a project and want to make use of all of ".
158 "differential's features.")),
159 $this->newOption('differential.always-allow-close', 'bool', false)
162 pht('Allow any user'),
163 pht('Restrict to submitter'),
165 ->setSummary(pht('Allows any user to close accepted revisions.'))
168 'If you set this to true, any user can close any revision so '.
169 'long as it has been accepted. This can be useful depending on '.
170 'your development model. For example, github-style pull requests '.
171 'where the reviewer is often the actual committer can benefit '.
172 'from turning this option to true. If false, only the submitter '.
173 'can close a revision.')),
174 $this->newOption('differential.always-allow-abandon', 'bool', false)
177 pht('Allow any user'),
178 pht('Restrict to submitter'),
180 ->setSummary(pht('Allows any user to abandon revisions.'))
183 'If you set this to true, any user can abandon any revision. If '.
184 'false, only the submitter can abandon a revision.')),
185 $this->newOption('differential.allow-reopen', 'bool', false)
188 pht('Enable reopen'),
189 pht('Disable reopen'),
191 ->setSummary(pht('Allows any user to reopen a closed revision.'))
194 'If you set this to true, any user can reopen a revision so '.
195 'long as it has been closed. This can be useful if a revision '.
196 'is accidentally closed or if a developer changes his or her '.
197 'mind after closing a revision. If it is false, reopening '.
199 $this->newOption('differential.close-on-accept', 'bool', false)
202 pht('Treat Accepted Revisions as "Closed"'),
203 pht('Treat Accepted Revisions as "Open"'),
205 ->setSummary(pht('Allows "Accepted" to act as a closed status.'))
208 'Normally, Differential revisions remain on the dashboard when '.
209 'they are "Accepted", and the author then commits the changes '.
210 'to "Close" the revision and move it off the dashboard.'.
212 'If you have an unusual workflow where Differential is used for '.
213 'post-commit review (normally called "Audit", elsewhere in '.
214 'Phabricator), you can set this flag to treat the "Accepted" '.
215 'state as a "Closed" state and end the review workflow early.'.
217 'This sort of workflow is very unusual. Very few installs should '.
218 'need to change this option.')),
220 'metamta.differential.attach-patches',
225 pht('Attach Patches'),
226 pht('Do Not Attach Patches'),
228 ->setSummary(pht('Attach patches to email, as text attachments.'))
231 'If you set this to true, Phabricator will attach patches to '.
232 'Differential mail (as text attachments). This will not work if '.
233 'you are using SendGrid as your mail adapter.')),
235 'metamta.differential.inline-patches',
238 ->setSummary(pht('Inline patches in email, as body text.'))
239 ->setDescription($inline_description),
241 'metamta.differential.patch-format',
245 pht('Format for inlined or attached patches.'))
248 'unified' => pht('Unified'),