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>
This commit is contained in:
Vincent Ambo 2022-05-27 23:28:48 +02:00 committed by tazjin
parent 0e705fedb0
commit e9e8e38db7

View file

@ -79,12 +79,12 @@ function jobStateToCheckRunStatus(state) {
const tvlChecksProvider = {
async fetch(change) {
let {changeNumber, patchsetNumber, repo} = change;
let {changeNumber, patchsetSha, repo} = change;
const experiments = window.ENABLED_EXPERIMENTS || [];
if (experiments.includes("UiFeature__tvl_check_debug")) {
changeNumber = 2872;
patchsetNumber = 4;
patchsetSha = '76692104f58b849b1503a8d8a700298003fa7b5f';
repo = 'depot';
}
@ -96,6 +96,7 @@ const tvlChecksProvider = {
const params = {
// besadii groups different patchsets of the same CL under this fake ref
branch: `cl/${changeNumber.toString()}`,
commit: patchsetSha,
};
const url = `https://api.buildkite.com/v2/organizations/tvl/pipelines/depot/builds?${encodeParams(params)}`;
const resp = await fetch(url, {