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
OnSubmitValidators
is that this validates the original commit. Depending on theSubmitStrategy
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, useOnSubmitValidators
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MergeValidators.AccountMergeValidator
static interface
MergeValidators.Factory
static class
MergeValidators.GroupMergeValidator
Validator to ensure that group refs are not mutated.static class
MergeValidators.PluginMergeValidationListener
Validator that calls to plugins that provide additional validators.static class
MergeValidators.ProjectConfigValidator
Validator for any commits torefs/meta/config
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 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 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
-
-