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>
This commit is contained in:
Vincent Ambo 2022-05-28 15:34:05 +02:00 committed by clbot
parent 6813598c17
commit aed1fbeb95

View file

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