commit | 3ab4e5223799bdd56bfef1ccadcccab1d6ea1602 | [log] [tgz] |
---|---|---|
author | Patrick Hiesel <hiesel@google.com> | Mon Mar 09 14:43:57 2020 |
committer | Patrick Hiesel <hiesel@google.com> | Mon Mar 09 14:43:57 2020 |
tree | 77bd36fbf5c4ed21de49d92a88be74681923bef3 | |
parent | 3badaab5e7930a57c065fa075f2cfd2b6878f9a8 [diff] |
Assert on StorageException in StorageException In GitNumberFooterGeneratorIT#mergeInvalidParentMissingFooterMisconfiguration the comment says that this should not happen in production. A recent refactoring in Gerrit core makes this case throw a StorageException instead of a ResourceConflictException. That will newly translate into an HTTP 500. For a case that 'should not happen in production' that seems legitimate. This is necessary because of: https://gerrit-review.googlesource.com/c/gerrit/+/258077 Change-Id: I446aecf3d95ba5bd8f005e51491f1b17a2d3a1dd Reviewed-on: https://chromium-review.googlesource.com/c/infra/gerrit-plugins/git-numberer/+/2093479 Reviewed-by: Edwin Kempin <ekempin@google.com>
This plugin ensures commit footers in a repository comply with rules of Git number footers for Chromium and is part of the Git Numberer for Chromium system.
For every new commit C that is about to be pushed with git push
or landed using Gerrit API/UI (called merged in Gerrit), this plugin ensures:
Cr-Commit-Position: refs/foo/bar@{#X}
, where X
is positive integer.Cr-Commit-Position: refs/foo/bar@{#Y}
such that Y = X+1
.There is more to it in the doc Git number footers for Chromium.
This plugin consists of verification and generation parts, each working independently of each other, but share common libraries. While each part can be enabled on specific refs independently of another, it's recommended that verifier is enabled on all refs on which generation is enabled.
Safety comes first. This plugin installs a verifier that ensures that all new commits on enabled refs comply with the numbering scheme. The new commits may be created as a result of landing (merging) a Gerrit changelist, or as a result of a git push operation.
NOTE This is a Gerrit plugin and thus it only works for operations done through Gerrit. Thus, this plugin won‘t protect from bad commits being pushed by someone with direct access to Git repository filesystem on Gerrit’s server. Google's deployment of Gerrit internally calls such access _direct push. Such access could be useful to administrators when pushing humongous histories as in during Chromium + Blink merge, but then administrators are responsible for verification.
TODO(Tandrii): implement and document.
git cl
and its fork in Commit Queue which generate footers for Rietveld issues.Follow this general Gerrit guide first to get basic set up correctly.
Checkout (or symlink) this repo into plugins/git-numberer
directory inside primary Gerrit checkout.
bazel build git-numberer bazel test git_numberer_tests