Class MergeValidators
java.lang.Object
com.google.gerrit.server.git.validators.MergeValidators
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 OnSubmitValidators is that this validates the original
commit. Depending on the SubmitStrategy that the project
chooses, the resulting commit in the repo might differ from this original commit. In case you
want to validate the resulting commit, use OnSubmitValidators
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic classValidator to ensure that group refs are not mutated.static classValidator that calls to plugins that provide additional validators.static classValidator for any commits torefs/meta/config. -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidatePreMerge(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 Details
-
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 MergeValidationException Runs all validators and throws aMergeValidationExceptionfor the first validator that failed. Only the first violation is propagated and processing is stopped thereafter.- Throws:
MergeValidationException
-