Class CommitValidators
java.lang.Object
com.google.gerrit.server.git.validators.CommitValidators
Represents a list of
CommitValidationListener
s to run for a push to one branch of one
project.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Don't allow the user to amend a merge created by Gerrit Code Review.static class
Require that author matches the uploader.static class
Reject banned commits.static class
static class
Require that committer matches the uploader.static class
If this is the special project configuration branch, validate the config.static class
static class
Rejects updates to group branches.static class
Rejects updates to projects that don't allow writes.static class
static class
Require permission to upload merge commits. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CommitValidationMessage
invalidEmail
(String type, org.eclipse.jgit.lib.PersonIdent who, IdentifiedUser currentUser, UrlFormatter urlFormatter) invokeCommitValidationInfoListeners
(boolean invokeCommitValidationInfoListeners) Whether theCommitValidationInfoListener
s should be invoked after the validation is done.patchSet
(PatchSet.Id patchSetId) Sets the patch set for which the validation is done.com.google.common.collect.ImmutableMap
<String, CommitValidationInfo> validate
(CommitReceivedEvent receiveEvent)
-
Field Details
-
NEW_PATCHSET_PATTERN
-
-
Method Details
-
patchSet
Sets the patch set for which the validation is done.If the validation is done for a commit that is not associated with a patch set (e.g. when commits are pushed directly, bypassing code-review) this method doesn't need to be called.
- Parameters:
patchSetId
- the patch set for which the validation is done- Returns:
- the
CommitValidators
instance to allow chaining calls
-
invokeCommitValidationInfoListeners
@CanIgnoreReturnValue public CommitValidators invokeCommitValidationInfoListeners(boolean invokeCommitValidationInfoListeners) Whether theCommitValidationInfoListener
s should be invoked after the validation is done.If invoking the
CommitValidationInfoListener
s is skipped, it's the responsibility of the caller to invoke them later. For example, this makes sense when commits are validated and the information about the change/patch-set (seepatchSet(com.google.gerrit.entities.PatchSet.Id)
is not available yet.- Parameters:
invokeCommitValidationInfoListeners
- Whether theCommitValidationInfoListener
s should be invoked after the validation is done.- Returns:
- the
CommitValidators
instance to allow chaining calls
-
validate
@CanIgnoreReturnValue public com.google.common.collect.ImmutableMap<String,CommitValidationInfo> validate(CommitReceivedEvent receiveEvent) throws CommitValidationException - Throws:
CommitValidationException
-
invalidEmail
public static CommitValidationMessage invalidEmail(String type, org.eclipse.jgit.lib.PersonIdent who, IdentifiedUser currentUser, UrlFormatter urlFormatter)
-