about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-05-27T21·28+0200
committertazjin <tazjin@tvl.su>2022-05-27T22·13+0000
commite9e8e38db7ce2f40b7fc9f56e0ebf54f5df51853 (patch)
tree57a472dd0ed604a72e040de24d101ba6d22e3288
parent0e705fedb04bffb45f02a6798cbaa1ab216d48e9 (diff)
fix(ops/gerrit-tvl): Filter builds by commit hash r/4150
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>
-rw-r--r--ops/gerrit-tvl/static/tvl.js5
1 files 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, {