Repository navigation
ci: offload frontend and policy checks to Bazel workers #4387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import assert from "node:assert/strict"; | ||
| import { createHash } from "node:crypto"; | ||
| import { mkdtemp, readdir, readFile, rm } from "node:fs/promises"; | ||
| import { tmpdir } from "node:os"; | ||
| import path from "node:path"; | ||
| import { createRequire } from "node:module"; | ||
| import { spawnSync } from "node:child_process"; | ||
|
|
||
| const require = createRequire(import.meta.url); | ||
| const packageJson = require.resolve("@rsbuild/core/package.json"); | ||
| const cli = path.resolve(path.dirname(packageJson), "bin/rsbuild.js"); | ||
|
|
||
| // Independently rebuild twice: a cache hit cannot prove determinism. | ||
| const temporary = await mkdtemp(path.join(tmpdir(), "dashboard-determinism-")); | ||
| try { | ||
| const outputs = []; | ||
| const destination = path.join(temporary, "app-dist"); | ||
| for (let attempt = 0; attempt < 2; attempt++) { | ||
| const result = spawnSync(process.execPath, [cli, "build"], { | ||
| env: { ...process.env, TRACEDECAY_DASHBOARD_DIST_PATH: destination }, | ||
| stdio: "inherit", | ||
| }); | ||
| if (result.error) throw result.error; | ||
| assert.equal(result.status, 0, "dashboard build failed"); | ||
| const entries = await readdir(destination, { recursive: true, withFileTypes: true }); | ||
| const files = entries.filter((entry) => entry.isFile()).map((entry) => | ||
| path.relative(destination, path.join(entry.parentPath, entry.name))).sort(); | ||
| assert.ok(files.length > 0, "dashboard build emitted no files"); | ||
| outputs.push(await Promise.all(files.map(async (file) => | ||
| [file, createHash("sha256").update(await readFile(path.join(destination, file))).digest("hex")]))); | ||
| } | ||
| assert.deepEqual(outputs[0], outputs[1], "dashboard builds must be byte-identical"); | ||
| } finally { | ||
| await rm(temporary, { recursive: true, force: true }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Hosted dashboard cache never warms
On hosted-only runs,
dashboardrestores theci-dashboardaction cache but never saves its new Bazel outputs. No other job saves that cache key, so later runs repeatedly miss these outputs.Learn more
The shared setup action restores the job's named Bazel disk cache when the Tailscale client ID is empty. It does not save that cache after the build; other Bazel jobs explicitly use
actions/cache/savewithsteps.bazel.outputs.disk-cache-pathanddisk-cache-key. This job introduces a distinctci-dashboardkey but lacks a matching save step, so master cannot populate the cache restored by later hosted-only jobs.Example: A hosted master dashboard build populates its local action cache and completes. A later fork PR restores
ci-dashboard, finds no saved master entry, and repeats those actions.Recommended fix: Add a master-only, always-on save step to
dashboard, following the other Bazel jobs and using thebazelstep's output path and key. Keep it conditional on the key being nonempty so fleet runs do not attempt a disk-cache save.Was this helpful? React with 👍 or 👎 to provide feedback.