@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at recaptime-dev/main 256 lines 10 kB view raw
1<?php 2 3final class PhabricatorDifferentialConfigOptions 4 extends PhabricatorApplicationConfigOptions { 5 6 public function getName() { 7 return pht('Differential'); 8 } 9 10 public function getDescription() { 11 return pht('Configure Differential code review.'); 12 } 13 14 public function getIcon() { 15 return 'fa-cog'; 16 } 17 18 public function getGroup() { 19 return 'apps'; 20 } 21 22 public function getApplicationClassName() { 23 return PhabricatorDifferentialApplication::class; 24 } 25 26 public function getOptions() { 27 $caches_href = PhabricatorEnv::getDoclink('Managing Caches'); 28 29 $custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType'; 30 31 $fields = array( 32 new DifferentialSummaryField(), 33 new DifferentialTestPlanField(), 34 new DifferentialReviewersField(), 35 new DifferentialProjectReviewersField(), 36 new DifferentialRepositoryField(), 37 38 new DifferentialManiphestTasksField(), 39 new DifferentialCommitsField(), 40 41 new DifferentialJIRAIssuesField(), 42 new DifferentialAsanaRepresentationField(), 43 44 new DifferentialChangesSinceLastUpdateField(), 45 new DifferentialBranchField(), 46 47 new DifferentialBlameRevisionField(), 48 new DifferentialPathField(), 49 new DifferentialHostField(), 50 new DifferentialLintField(), 51 new DifferentialUnitField(), 52 new DifferentialRevertPlanField(), 53 ); 54 55 $default_fields = array(); 56 foreach ($fields as $field) { 57 $default_fields[$field->getFieldKey()] = array( 58 'disabled' => $field->shouldDisableByDefault(), 59 ); 60 } 61 62 $inline_description = $this->deformat( 63 pht(<<<EOHELP 64To include patches inline in email bodies, set this option to a positive 65integer. Patches will be inlined if they are at most that many lines and at 66most 256 times that many bytes. 67 68For example, a value of 100 means "inline patches if they are at not more than 69100 lines long and not more than 25,600 bytes large". 70 71By default, patches are not inlined. 72EOHELP 73 )); 74 75 return array( 76 $this->newOption( 77 'differential.fields', 78 $custom_field_type, 79 $default_fields) 80 ->setCustomData( 81 id(new DifferentialRevision())->getCustomFieldBaseClass()) 82 ->setDescription( 83 pht( 84 'Select and reorder revision fields.')), 85 $this->newOption('differential.require-test-plan-field', 'bool', true) 86 ->setBoolOptions( 87 array( 88 pht("Require 'Test Plan' field"), 89 pht("Make 'Test Plan' field optional"), 90 )) 91 ->setSummary(pht('Require "Test Plan" field?')) 92 ->setDescription( 93 pht( 94 "Differential has a required 'Test Plan' field by default. You ". 95 "can make it optional by setting this to false. You can also ". 96 "completely remove it above, if you prefer.")), 97 $this->newOption('differential.enable-email-accept', 'bool', false) 98 ->setBoolOptions( 99 array( 100 pht('Enable Email "!accept" Action'), 101 pht('Disable Email "!accept" Action'), 102 )) 103 ->setSummary(pht('Enable or disable "!accept" action via email.')) 104 ->setDescription( 105 pht( 106 'If inbound email is configured, users can interact with '. 107 'revisions by using "!actions" in email replies (for example, '. 108 '"!resign" or "!rethink"). However, by default, users may not '. 109 '"!accept" revisions via email: email authentication can be '. 110 'configured to be very weak, and email "!accept" is kind of '. 111 'sketchy and implies the revision may not actually be receiving '. 112 'thorough review. You can enable "!accept" by setting this '. 113 'option to true.')), 114 $this->newOption('differential.generated-paths', 'list<regex>', array()) 115 ->setSummary(pht('File regexps to treat as automatically generated.')) 116 ->setDescription( 117 pht( 118 'List of file regexps that should be treated as if they are '. 119 'generated by an automatic process, and thus be hidden by '. 120 'default in Differential.'. 121 "\n\n". 122 'NOTE: This property is cached, so you will need to purge the '. 123 'cache after making changes if you want the new configuration '. 124 'to affect existing revisions. For instructions, see '. 125 '**[[ %s | Managing Caches ]]** in the documentation.', 126 $caches_href)) 127 ->addExample("/config\.h$/\n#(^|/)autobuilt/#", pht('Valid Setting')), 128 $this->newOption('differential.sticky-accept', 'bool', true) 129 ->setBoolOptions( 130 array( 131 pht('Accepts persist across updates'), 132 pht('Accepts are reset by updates'), 133 )) 134 ->setSummary( 135 pht('Should "Accepted" revisions remain "Accepted" after updates?')) 136 ->setDescription( 137 pht( 138 'Normally, when revisions that have been "Accepted" are updated, '. 139 'they remain "Accepted". This allows reviewers to suggest minor '. 140 'alterations when accepting, and encourages authors to update '. 141 'if they make minor changes in response to this feedback.'. 142 "\n\n". 143 'If you want updates to always require re-review, you can disable '. 144 'the "stickiness" of the "Accepted" status with this option. '. 145 'This may make the process for minor changes much more burdensome '. 146 'to both authors and reviewers.')), 147 $this->newOption('differential.allow-self-accept', 'bool', false) 148 ->setBoolOptions( 149 array( 150 pht('Allow self-accept'), 151 pht('Disallow self-accept'), 152 )) 153 ->setSummary(pht('Allows users to accept their own revisions.')) 154 ->setDescription( 155 pht( 156 "If you set this to true, users can accept their own revisions. ". 157 "This action is disabled by default because it's most likely not ". 158 "a behavior you want, but it proves useful if you are working ". 159 "alone on a project and want to make use of all of ". 160 "differential's features.")), 161 $this->newOption('differential.always-allow-close', 'bool', false) 162 ->setBoolOptions( 163 array( 164 pht('Allow any user'), 165 pht('Restrict to submitter'), 166 )) 167 ->setSummary(pht('Allows any user to close accepted revisions.')) 168 ->setDescription( 169 pht( 170 'If you set this to true, any user can close any revision so '. 171 'long as it has been accepted. This can be useful depending on '. 172 'your development model. For example, github-style pull requests '. 173 'where the reviewer is often the actual committer can benefit '. 174 'from turning this option to true. If false, only the submitter '. 175 'can close a revision.')), 176 $this->newOption('differential.always-allow-abandon', 'bool', false) 177 ->setBoolOptions( 178 array( 179 pht('Allow any user'), 180 pht('Restrict to submitter'), 181 )) 182 ->setSummary(pht('Allows any user to abandon revisions.')) 183 ->setDescription( 184 pht( 185 'If you set this to true, any user can abandon any revision. If '. 186 'false, only the submitter can abandon a revision.')), 187 $this->newOption('differential.allow-reopen', 'bool', false) 188 ->setBoolOptions( 189 array( 190 pht('Enable reopen'), 191 pht('Disable reopen'), 192 )) 193 ->setSummary(pht('Allows any user to reopen a closed revision.')) 194 ->setDescription( 195 pht( 196 'If you set this to true, any user can reopen a revision so '. 197 'long as it has been closed. This can be useful if a revision '. 198 'is accidentally closed or if a developer changes his or her '. 199 'mind after closing a revision. If it is false, reopening '. 200 'is not allowed.')), 201 $this->newOption('differential.close-on-accept', 'bool', false) 202 ->setBoolOptions( 203 array( 204 pht('Treat Accepted Revisions as "Closed"'), 205 pht('Treat Accepted Revisions as "Open"'), 206 )) 207 ->setSummary(pht('Allows "Accepted" to act as a closed status.')) 208 ->setDescription( 209 pht( 210 'Normally, Differential revisions remain on the dashboard when '. 211 'they are "Accepted", and the author then commits the changes '. 212 'to "Close" the revision and move it off the dashboard.'. 213 "\n\n". 214 'If you have an unusual workflow where Differential is used for '. 215 'post-commit review (normally called "Audit", elsewhere), you '. 216 'can set this flag to treat the "Accepted" '. 217 'state as a "Closed" state and end the review workflow early.'. 218 "\n\n". 219 'This sort of workflow is very unusual. Very few installs should '. 220 'need to change this option.')), 221 $this->newOption( 222 'metamta.differential.attach-patches', 223 'bool', 224 false) 225 ->setBoolOptions( 226 array( 227 pht('Attach Patches'), 228 pht('Do Not Attach Patches'), 229 )) 230 ->setSummary(pht('Attach patches to email, as text attachments.')) 231 ->setDescription( 232 pht( 233 'If you set this to true, patches will be attached to '. 234 'Differential mail (as text attachments). This will not work if '. 235 'you are using SendGrid as your mail adapter.')), 236 $this->newOption( 237 'metamta.differential.inline-patches', 238 'int', 239 0) 240 ->setSummary(pht('Inline patches in email, as body text.')) 241 ->setDescription($inline_description), 242 $this->newOption( 243 'metamta.differential.patch-format', 244 'enum', 245 'unified') 246 ->setDescription( 247 pht('Format for inlined or attached patches.')) 248 ->setEnumOptions( 249 array( 250 'unified' => pht('Unified'), 251 'git' => pht('Git'), 252 )), 253 ); 254 } 255 256}