Class MergeValidators
- java.lang.Object
-
- com.google.gerrit.server.git.validators.MergeValidators
-
public class MergeValidators extends Object
Collection of validators that run inside Gerrit before a change is submitted. The main purpose is to ensure that NoteDb data is mutated in a controlled way.The difference between this and
OnSubmitValidatorsis that this validates the original commit. Depending on theSubmitStrategythat the project chooses, the resulting commit in the repo might differ from this original commit. In case you want to validate the resulting commit, useOnSubmitValidators
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMergeValidators.AccountMergeValidatorstatic interfaceMergeValidators.Factorystatic classMergeValidators.GroupMergeValidatorValidator to ensure that group refs are not mutated.static classMergeValidators.PluginMergeValidationListenerValidator that calls to plugins that provide additional validators.static classMergeValidators.ProjectConfigValidatorValidator for any commits torefs/meta/config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidatePreMerge(org.eclipse.jgit.lib.Repository repo, CodeReviewCommit.CodeReviewRevWalk revWalk, CodeReviewCommit commit, ProjectState destProject, BranchNameKey destBranch, PatchSet.Id patchSetId, IdentifiedUser caller)Runs all validators and throws aMergeValidationExceptionfor the first validator that failed.
-
-
-
Method Detail
-
validatePreMerge
public void validatePreMerge(org.eclipse.jgit.lib.Repository repo, CodeReviewCommit.CodeReviewRevWalk revWalk, CodeReviewCommit commit, ProjectState destProject, BranchNameKey destBranch, PatchSet.Id patchSetId, IdentifiedUser caller) throws MergeValidationExceptionRuns all validators and throws aMergeValidationExceptionfor the first validator that failed. Only the first violation is propagated and processing is stopped thereafter.- Throws:
MergeValidationException
-
-