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 class
static interface
static class
Validator to ensure that group refs are not mutated.static class
Validator that calls to plugins that provide additional validators.static class
Validator for any commits torefs/meta/config
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
validatePreMerge
(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 aMergeValidationException
for 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 aMergeValidationException
for the first validator that failed. Only the first violation is propagated and processing is stopped thereafter.- Throws:
MergeValidationException
-