Evaluate submit requirements in submittability checks

The autosubmitter only evaluated legacy submit records from label
functions and ignored Submit Requirements (SRs). Since Gerrit 3.6, SRs
are the standard way to define submittability. As a result, the plugin
attempted to merge changes that were not actually submittable when SRs
were unsatisfied.

This change checks submittability using
ChangeData.submitRequirementsIncludingLegacy() and verifies that each
requirement is fulfilled before proceeding. This aligns the plugin’s
behavior with Gerrit’s submittability model and prevents premature
submission attempts.

Bug: Issue 458294128
Change-Id: I4df85941ecf518ab2875eeb1ef2a02c0bd4be1b5
1 file changed
tree: 5b771e5cf2bbb97c0c8978a878c52294b3571f99
  1. src/
  2. tools/
  3. .bazelignore
  4. .bazelrc
  5. .gitignore
  6. bazlets.bzl
  7. BUILD
  8. LICENSE
  9. README.md
  10. test.rb
  11. tests.txt
  12. WORKSPACE
README.md

Autosubmitter

Build Status

A gerrit plugin that takes care of automatically merging reviews when all approvals are present.

Also, it introduces the concept of cross-repository reviews. Cross repository reviews are reviews that share a common topic, and are all in different gerrit repositories. They will be merged at the same time, when all approvals for all reviews are present, and all reviews are mergeable.

Requires Gerrit 2.14 or later.

Configuration

[automerge]
        botEmail=admin@example.com
[commentlink "change"]
        match = "#/c/(\\d+)"
        html = "<a href=\"/#/c/$1/\">$1</a>"