Repository navigation
ci: split the ci job into check, unit, lint and build jobs - #267
Draft
ruifigueira wants to merge 2 commits into
Draft
ruifigueira wants to merge 2 commits into
ruifigueira wants to merge 2 commits into
Conversation
The ci job ran the checks, the Rust lint, the Rust host tests, vitest, the dev build with its drift check, the formatter, oxlint and the workspace checks in sequence. A failure in one step hid the result of every later step, and a flaky test meant rerunning all of them. Each group is now its own job, like the e2e, Playwright, Puppeteer and WPT lanes, so they run in parallel, report their own check and rerun on their own. On bazelflare they share actions, so the Rust crates still compile once. A fork's pull request builds on the runner, so there each job compiles the crates it needs. The vouch gate moves to its own job that the four jobs need. The main ruleset requires a check named ci, and a required check counts a skipped job as passing, so ci is now a job that fails unless vouch and the four jobs all succeeded. The lint and build jobs keep pnpm install: oxlint's type-aware rules read types from node_modules and report false errors without them. The Bazel targets ignore node_modules (REPO.bazel), so check and unit skip the install. Every job restores one repository cache entry and only check saves it, so on a cache miss check also fetches the other jobs' repositories with bazel build --nobuild before it saves. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
These jobs did not wait for the vouch gate. On an unvouched pull request they still started and showed a green check, though they ran no tests: the pull request comes from a fork, which gets no OIDC token, so they skip every step that needs bazelflare. Make them wait for the vouch job like the other jobs. Their checks then show as skipped, not as passed, until a maintainer approves the run. The gate also keeps unvouched code off bazelflare if forks ever get a token. The ruleset does not require these checks, so the ci job does not wait for them. The vouch job takes about 8 seconds, which the WPT job, the longest at about 9 minutes, now waits for. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The
cijob ran these steps one after the other: the checks, the Rust lint, the Rust host tests, vitest, the dev build with its drift check, the formatter, oxlint and the workspace checks. A failed step stopped all the steps after it, so you saw only the first error. A flaky test made you run all the steps again.This change splits the job into four jobs, like the e2e, Playwright, Puppeteer and WPT jobs. The four jobs run in parallel, report their own checks and rerun on their own.
Behavior and API impact
None for the engine. Only CI changes.
The required check
cistays, so the ruleset onmaindoes not change. Thecicheck is now the final job that collects the results.Implementation
vouche2e,playwright,puppeteerandwpt.checkbazel test //:check. Onmain, this job saves the Bazel repository cache.unitbazel test //packages/core:host_tests //packages/engine:vitestlintpnpm install,format:check,lint:js,workspace_checks,bazel test //:rust_lintbuildpnpm install,pnpm run build, the generated-drift checkcivouchand the four work jobs succeeded.enqueuein bazelflare'sworker/src/do/scheduler.ts). Thus the Rust crates compile once.cijob: a required check counts a skipped job as passing. If the vouch gate fails, GitHub skips the work jobs. Thecijob counts a skipped job as a failure, so the check still fails.vouchtoo: before this change,e2e,playwright,puppeteerandwptdid not wait for the gate. On an unvouched pull request from a fork, they ran no tests but showed a green check. They now show as skipped until a maintainer approves the run. The ruleset does not require them, socidoes not wait for them.pnpm installonly where it is necessary: the type-aware rules oflint:jsread types fromnode_modules. The Bazel targets ignorenode_modules(REPO.bazel), socheckandunitdo not install.checksaves the entry. On a cache miss onmain,checkfirst fetches the repositories of the other jobs withbazel build --nobuild.Validation
actionlint .github/workflows/ci.yml: no errors.pnpm run format:check: passes.bazel run //scripts:lint -- lint:jswithoutnode_modules: exit 1, with 2 falseexplicit-boundary-returnserrors. Afterpnpm install --frozen-lockfile: exit 0. This result is whylintkeeps the install.bazel run //scripts:lint -- format --checkandbazel run //scripts:workspace_checkswithoutnode_modules: both pass.bazel build --nobuildon the targets of the other jobs: passes locally in about 80 s.pnpm run checkandpnpm run test:e2e: not run. This change edits only the workflow.The CI run of this pull request is the real test of the new jobs. The cache save step runs only on
main, so this pull request cannot test it.Risks and follow-ups
check,unitandlintthen compiles the Rust crates that it needs. This uses more runner minutes, but the time until all jobs finish does not increase. 7 of the last 100 pull requests came from forks.vouchjob finishes, which takes about 8 seconds. Thewptjob is the longest at about 9 minutes, so the full run takes about 10 to 20 seconds longer.Checklist
Signed-off-byline (git commit -s); see CONTRIBUTING.md.beep-boop-🤖