Skip to content

ci: run macOS and Windows in a merge queue instead of on every push - #350

Merged
botandbang merged 2 commits into
mainfrom
bnb/ci-merge-queue
Oct 31, 2026
Merged

botandbang merged 2 commits into
mainfrom
bnb/ci-merge-queue

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

What and why

Each locallibrary run asked for 6 macOS jobs (lint, build, 3 test shards, coverage), and the Free plan allows 5 at once. In a 21-hour sample, macOS sat at its cap for 160 minutes, and macOS and Windows jobs on pull requests were 31% of all job-minutes.

  • Pull requests and pushes to main run on Linux only. A pull request with the new all-os label runs macOS and Windows too. The label is read from the API, so adding it and re-running CI is enough.
  • ci.yml triggers on merge_group. A group runs only locallibrary's macOS and Windows job, since its pull requests already passed on Linux and the push to main runs Linux again. last-passed diffs a group against the commit it goes on top of.
  • macOS and Windows now get one job each (other-os): clippy, doctests and cargo nextest run, with no coverage or shards. It has a 90-minute timeout, sized from Windows' times in run 41157262485. Coverage and its thresholds are Linux-only now.
  • Moved the Linux build, test, hegel and coverage jobs into locallibrary-ci.yml and removed locallibrary-ci-os.yml, which existed so each OS could fail on its own.
  • Added locallibrary-cache.yml, which runs other-os nightly on main so its caches get saved there (shared-key: other-os).
  • The ruleset gets a merge queue: build at most 2 groups at once, up to 5 pull requests per group, ALLGREEN, merge commits, a 120-minute check timeout.
  • A new policy in ruleset.rego: when the ruleset has a merge queue, every gated workflow triggers on merge_group.
  • Added the all-os label, and updated the coverage comment in .cargo/config.toml and the docs.

After merging: an admin applies the ruleset (tools/ruleset.sh apply), then re-runs main's CI. Its ruleset check fails until the queue is on.

How it was tested

  • tools/policy.sh: 72/72 Rego tests at full coverage, 48/48 conftest checks. The merge_group rule failed with the trigger removed.
  • actionlint and zizmor are clean.
  • The changes job's OS logic, run for pull requests (with and without the label), drafts, merge groups, pushes, and pull requests with over 3000 files.
  • The merge queue flow, the nightly cache save, and the cold-cache Windows job time only show on GitHub.

@botandbang
botandbang requested a review from bnb as a code owner October 31, 2026 15:45
@github-actions github-actions Bot added documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code locallibrary locallibrary and the loclib-* crates tooling Repo config, lint and build tooling, and GitHub settings labels Oct 31, 2026
@bnb
bnb added this pull request to stack #351 October 31, 2026 15:47
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/web

Status Category Percentage Covered / Total
🟢 Lines 95.42% (🎯 93%)
🟰 ±0 pp
7911 / 8290
🟢 Statements 94.08% (🎯 91%)
⬆️ +0.01 pp
12047 / 12804
🟢 Functions 94.21% (🎯 92%)
⬆️ +0.03 pp
3125 / 3317
🟢 Branches 84.71% (🎯 80%)
🟰 ±0 pp
5619 / 6633
File CoverageNo changed files found.
Generated in workflow #7 for commit c0c8cbb by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 680.3 KiB 680.3 KiB 0 B (0%)
Client JavaScript, brotli 225.8 KiB 225.8 KiB 0 B (0%)
Client CSS 89.6 KiB 89.6 KiB 0 B (0%)
Client CSS, brotli 12.9 KiB 12.9 KiB 0 B (0%)

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/localtoolbox

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 100%)
🟰 ±0 pp
4303 / 4303
🟢 Statements 99.64% (🎯 95%)
🟰 ±0 pp
5862 / 5883
🟢 Functions 99.65% (🎯 95%)
🟰 ±0 pp
1715 / 1721
🟢 Branches 97.72% (🎯 50%)
🟰 ±0 pp
2791 / 2856
File CoverageNo changed files found.
Generated in workflow #7 for commit c0c8cbb by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Packaged (localtoolbox.zip) 366.1 KiB 366.1 KiB -1 B (-0%)
Unpacked (dist/) 842.8 KiB 842.8 KiB 0 B (0%)

@github-actions github-actions Bot added locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: plugins The plugin protocol, its host and the built-in plugins tests Tests, fixtures and test harnesses labels Oct 31, 2026
bnb
bnb previously approved these changes Oct 31, 2026
Base automatically changed from bnb/ci-single-workflow to main October 31, 2026 16:29
Pull requests and pushes to main run on Linux; locallibrary's macOS and Windows checks run once per merge queue group, or on a pull request with the all-os label, as one job per OS without coverage or shards. The Linux build, shards and coverage move into locallibrary-ci.yml, and locallibrary-cache.yml saves the other-os caches on main nightly. The ruleset gets a merge queue, and a policy checks that gated workflows run on merge_group when it has one.
@botandbang
botandbang dismissed bnb’s stale review October 31, 2026 16:29

The merge-base changed after approval.

bnb
bnb previously approved these changes Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Rust coverage

From run 7. Both are held to the thresholds in .cargo/config.toml.

Tests Lines Functions Regions
All 97.39% (84410/86668) 96.53% (13503/13989) 95.67% (185846/194265)
Hegel property tests alone 95.39% (82672/86668) 94.11% (13165/13989) 93.46% (181563/194265)

The ruleset's code scanning rule waits for CodeQL's analysis of each merge queue group's commit, and holds the group until it gets one. A policy now fails when the ruleset has a merge queue and code scanning but codeql.yml doesn't run on merge_group.
Merged via the queue into main with commit 6134441 Oct 31, 2026
99 of 103 checks passed
@botandbang
botandbang deleted the bnb/ci-merge-queue branch October 31, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: plugins The plugin protocol, its host and the built-in plugins locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses tooling Repo config, lint and build tooling, and GitHub settings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants