Repository navigation
ci: start runners only for work a pull request, queue group or push needs - #352
Merged
Merged
Conversation
bnb
previously approved these changes
Oct 31, 2026
Coverage Report for apps/web
File CoverageNo changed files found.SizeCompared with main. KiB are 1,024 bytes.
|
Coverage Report for apps/localtoolbox
File CoverageNo changed files found.SizeCompared with main. KiB are 1,024 bytes.
|
Rust coverageFrom run 11. Both are held to the thresholds in .cargo/config.toml.
|
Contributor
Author
|
Closing and reopening so CI and CodeQL run against main now that #350 merged and this retargeted. Branch unchanged. |
bnb
approved these changes
Oct 31, 2026
This was referenced Nov 1, 2026
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.
What and why
An audit of #349 and #350's CI found runners that start with nothing to do. In the 72 hours from Oct 28 there were 7,324 jobs and 19,905 job-minutes, and the 20-job cap was full for 254 minutes. This stacks on #350 and edits its
ci.yml.ci.yml
locallibrary_docs,locallibrary_cache,locallibrary_deny,locallibrary_dist,web_verify,web_e2e,web_docker,repo_checks_policy,repo_checks_ruleset,codeqlandcodeql_languages.main-artifactreads, and only when code they measure changed. It's also the Rust caches (lint, build, msrv and the mix report's) and the Docker cache when what they're keyed on changed, CodeQL, and the ruleset check when the ruleset file changed. Its commit is the merge queue group's, which already passed. This is the biggest single saving: main's pushes were 21.8% of job-minutes.cancel-in-progressis off for pushes to main: 50 main jobs had run for over 5 minutes before a newer merge cancelled them. GitHub keeps only one run waiting per group.if(always() && (...)), so it takes a runner only to fail. A required job that itsifskips counts as passing. Its draft message now says "Re-run all jobs", since re-running only failed jobs reuses the draft's result.locallibrarytakes onlylocallibrary-ci.ymlfrom the workflows. Of the lexicons it takes only the ones the Rust code embeds or its test reads, and of the tokens onlycolors.json,colors.schema.jsonandmix.json. It leaves outbombadil/,icon.svganddeny.toml.cargo doc.cargo denyruns whenCargo.lock, a manifest ordeny.tomlchanges.web_e2eandweb_dockerare new. Docker keeps the tool docs, sincedocker-smoke.shchecks the install page. e2e keeps the tools' READMEs, since the home page's cards are built from them.web_integrationleaves out the lint configs and the e2e, Docker, Lighthouse and knip files.workflow_lintcovers only what actionlint and zizmor read.all(a change toci.yml) no longer forces macOS and Windows in the queue.mix_reportnow covers every crate the CLI builds from, the CLI, the lockfile and the toolchain.scripts/mix-fixture.tsbuildslocallibrary-clifrom the workspace..config/nextest.tomlandtools/hegel-coverage.shjoinlocallibrary.patches/**joins every pnpm tool's filter.pr-comment,size-report,main-artifact) join the filters of the tools that use them.codeql.ymlruns onworkflow_call). It runs on every pull request into main, merge queue group and push to main, but not on drafts. The workflows' analysis always runs, so every commit has a result for the code scanning rule. TypeScript and Rust run only when their code changed: 49 of 130 pull request runs ran Rust's 13 to 19 minute analysis without a.rschange.Called workflows
featuresanddocsare now steps inlint. The headless clippy runs before ALSA's headers are installed, so it still checks what thefeaturesjob checked.lintalso runsdist planand the "only locallibrary-cli" check whendistis set.testandhegelrun only withlinux,buildandmsrvalso forcache, anddenywithdeny. The coverage report skips when coverage didn't run.verify,e2eanddockerinputs. Its report skips when there's neither coverage nor sizes to post.policyandrulesetinputs. The weekly run checks only the ruleset and the lexicons'breaking, which is what changes outside the repo.Other workflows
locallibrary-bench.yml. main has no benchmarks, so its 468 runs in 14 days found none. bnb/perf brings it back, and the docs say where to find it in the history.pull_requesttrigger; the plan runs inlint.reopened, and not on drafts.reopened.multi-ecosystem-groups). Security updates keep their own groups.changesjob that skips them when nothing they test changed since their last scheduled or manual run that passed.last-passedtakes aneventsinput for this, and its default behaviour is unchanged. Advisories still run every week. The report jobs skip on a week whose suites skipped, which only follows a week that passed.Policies
ifnow, and so is the draft condition.cancel-in-progressmay be${{ github.event_name != 'push' }}.codeql.ymlcalled from a workflow that runs onmerge_group.include_str!,include_bytes!) isn't in thelocallibraryfilter.tools/policy.shlists them intoembedded-files.json.ungated.Docs:
.github/CONTRIBUTING.md,.github/NEW_PROJECT.md,apps/locallibrary/CONTRIBUTING.mdandapps/locallibrary/TODO.mdsay what runs when. CONTRIBUTING says to mergemaininstead of closing and reopening to re-run CI, which was 11.4% of job-minutes.No ruleset change: "CI passed" keeps its name.
How it was tested
tools/policy.sh: 82/82 Rego tests at full coverage, 50/50 conftest checks. Each new or changed rule failed when broken on purpose (7 mutations, each failing 1 or 2 tests).zizmor --offlineare clean.ci.yml, merge groups with and without Rust, pushes with and without a lockfile change, theall-oslabel and a 3000-file pull request.Checklist
docs/and--helpstill say what the code does