Package com.google.gerrit.server.project
Class LabelConfigValidator
- java.lang.Object
-
- com.google.gerrit.server.project.LabelConfigValidator
-
- All Implemented Interfaces:
CommitValidationListener
public class LabelConfigValidator extends Object implements CommitValidationListener
Validates modifications to label configurations in theproject.configfile that is stored inrefs/meta/config.Rejects setting/changing deprecated fields that are no longer supported (fields
copyAnyScore,copyMinScore,copyMaxScore,copyAllScoresIfNoChange,copyAllScoresIfNoCodeChange,copyAllScoresOnMergeFirstParentUpdate,copyAllScoresOnTrivialRebase,copyAllScoresIfListOfFilesDidNotChange,copyValue).Updates that unset the deprecated fields or that don't touch them are allowed.
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_COPY_ALL_SCORES_IF_LIST_OF_FILES_DID_NOT_CHANGEstatic StringKEY_COPY_ALL_SCORES_IF_NO_CHANGEstatic StringKEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGEstatic StringKEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATEstatic StringKEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASEstatic StringKEY_COPY_ANY_SCOREstatic StringKEY_COPY_MAX_SCOREstatic StringKEY_COPY_MIN_SCOREstatic StringKEY_COPY_VALUE
-
Constructor Summary
Constructors Constructor Description LabelConfigValidator(DiffOperations diffOperations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CommitValidationMessage>onCommitReceived(CommitReceivedEvent receiveEvent)Commit validation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.gerrit.server.git.validators.CommitValidationListener
shouldValidateAllCommits
-
-
-
-
Field Detail
-
KEY_COPY_ANY_SCORE
public static final String KEY_COPY_ANY_SCORE
- See Also:
- Constant Field Values
-
KEY_COPY_MIN_SCORE
public static final String KEY_COPY_MIN_SCORE
- See Also:
- Constant Field Values
-
KEY_COPY_MAX_SCORE
public static final String KEY_COPY_MAX_SCORE
- See Also:
- Constant Field Values
-
KEY_COPY_VALUE
public static final String KEY_COPY_VALUE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE
public static final String KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASE
public static final String KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE
public static final String KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_IF_NO_CHANGE
public static final String KEY_COPY_ALL_SCORES_IF_NO_CHANGE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_IF_LIST_OF_FILES_DID_NOT_CHANGE
public static final String KEY_COPY_ALL_SCORES_IF_LIST_OF_FILES_DID_NOT_CHANGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LabelConfigValidator
@Inject public LabelConfigValidator(DiffOperations diffOperations)
-
-
Method Detail
-
onCommitReceived
public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent) throws CommitValidationException
Description copied from interface:CommitValidationListenerCommit validation.- Specified by:
onCommitReceivedin interfaceCommitValidationListener- Parameters:
receiveEvent- commit event details- Returns:
- list of validation messages
- Throws:
CommitValidationException- if validation fails
-
-