Commit graph

10 commits

Author SHA1 Message Date
Vincent Ambo
aed1fbeb95 fix(gerrit-tvl): Use only one build filter
Buildkite can't handle more than one filter for the query; as of the
last commit it just returned an empty list.

I've verified with curl based on the request the previous attempt
constructed that this works as intended with only setting the commit.

Behaviour is probably undefined if there are two builds for the same
commit (i.e. a retry). Which one will you see? Who knows!

However, since the commit hash contains the Change-Id, we can't get a
situation where the build was for two different CLs at the same
commit. Gerrit wouldn't allow that.

Change-Id: I0dcd0ff44c28d3d15cba23461970bfc8483f4e48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5768
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-05-28 13:39:58 +00:00
Vincent Ambo
e9e8e38db7 fix(ops/gerrit-tvl): Filter builds by commit hash
The patchsetSha is one of the things passed in to the `fetch()`
interface, and Buildkite's API (now?) supports filtering by the commit
hash in addition.

With this combination, we should not accidentally display builds for
the wrong patch set.

Change-Id: I6bb26dd7387f2dd00291990cadd38629ecda999b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5702
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-05-27 22:13:58 +00:00
Vincent Ambo
005cd4037a fix(gerrit-tvl): Handle "broken" (skipped) jobs correctly
by simply skipping them

Change-Id: I9cbec3b79469ae01b1873d6a42e990b98cc4110a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4921
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
2022-01-14 20:44:56 +00:00
Vincent Ambo
a5c9b11a6b fix(gerrit-tvl): Exclude non-command jobs from check results
Change-Id: I13727d30ac7a568f02614a4bbc778afed6a286ba
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4891
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
2022-01-14 20:30:53 +00:00
Vincent Ambo
86a205220f fix(gerrit-tvl): Explicitly specify patchset on check runs
Since we now group patchsets inside of Buildkite, the results are no
longer guaranteed to be for the right patchset.

There might be some metadata passed in from Gerrit that would let us
do this with the commit ID instead, but I haven't checked.

Change-Id: I5b74a17697511160fcc89d3dbef23517d974dc6f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4890
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
2022-01-14 20:30:53 +00:00
Vincent Ambo
e8bf17317e fix(gerrit-tvl): Mark job as failed on all failure states
Change-Id: If0fa85d8178b9e457305d0244ddf67d12a4b3051
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4889
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
2022-01-14 20:30:52 +00:00
Vincent Ambo
e1ffaee1dd fix(gerrit-tvl): Support all documented Buildkite job statuses
I'm not sure where the previous list originated, but it was missing
some officially documented statuses. However, the API definitely
returns statuses that are documented to only appear in other types, so
this commit simply maps ALL statuses that Buildkite has documented for
any type.

Also adds a log statement in case we encounter a brand new, unknown,
undocumented status.

Change-Id: Iff003a3bd2608702019ae0f4137958435ad0856f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4888
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
2022-01-14 20:30:52 +00:00
Vincent Ambo
058bf61193 fix(gerrit-tvl): Fix construction of ref used in Buildkite
... and remove a spammy log statement.

This changed in besadii a while ago and lead to the behaviour of
failing silently, instead of failing with an error saying "undefined
undefined".

Note that with this change merged the plugin probably still won't work
again, but it gets us a step closer to the real error.

Change-Id: I3db25d246f4b1c634d316cd92574e27fb220d769
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4887
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
2022-01-14 20:30:52 +00:00
Luke Granger-Brown
6d008f6412 feat(gerrit-tvl): add Buildkite-backed Checks plugin implementation
This small(*) pile of JavaScript queries the Buildkite API for the
latest builds for the depot and displays the results in the rebooted
Check UI.

Change-Id: I7025a1c6d0d0afa000a9df4682133e03824ea10d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2881
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-04-07 11:19:04 +00:00
Luke Granger-Brown
21765a1407 feat(ops/gerrit-tvl): init TVL Gerrit plugin
This is just going to be a grab bag of things which do TVL-specific
things to Gerrit, whether that be exposing new Prolog predicates or, as
I intend to do as the first thing, expose Buildkite builds as checks.

Change-Id: Iaeab987a1fdbd078b85e274691c986489903bf3a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2872
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-04-06 18:43:04 +00:00