Can a Checks API plugin block submitting?

86 views
Skip to first unread message

Kate

unread,
Jan 16, 2026, 8:12:24 AMJan 16
to Repo and Gerrit Discussion
Is it possible for a Checks API plugin to block submitting a change, or is that only possible by voting?

I know I can add a related label to a check run, but that then only displays a badge with the number of errors next to that label (which is already nice of course), but that badge does not block submitting, like a -1 vote would.

Is it possible to write a submit requirement that does not allow submitting unless all checks plugins return a `CheckRun` that completed successfully and does not show errors?

Thanks,
Kate

David Åkerman

unread,
Jan 19, 2026, 4:22:36 AMJan 19
to Repo and Gerrit Discussion
Hi Kate,

The documentation[1] has this example for a general CI check:
[submit-requirement "Verified"]
  description = CI result status for build and tests is passing
  applicableIf = -branch:refs/meta/config
  submittableIf = label:Verified=MAX AND -label:Verified=MIN
  canOverrideInChildProjects = true

You could use that and just replace the all the Verified with the name of your check label and modify the description to something that fits, then you have something that blocks.

[1] https://gerrit-review.googlesource.com/Documentation/config-submit-requirements.html

Best regards,
David



Kate

unread,
Jan 20, 2026, 9:50:58 AMJan 20
to Repo and Gerrit Discussion
Hi David,

thanks for your reply, but unfortunately I don't think it works that way, at least for me right now.

20260120-154335-002.png

I know about submit requirements and have configured several for projects on our server, but I could not find anything about tying submit requirements and the Checks API together.

As you can see in my screenshot, I have configured a submit requirement for the Code-Review label, and the result of the checks run is also tied to that label, but the error badge does not seem to trigger the "-label:Code-Review=MIN" condition, like a -2 vote would do.

So that is my question, can I write a submit requirement that requires a positive checks run to be present on the change? Or one that blocks if a negative run is present?

The best alternative that comes to mind is to make the checks plugin vote via the REST API, but I wonder if there might be a better solution...

Thanks again,
Kate

Luca Milanesio

unread,
Jan 21, 2026, 8:00:48 AMJan 21
to Repo and Gerrit Discussion, Luca Milanesio
Hi Kate,

I believe there is a misunderstanding of what Checks API [1] are and how they work.

1. Checks API are “browser to CI” communication

The document [1] title is "JavaScript Plugin Checks API” which means the Gerrit tag calls a piece of JavaScript provided by a plugin.
The execution stays on your browser.


On 20 Jan 2026, at 14:50, Kate <katrin....@sprecher-automation.com> wrote:

Hi David,

thanks for your reply, but unfortunately I don't think it works that way, at least for me right now.

20260120-154335-002.png

I know about submit requirements and have configured several for projects on our server, but I could not find anything about tying submit requirements and the Checks API together.

2. Submit requirements are evaluated by the Gerrit backend, not the browser. The Submit requirements are unaware of what your JavaScript code does on the browser.


As you can see in my screenshot, I have configured a submit requirement for the Code-Review label, and the result of the checks run is also tied to that label, but the error badge does not seem to trigger the "-label:Code-Review=MIN" condition, like a -2 vote would do.

So that is my question, can I write a submit requirement that requires a positive checks run to be present on the change? Or one that blocks if a negative run is present?

3. Because Checks API lives in the browser, the Submit Requirements would need your browser to work, assuming they could get the output of your check from JavaScript.


The best alternative that comes to mind is to make the checks plugin vote via the REST API, but I wonder if there might be a better solution...

That’s not the *alternative* but *the solution*: Gerrit uses Labels to vote on changes. Your CI system can provide a label for a verified change and that can be used inside a submit requirement.
Checks API are a “nicely formatted view” of your CI system, that’s it.

HTH

Luca.




Thanks again,
Kate



--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/7e4f9433-f631-44c3-8c4c-f2a899c42cb8n%40googlegroups.com.
20260120-154335-002.png

Reply all
Reply to author
Forward
0 new messages