1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-08 10:24:48 +01:00

Validate commit message fields on the server side

Summary:
See T643. We have some hard-coded checks in Arcanist for the existence of
'testPlan' and 'title', and don't properly validate those fields on the server.
Add a validation pass in the Conduit-based edit pathway.

In particular, this means that if you disable the "Test Plan" field, Arcanist
won't block you anymore.

Test Plan: Disabled Arcanist checks and ran "arc diff"; got blocked on the
server side.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran, btrahan

Differential Revision: 1153
This commit is contained in:
epriestley 2011-12-01 15:43:25 -08:00
parent cfaab709df
commit 40221feed9
2 changed files with 6 additions and 1 deletions

View file

@ -86,6 +86,10 @@ class DifferentialRevisionEditor {
$aux_fields[$field]->setValueFromParsedCommitMessage($value);
}
foreach ($aux_fields as $aux_field) {
$aux_field->validateField();
}
$aux_fields = array_values($aux_fields);
$this->setAuxiliaryFields($aux_fields);
}

View file

@ -166,7 +166,8 @@ abstract class DifferentialFieldSpecification {
* the field is saved. It gives you an opportunity to inspect the field value
* and throw a @{class:DifferentialFieldValidationException} if there is a
* problem with the value the user has provided (for example, the value the
* user entered is not correctly formatted).
* user entered is not correctly formatted). This method is also called after
* @{method:setValueFromParsedCommitMessage} before the revision is saved.
*
* By default, fields are not validated.
*