Files
gerrit/Documentation/config-validation.txt
David Pursehouse 1bf7156705 Reword documentation about plugin-based validation
When this documentation was originally written, the interfaces provided
were only related to commit validation.

Since then other interfaces that are not commit related have been added.

Reword the title and introductory sentences to be more relevant to the
interfaces that are currently available.

Change-Id: I3a6c70a735154fdcf730220919ccb885ffc87615
2014-12-19 14:33:35 +09:00

96 lines
2.8 KiB
Plaintext

= Gerrit Code Review - Plugin-based Validation
Gerrit provides interfaces to allow link:dev-plugins.html[plugins] to
perform validation on certain operations.
[[new-commit-validation]]
== New commit validation
Plugins implementing the `CommitValidationListener` interface can
perform additional validation checks against new commits.
If the commit fails the validation, the plugin can either provide a
message that will be sent back to the git client, or throw an exception
which will cause the commit to be rejected.
Validation applies to both commits uploaded via `git push`, and new
commits generated via Gerrit's Web UI features such as the rebase, revert
and cherry-pick buttons.
Out of the box, Gerrit includes a plugin that checks the length of the
subject and body lines of commit messages on uploaded commits.
[[ref-operation-validation]]
== Ref operation validation
Plugins implementing the `RefOperationValidationListener` interface can
perform additional validation checks against ref creation/deletion operation
before it is applied to the git repository.
If the ref operation fails the validation, the plugin can throw an exception
which will cause the operation to fail.
[[pre-merge-validation]]
== Pre-merge validation
Plugins implementing the `MergeValidationListener` interface can
perform additional validation checks against commits before they
are merged to the git repository.
If the commit fails the validation, the plugin can throw an exception
which will cause the merge to fail.
[[pre-upload-validation]]
== Pre-upload validation
Plugins implementing the `UploadValidationListener` interface can
perform additional validation checks before any upload operations
(clone, fetch, pull). The validation is executed right before Gerrit
begins to send a pack back to the git client.
If upload fails the validation, the plugin can throw an exception
which will cause the upload to fail and the exception's message text
will be reported to the git client.
[[new-project-validation]]
== New project validation
Plugins implementing the `ProjectCreationValidationListener` interface
can perform additional validation on project creation based on the
input arguments.
E.g. a plugin could use this to enforce a certain name scheme for
project names.
[[new-group-validation]]
== New group validation
Plugins implementing the `GroupCreationValidationListener` interface
can perform additional validation on group creation based on the
input arguments.
E.g. a plugin could use this to enforce a certain name scheme for
group names.
[[hashtag-validation]]
== Hashtag validation
Plugins implementing the `HashtagValidationListener` interface can perform
validation of hashtags before they are added to or removed from changes.
GERRIT
------
Part of link:index.html[Gerrit Code Review]
SEARCHBOX
---------