From e9e8e38db7ce2f40b7fc9f56e0ebf54f5df51853 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 27 May 2022 23:28:48 +0200 Subject: 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 Reviewed-by: sterni --- ops/gerrit-tvl/static/tvl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ops/gerrit-tvl/static/tvl.js b/ops/gerrit-tvl/static/tvl.js index 2c4d7ee473..51c3344c27 100644 --- a/ops/gerrit-tvl/static/tvl.js +++ b/ops/gerrit-tvl/static/tvl.js @@ -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, { -- cgit 1.4.1