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