CombinedCheckState: factor out code for counting check states

Currently, the "IN_PROGRESS" combined check state doesn't
work well for required and optional check states. The
problem is as an "enum", "IN_PROGRESS" can only have one
"passing" state (true or false), which affects whether
we should block submission or not.

But whether a "IN_PROGRESS" is passing or not depends on
whether there are required check states pending. That
means it can be true or false.

To resolve this, we have two possibilities:
1- split "IN_PROGRESS" into two, e.g.
"IN_PROGRESS_BLOCKING" and "IN_PROGRESS_NOT_BLOCKING".
But these names would probably be long and could
confuse users.

2- this commit proposes to keep the current combined
check state definition, but doesn't hard-code the
"passing" state in the "enum". This commit is a no-op
for Checks#getCombinedCheckState but it makes it
much easier to share the code for extracting the
"CheckStateCount".

The follow-up commit will teach the submittable check
to use "CheckStateCount" information and remove
the "pass" boolean from "CombinedCheckState" in the
end.

Change-Id: Ia85f9f9b9d947699f3c34216642814121a772b1e
1 file changed
tree: 7bee52a08959ad4702b1d99d65ac1c137f1a40ee
  1. gr-checks/
  2. java/
  3. javatests/
  4. proto/
  5. resources/
  6. BUILD
  7. LICENSE
  8. README.md
README.md

Gerrit Code Review Checks Plugin

This plugin provides a unified experience for checkers (CI systems, static analyzers, etc.) to integrate with Gerrit Code Review.