Repository navigation
fix(sync-issues): route the sync job through DEVKIT_CI_RUNNER - #1798
Merged
Merged
Conversation
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
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.
Closes #1795.
What
sync-issues.ymlhonouredDEVKIT_CI_RUNNERnowhere. Itsresolve-toolchainjob never re-exported
runner-json, and thesyncjob pinnedruns-onto thehosted default directly — so a consumer that set the key got self-hosted CI from
ci.ymlwhile this workflow kept its real work on a paid hosted runner. The keywas 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) }}syncalready had theneeds:edge. The expression is byte-identical toci.yml's, and the sharedresolve-toolchaincomposite action already emitsrunner-jsonin every mode.resolve-toolchain's ownruns-onis deliberately unchanged — it producesrunner-jsonand so cannot consume it (#1173). Making that one overridable istracked 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
syncstep on a self-hosted runnerThe job calls
setup-devkit-toolchain, which suppliesgh,git,jq,uvand 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:create-github-app-tokenactions/checkoutgitbinary — already a precondition of anyDEVKIT_CI_RUNNERhost todaysetup-devkit-toolchaingh/python3/jq/uvactions/cacherestore+savetar, falls back to gzip ifzstdabsentgh api -X DELETE)ghfrom the toolchain stepdate -u -d)sync-issues-action,commit-actionOne pre-existing constraint, unchanged by this PR: in
devcontainer/bothmodethe job's
container:needs Docker on the runner host, already documented forci.ymlin the self-hosted section ofdocs/MIGRATION.md.Also in this PR
.vig-osanddocs/MIGRATION.md: theDEVKIT_CI_RUNNERdocs named onlyci.yml's lanes; they now name thesyncjob too.docs/MIGRATION.md: the "two jobs always stay hosted" limitation is nowinaccurate — with
sync-issues.ymlhonouring the key there is one hostedresolve-toolchainper workflow that declares it. Reworded, with a note thaton 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 expressionform needs no
self-hosted-runnerentry.tests/test_ci_runner.py: 4 shape tests mirroring the existingci.ymlcoverage —
runner-jsonis re-exported,syncconsumes the exact expression,the
needs:edge survives, andresolve-toolchainstays hosted.Verification
prek run --all-files: green (thesync-manifesthook propagated thechangelog entry into the mirrored
.devcontainer/CHANGELOG.md; re-run clean).actionlintonsync-issues.ymlandci.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-toolchainare also pinned to a hosted literal:sync-main-to-dev.yml:check(:79),sync(:130) — fires on every push to the default branchabandon-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.ymlin particular fires often.