Skip to content

fix(sync-issues): route the sync job through DEVKIT_CI_RUNNER - #1798

Merged
c-vigo merged 1 commit into
devfrom
feature/1795-sync-issues-runner
Oct 1, 2026
Merged

c-vigo merged 1 commit into
devfrom
feature/1795-sync-issues-runner

Conversation

@c-vigo

@c-vigo c-vigo commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1795.

What

sync-issues.yml honoured DEVKIT_CI_RUNNER nowhere. Its resolve-toolchain
job never re-exported runner-json, and the sync job pinned runs-on to the
hosted default directly — so a consumer that set the key got self-hosted CI from
ci.yml while this workflow kept its real work on a paid hosted runner. The key
was read and silently dropped.

Two lines of substance:

     outputs:
       image-tag: ${{ steps.resolve.outputs.image-tag }}
+      runner-json: ${{ steps.resolve.outputs.runner-json }}
...
   sync:
     needs: [resolve-toolchain]
-    runs-on: ubuntu-26.04
+    runs-on: ${{ fromJSON(needs.resolve-toolchain.outputs.runner-json) }}

sync already had the needs: edge. The expression is byte-identical to
ci.yml's, and the shared resolve-toolchain composite action already emits
runner-json in every mode.

resolve-toolchain's own runs-on is deliberately unchanged — it produces
runner-json and so cannot consume it (#1173). Making that one overridable is
tracked in #1796.

Why it matters more than two lines suggest

The workflow is on a daily cron, so the cost was incurred per repo per day
regardless of activity — unlike ci.yml, which at least scales with PR volume.
On private repos GitHub bills each job rounded up to a whole minute, so a
short job is disproportionately expensive. Measured across five private consumer
repos over one week this was ~53 billed minutes that the consumers' own runners
would have absorbed for free.

Safety — every sync step on a self-hosted runner

The job calls setup-devkit-toolchain, which supplies gh, git, jq, uv
and vig-utils from the consumer's own dev-shell (direnv mode) or the baked image
— so it needs nothing from the runner image beyond nix. Walked step by step:

Step Requirement on a self-hosted host
create-github-app-token JS action, runner-bundled Node; network only
actions/checkout needs a git binary — already a precondition of any DEVKIT_CI_RUNNER host today
setup-devkit-toolchain provides gh/python3/jq/uv
actions/cache restore+save JS action; tar, falls back to gzip if zstd absent
cache delete (gh api -X DELETE) gh from the toolchain step
incremental cutoff (date -u -d) GNU coreutils, from the image or the flake closure
sync-issues-action, commit-action REST-only JS actions, runner-bundled Node

One pre-existing constraint, unchanged by this PR: in devcontainer/both mode
the job's container: needs Docker on the runner host, already documented for
ci.yml in the self-hosted section of docs/MIGRATION.md.

Also in this PR

  • .vig-os and docs/MIGRATION.md: the DEVKIT_CI_RUNNER docs named only
    ci.yml's lanes; they now name the sync job too.
  • docs/MIGRATION.md: the "two jobs always stay hosted" limitation is now
    inaccurate — with sync-issues.yml honouring the key there is one hosted
    resolve-toolchain per workflow that declares it. Reworded, with a note that
    on a private repo this residual cost scales with the number of scaffolded
    workflows rather than their duration.
  • .github/actionlint.yaml: extended the comment explaining why the expression
    form needs no self-hosted-runner entry.
  • tests/test_ci_runner.py: 4 shape tests mirroring the existing ci.yml
    coverage — runner-json is re-exported, sync consumes the exact expression,
    the needs: edge survives, and resolve-toolchain stays hosted.

Verification

  • prek run --all-files: green (the sync-manifest hook propagated the
    changelog entry into the mirrored .devcontainer/CHANGELOG.md; re-run clean).
  • actionlint on sync-issues.yml and ci.yml: no findings.
  • pytest tests/test_ci_runner.py: 84 passed.
  • pytest tests/test_sync_settings.py tests/test_workflow_sync_watermark.py tests/test_workflow_model.py: 59 passed.

Out of scope — follow-up worth filing

The same shape exists in other managed workflows, where jobs other than
resolve-toolchain are also pinned to a hosted literal:

  • sync-main-to-dev.yml: check (:79), sync (:130) — fires on every push to the default branch
  • abandon-release.yml: validate (:70), abandon (:132)
  • prepare-hotfix.yml: validate (:106), prepare (:275), open-pr (:443), rollback (:563)
  • promote-release.yml: validate (:61), promote (:355), merge (:410), cleanup (:561), floating-tags (:682)
  • release.yml: rollback (:151)

All are dispatch- or push-triggered rather than daily cron, so the cost impact is
smaller than #1795's, but sync-main-to-dev.yml in particular fires often.

The scaffolded sync-issues.yml honoured DEVKIT_CI_RUNNER nowhere: its
resolve-toolchain job never re-exported `runner-json`, and the `sync` job
pinned `runs-on` to the hosted default directly. A consumer that set the
key got self-hosted CI from ci.yml while this workflow kept its real work
on a paid hosted runner — the key was read and silently dropped.

Re-export `runner-json` and consume it in `sync`, exactly as ci.yml does.
The job already calls setup-devkit-toolchain, so it brings its own gh and
python3 closure and needs nothing from the runner image beyond nix.

Because the workflow runs on a daily cron, the cost it was incurring was
per repo per day regardless of activity, and on a private repo each job is
billed rounded up to a whole minute however short it is.

resolve-toolchain's own `runs-on` is deliberately unchanged: it produces
`runner-json` and so cannot consume it (#1173). Making that one overridable
is tracked separately.

Refs: #1795
@c-vigo
c-vigo merged commit 109231a into dev Oct 1, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/1795-sync-issues-runner branch October 1, 2026 13:49
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