grafana / wait-for-github

GNU Affero General Public License v3.0
13 stars 5 forks source link

fix(ci): wait for checks too when waiting for all CI #164

Closed iainlane closed 1 month ago

iainlane commented 1 month ago

We have an issue at the minute when checking for the combined CI result on a commit. We don't handle checks at all, only statuses. This means that we ignore any check results, even if it is a failure. That's because we currently use the "combined status" as our result, but this does not include checks in its value.

In 95af53a4f1878b2a4f2522dae8aa4fa6f6012257 we fixed a related bug where we'd hang forever if there were no statuses. What we do now is say that the commit passed CI, so allowing dependent steps to execute assuming the thing they were waiting on is good. But we should also be positively considering checks too, not returning a pass in this case. It could be that there are checks and they fail, but we don't know this.

That's what we do here. Taking the same approach as we do for statuses, we now look at checks as well. If there aren't any when we first look, we'll wait a bit and then check again. If there still aren't any, this counts as a pass. If at the end of this process, the result is not a pass we'll report that. Otherwise, all checks have passed (or there aren't any checks), so we go on to look at statuses as we did before.

Closes: #153