Skip to content

Own CI runner: run fork CI without depending on GitHub Actions workflows (Actions as fallback) #1157

Backlog

Description

@scuttletoby

Why: GitHub Actions workflows in this repo keep getting switched off by something we have not found (#517), on a roughly 20-minute grid. A keep-on service turns them back on within seconds, but every switch-off can drop or delay runs, and the merge flow depends on them. We already run the jobs on our own machines (fleet runners, #13, #853); what we still borrow from GitHub is the trigger, the scheduler and the place results are shown.

Idea: our own CI runner in the fork, with GitHub Actions kept as a fallback until it is proven:

  • A dispatcher (fork kit, on our machines) sees new PR heads and pushes to main (webhook, or a cheap poll within the API budget), and plans the jobs from the same test list the workflows use (.github/fork-ci-tests.txt and its test selection).
  • It runs the jobs on fleet machines inside the existing sandbox and capacity rules, only for branches of this repo (no outside PRs).
  • It reports each job as a GitHub commit status or check run, so branch protection and the merge conveyor work as today, and shows logs in T3 (the work panel, Work panel: capacity bar and CI status in the thread's side panel #1136).
  • Same answers as the workflows: one plan, two runners. A shared contract test proves both give the same pass/fail.

Design questions:

  • Which GitHub identity posts the statuses (the agents App, or a bot token), and what a status can never claim (no green without a real run).
  • What happens when it runs again, stops half-way (a machine dies mid-job), or meets old state (a status left from an earlier head, a re-pushed branch).
  • Cost: what it saves against keeping Actions, and how we switch required checks over without a gap.
  • Upstream fit: lives in the fork kit and .github files, not in upstream code.

Done when: a design with options is agreed; then the dispatcher runs next to Actions, both give the same results on real PRs for a while, and required checks move over.

Related: #517, #13, #853, #862, #1136.

🤖 Generated with Claude Code

Activity

  1. scuttletoby commented on Nov 28, 2026

    @scuttletoby
    OwnerAuthor

    Design: three options and a recommendation

    Recommendation first: do it in stages (option C below). First make sure every head gets a run, which closes the #517 hole with one small tool and no new trust. Then run the fork's own tests on our machines next to Actions, and only then move the required check. Keep the app jobs that copy upstream's CI on Actions (on fleet runners).

    What we borrow from GitHub today

    What Hurts? Plan
    Trigger (an event starts a run) Yes: a switched-off workflow drops the event for good, so a head can end up with no result at all Replace first; small
    Runners Yes: about 20 hosted jobs at once, a full run is 28 Fleet runners (#13) are built; switch them on
    Engine (plans and runs the jobs) Only because it can be switched off Own engine for the fork's own tests only: they already have a runner script, a test list and per-test records
    Result (the required check) It is tied to one workflow's job One verdict check from a small App of ours, fed by either source

    Options

    • A. Actions stays the engine. Fleet runners on, plus a reconciler on a host: any trusted PR head or main tip with no run after a short wait gets one workflow_dispatch. Keep-on becomes a tested kit with an alert. Small and safe, but GitHub still schedules everything, and fork-only PRs gain little.
    • B. Full own engine, Actions as cold fallback. Fastest and independent, but about 1,800 lines of workflow would have to be re-built as scripts and kept equal to upstream's CI for good; the macOS job cannot move; a fallback that never runs is untested; and whole app builds would run on our machines for every head.
    • C. Staged hybrid (recommended). Start as A. Add an own lane for the fork-owned tests (most PR runs are fork-only), in the fleet's existing sandbox, in shadow until it agrees with Actions. Then one required verdict check. Extend further only where measured numbers say it pays.
    A B C
    Speed App jobs better, fork-only PRs the same Best Fork-only PRs fast, app PRs as A
    A workflow is switched off Waits for keep-on, then the reconciler starts it No effect Fork-only PRs: no effect
    A machine is off Routed to hosted runners Fewer slots, else Actions That part comes from Actions
    A run stops half-way Watch and sweep re-run it hosted (built) Lease runs out, one retry, then Actions Same as B for the own lane
    Runs twice Reconciler looks for a run first Keyed by commit, part and attempt Same as B
    New identity that can post a green None One App One App, pinned, key in one place
    Upkeep Low High, for good Medium, with a stop point after each stage

    Answers to the design questions

    • Who posts: a new small CI App (not the agents' App), with rights for checks and statuses only. Its key sits with a separate service user on the host; no agent, no job and no workflow can read it. The ruleset requires one check, fork-ci-verdict, pinned to that App. The runner is a root-owned host kit, not part of the T3 server: what says "green" must not be writable by the agents it judges. T3 only shows results (Work panel: capacity bar and CI status in the thread's side panel #1136).
    • What a result can never claim: a pass needs the full commit id, a run the poster started itself (or GitHub's own record of the Actions job), and a complete record for every planned part. The check is posted "in progress" first, so a crash leaves "not passed". Law tests enforce this.
    • Security: only heads that pass the fleet's trust rule are ever run; outside pull requests never. Jobs run in the fleet sandbox with no secret inside (the checkout is anonymous). The pass or fail is taken from outside the job.
    • Runs again, stops half-way, old state: work is keyed by commit, part and attempt. A dead machine means "lost": one retry elsewhere, then the Actions result counts. The statuses on GitHub are the lasting record, so a lost journal is rebuilt and nothing runs twice. A new push stops the old head's jobs; checks belong to a commit and cannot meet a newer head.
    • Fallback: per part (the own lane could not finish it, so Actions counts); globally (one variable sends everything back to Actions); and one tested rollback command for the ruleset. A real test failure on the own lane is never overridden by an Actions pass.
    • Switch-over without a gap: add the new required check next to the old one, merge with both for a while, then remove the old one. A same-named check from two sources would be an AND on GitHub, so the verdict gets its own name.
    • Cost: hosted minutes are free for a public repository, so the gain is time and no lost runs. New upkeep is one kit, one App and one plan file; the sandbox and the trust rule are reused.

    Phases (small PRs, each with tests and its state question)

    1. Prove the assumptions on a throwaway repository (how same-named checks, pinned sources, dispatch and switched-off workflows really behave).
    2. Every head gets a run: dispatch for a PR head; the reconciler; keep-on as a kit with an alert; fleet on in auto. Stop point: if this ends the pain, the rest can wait.
    3. Own lane in shadow: plan file shared by workflow and lane; a launcher verb that runs a command inside the runner walls; the lane runner with journal and lease; polling trigger; the CI App and a non-required shadow check; a parity report; work panel rows.
    4. Verdict as the required check: the verdict rule (first only mirroring Actions); the ruleset move with rollback; readers take the check name from config; then switch the mode to own.
    5. Later, each its own decision: Actions skips what the lane covers while its heartbeat is fresh; tests that need root; the merge train's combined test (G21 Faster merges: batched merge queue and shared build caches #862); app jobs only if the numbers show a clear gain.

    Move on when a check passes, not on a date: phase 3 starts after a set number of compared heads (proposal: 200) with no unexplained difference and the own lane not slower than Actions.

    Owner decisions

    1. Go with option C and this order?
    2. A new CI App with check, status and read rights only (needed in phase 2).
    3. The ruleset move in phase 3, and pinning today's required check to the GitHub Actions app now (one setting).

    🤖 Generated with Claude Code

  2. scuttletoby commented on Nov 28, 2026

    @scuttletoby
    OwnerAuthor

    Owner decisions 2026-11-28: 1. yes, option C in this order. 2. yes, a new CI App with check, status and read rights only, made when phase 2 needs it. 3. yes to the ruleset move in phase 3; and pin today's required check now. Done: ruleset 27224171 now requires fork-ci-result from the GitHub Actions app (integration 15368), like the other two required checks.

  3. added
    area:ci
    size:big
    type:feature
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cisize:bigtype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions