Skip to content

ci(runners): run light jobs on the self-hosted pool for same-repository runs (needs owner OK) - #2857

Merged
devswha merged 4 commits into
mainfrom
ci/hosted-queue
Nov 5, 2026
Merged

devswha merged 4 commits into
mainfrom
ci/hosted-queue

Conversation

@devswha

@devswha devswha commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

GitHub's hosted queue for ubuntu-24.04 is saturated (about 20 concurrent jobs on this plan) while most of the self-hosted self-hosted-ovis runners sit idle, so jobs that run for seconds wait minutes: Detect changes waited 373 s and 635 s before starting on two recent PRs, and every other CI job waits on it.

This moves the light Linux jobs to the self-hosted pool for same-repository runs:

  • ci.yml: Detect changes, herdr-core live contract, the Integration and browser summary
  • pr-title.yml: Pull request title (Node only; the runner image has Node 22)
  • remote-bundles.yml: bundle-windows (Bun only)
  • pages.yml: site build and deploy (push-to-main only; they already accepted CI_SELF_HOSTED_LABELS)

Each uses one expression:

runs-on: ${{ github.event.pull_request && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-24.04' || fromJSON(vars.CI_LIGHT_LABELS || vars.CI_SELF_HOSTED_LABELS || '["self-hosted","self-hosted-ovis"]') }}

A fork pull request gets ubuntu-24.04 before any variable is read (the runner's job-started hook still refuses fork code as a second guard). CI_LIGHT_LABELS (new, unset) or CI_SELF_HOSTED_LABELS set to "ubuntu-24.04" keeps these jobs hosted, e.g. while the PC is offline.

Kept hosted on purpose: the Rust PTY host job and the Rust bundle matrix (no Rust toolchain in the runner image), the ssh job (sudo apt-get and Docker need a clean VM), desktop.yml builds, Windows/macOS jobs, and release-only jobs.

scripts/light-runner-workflow.test.ts pins the rule: every job a pull request runs (including reusable workflows it calls) must be GitHub-hosted, the light expression with its fork guard, ci.yml's routed Linux jobs (scripts/ci-runner-route.sh, already tested), or gated off pull requests.

scripts/ci-runner-route.sh leaves these light jobs out of its busy count (they hold a runner for seconds), and a push to main or a run from main takes CI_MAIN_SELF_HOSTED_LABELS first, so main's Detect changes never waits behind pull requests.

Queue time (job created -> started)

Before (main, 2026-11-05 ~03:20-03:45 UTC, GitHub-hosted):

PR Job Queued
#2842 Detect changes 373 s
#2848 Detect changes 635 s
#2842 Pull request title 301 s
#2848 herdr-core live contract 145 s

After (this PR's two runs, self-hosted, 04:06 and 04:2x UTC, same saturated hosted queue: its own Rust and hosted jobs still waited 115 s+):

Run Detect changes Pull request title herdr-core live contract bundle-windows
e8ceaa2 2 s 3 s 8 s 3 s
29c0a00 2 s 3 s 6 s 2 s

Validation

  • bun run check fast (workflow syntax via actionlint, typecheck, build, unit tests: 11441 pass, 0 fail) at 29c0a00.
  • bun test ./scripts/light-runner-workflow.test.ts: fails on origin/main's workflows ("some job uses the light runner expression"), passes here; removing the fork guard from pr-title.yml makes the pr-title case fail.
  • Skipped: check full, a real fork PR run.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cbcb961 and 29c0a00.

Files selected for processing: 9

  • .github/workflows/ci.yml
  • .github/workflows/pages.yml
  • .github/workflows/pr-title.yml
  • .github/workflows/remote-bundles.yml
  • docs/development.md
  • scripts/ci-runner-route.sh
  • scripts/ci-runner-route.test.ts
  • scripts/light-runner-workflow.test.ts
  • scripts/pr-title.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Review notes (omo + Codex Terra 6.1, xhigh)

CodeRabbit hit its rate limit on this PR, so these reviews stand in.

Round 1 (e8ceaa2): fixed in 29c0a00

  • MEDIUM: main pushes ignored CI_MAIN_SELF_HOSTED_LABELS for the light jobs. Now a run on refs/heads/main takes it first.
  • MEDIUM: the route script counted the light jobs as busy, which sent heavy jobs hosted sooner. It now leaves them out, and light-runner-workflow.test.ts keeps its list in step with the workflows.
  • LOW: the test accepted any if that merely contained github.event_name != 'pull_request' (for example ... || true). It now requires that clause as a top-level && term with no ||. It also checks that ci.yml's routed label comes from ci-runner-route.sh.
  • LOW: the docs did not say CI_LIGHT_LABELS wins for light jobs or that they ignore the dispatch input. Both are now documented.

Round 2 (29c0a00): CLEAR, no HIGH. Left for a follow-up, since this PR had its one fix round

  • MEDIUM (reproduced by simulating the expression): on main, CI_MAIN_SELF_HOSTED_LABELS is read before the CI_SELF_HOSTED_LABELS = "ubuntu-24.04" outage switch. When the PC is offline, set CI_MAIN_SELF_HOSTED_LABELS to "ubuntu-24.04" too (or delete it), or main's Detect changes and the Pages jobs wait. Fix: check the outage switch first, as ci-runner-route.sh does.
  • MEDIUM (routing reproduced; queueing not observed): bundle-windows is in the list of light jobs left out of the count, but it can run up to 20 minutes. Fix: drop it from the list or keep it hosted.
  • LOW: when the pool is full of heavy jobs, Detect changes now waits for a free self-hosted runner. There are 12 shared runners against a default capacity of 10, so this normally leaves headroom.
  • LOW: on manual and called runs, light jobs default to self-hosted while heavy jobs stay hosted. This is a consistency gap, not a fault.

Neither MEDIUM affects Ovis users; both only matter for CI operation. Per the review gate they do not block merging.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Merge note: light CI jobs run self-hosted for same-repo runs (forks stay on ubuntu-24.04 before any variable is read); measured queue 301-635 s -> 2-8 s. Workflow change approved by the lead (owner delegated). omo CLEAR at this head, required checks green.

@devswha
devswha merged commit 1ecc801 into main Nov 5, 2026
24 checks passed
@devswha
devswha deleted the ci/hosted-queue branch November 5, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant