Repository navigation
fix: gate container-mode CI runners behind an opt-in key - #2046
Merged
Merged
Conversation
… composites The gated-runner static scan must flag jobs with services:, any docker or podman subcommand (buildx, push, info, image, ...) and local composite actions whose own steps need a runtime. Fixture jobs for each shape fail against the current detector. Refs: #2045
…ner scan The gated-runner static scan now treats a job as needing a container runtime when it declares services:, invokes the docker or podman CLI with any subcommand (full-line shell comments excluded), or calls a local composite action (resolved one level, through a sub-path checkout) whose steps do. The resolve-toolchain jobs it newly flags stay on the direct runner expression by design (client-side registry probe): they are listed in an explicit allowlist that is pinned to contain only resolvers with no other runtime use. Refs: #2045
Since #2040 the direnv Scaffold Drift step fetches the pin with nix flake prefetch, so direnv needs no docker at all; only bare's Scaffold Drift and upgrade need a docker CLI and daemon. Gated devcontainer/both repos still run resolve-toolchain on the direct runner expression, which needs a docker CLI for the image probe. Correct the ADR known limit and the migration guide, describe the stronger runner scan, and say the opt-in key is still validated in direnv/bare. Refs: #2045
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.
Description
Implements the owner decision on #2045: container-mode consumers (
devcontainer,both) useCI_RUNNER_*runners only after they opt in with the new.vig-oskeyDEVKIT_CI_CONTAINER_RUNNERS=true. Without the key, every lane stays on hostedubuntu-26.04, as in 1.18.x.vars.CI_RUNNER_*also resolves organization variables, and an expression cannot tell an inherited org variable from a repo one. An org that sets them for a pool with no container runtime therefore broke every container-mode repo in it on adoption: the 1.19.0-rc3 smoke test failed atInitialize containersand at Scaffold Drift'sdocker run.Into
release/1.19.0, because this blocks release 1.19.0 (#2033).Type of Change
fix-- Bug fixtest-- Adding or updating testsdocs-- Documentation onlyModifiers
!) -- This change breaks backward compatibilityChanges Made
One gate, in
resolve-toolchain(assets/workspace/.github/actions/resolve-toolchain/action.yml)DEVKIT_CI_CONTAINER_RUNNERSwith the sharedKEY=VALUEreader. The file is never sourced. Any value other thantrue,falseor empty is an::error::and exit 1, in every mode, before any runner output is written.devcontainer/bothwithouttrue, the variable arm is skipped for every class. Each lane then gets the hosted default, soDEVKIT_CI_LANE_SIZESis ignored for placement, though it is still validated. The fork predicate still wins. The repo's own legacyDEVKIT_CI_RUNNERkey keeps its 1.18.x meaning (see Notes).::notice::that namesCI_RUNNER_*, the mode andDEVKIT_CI_CONTAINER_RUNNERS=true, and gives the reason. The partial-setup notice and the opted-in-class warning do not fire, because nothing is placed. The private-repo notice and the legacy-key migration warning also name the key. Under the gate, the migration warning lists only variables that are really unset, and it no longer says "delete the key once the variables are set": the key keeps deciding every class until the repo opts in. Labels are never printed.direnv/bare: unchanged.devkit-upgrade.yml: itsupgradejob runsinstall.sh --dockerin every mode but direnv, so it needs a docker daemon. It now gets its runner from a newresolve-toolchainjob (the same shape assync-issues), not fromvars.CI_RUNNER_SMALLdirectly. That job checks out the sameref:the upgrade rewrites (dev, ormainafter the trunk retarget), so the gate reads that branch'sDEVKIT_MODEand opt-in key, not the default branch's. As with the key, a legacyDEVKIT_CI_RUNNERnow places the upgrade job too; the consumer-matrix contract was updated to match.reportalso fires whenresolve-toolchainfails (for example, an invalid key), because that failure skipsupgrade.init-workspace.sh: validates the key at the write path and writes it back on every upgrade. The legacy-key strip, decision (c)-1, now judges whether the key is inert with the gate applied. In a container mode without the opt-in, the variables place nothing, so the key is kept and aci-runner-migration:line names the opt-in.Template
.vig-os: shipsDEVKIT_CI_CONTAINER_RUNNERS=with a comment. Consumer matrix: theci-runnercell runs modeboth, so it now seedsDEVKIT_CI_CONTAINER_RUNNERS=true. That keeps it on the opted-in path and also exercises the write-back from start to finish.Docs: ADR-site-agnostic-projects updates:
G).docs/MIGRATION.mdgets a new "Container-mode CI runners" section and a row for the key in the.vig-oskey table (the SSoT). CHANGELOG has an entry under## [1.19.0] - TBD→### Fixed, and the mirror is synced.Audit: jobs under
assets/workspace/that place onCI_RUNNER_*,DEVKIT_CI_RESOLVE_RUNNERor the resolver'srunners/runner-jsonci.ymlresolve-toolchaindocker login+docker manifest inspect, both client-side registry calls (they ran on a daemon-less pool in the rc3 smoke). It still needs adockerCLIci.ymllint,test,commit-checkscontainer:runners.lint/.test/.smallci.ymlscaffold-driftdocker login/pull/runon the hostrunners.smallci.ymldevkit-staleness,summaryrunners.small(already on the output)ci.yml→ci-extension.ymlextensionrunners.extensionviarunner-jsoninputci.ymldependency-reviewsync-issues.ymlresolve-toolchain/synccontainer:sync-main-to-dev.ymlresolve-toolchain/check,synccontainer:prepare-release.ymlvalidate(the resolver) /prepare,open-pr,rollbackcontainer:needs.validate.outputs.runnersprepare-hotfix.ymlresolve-toolchain/validate,prepare,open-pr,rollbackcontainer:release.ymlresolve-toolchain/rollbackcontainer:release-core.yml(viarelease.yml)validate,finalize,testcontainer:inputs.runners(caller passes the resolver'srunners)release-publish.yml(viarelease.yml)publishcontainer:inputs.runnerspromote-release.ymlresolve-toolchain/validate,promote,merge,cleanup,floating-tagscontainer:abandon-release.ymlresolve-toolchain/validate,abandon,unfreezedevkit-upgrade.ymlresolve-toolchain(new)devkit-upgrade.ymlupgradeinstall.sh --docker(all modes but direnv)runners.smalldevkit-upgrade.ymlreportprepare-release-extension.yml,release-extension.yml(seeded)extensionpublish-release-extension.yml(seeded)resolve,publishcodeql.yml,scorecard.ymlComposite actions: only
resolve-toolchaintouches docker (the client-side probe above).setup-devkit-toolchainandbuild-bundlerun inside the job's own container or on the host, and do not drive a daemon themselves. devkit's own.github/uses literal hosted labels and has no copy of the resolver, so there is nothing to keep in lockstep there.tests/test_ci_container_runners.py::test_container_jobs_take_the_gated_runnerderives the container-needing set from the workflows themselves:container:orservices:, adocker://ordocker/*action, anydocker/podmanCLI subcommand (full-line shell comments excluded), compose,install.sh, or a local composite action (uses: ./…, resolved one level, including through a sub-path checkout such as./.devkit-resolve/…) whose steps do any of these. It fails any such job whoseruns-onis not the resolver'srunnersoutput, whether read directly from a resolver itneeds:or through aninputs.runnersthat every caller fills from one. A future lane therefore cannot bypass the gate. The only exception is an explicit, commented allowlist of the nine resolver jobs (client-side registry probe, documented in ADR §5); a pinned test keeps each entry a resolver whose own definition needs no runtime besides that probe.Changelog Entry
Fixed (under
## [1.19.0] - TBD)CI_RUNNER_*runners (#2045).vig-oskeyDEVKIT_CI_CONTAINER_RUNNERS(true|false, defaultfalse). Indevcontainer/bothmode, every lane stays on hostedubuntu-26.04, as in 1.18.x, unless it istrue; organization-levelCI_RUNNER_*variables no longer move container lanes onto pools without a container runtime.resolve-toolchainprints a notice naming the key when it ignores a visible variable, and rejects any other value;direnv/bareand fork PRs are unchanged.devkit-upgraderesolves its installer runner through the same gate, and keeps a legacyDEVKIT_CI_RUNNERkey until a container-mode repo opts in.Testing
Manual Testing Details
--forceupgrades, invalid values are refused before any write, and the legacy key is kept in a gated container mode but stripped once the repo opts in.services,buildx,docker info,docker push,podman image, three local-composite shapes, plus the shell-only-composite negative), e.g.assert _needs_runtime({'services': ...})false andTypeError: _needs_runtime() got an unexpected keyword argument 'root'.120 failed, 430 passedacrosstest_ci_container_runners.py,test_ci_runner.py,test_vig_os_manifest.pyandtest_workflow_devkit_upgrade.py. Examples:assert ['self-hosted-small'] == ['ubuntu-26.04'], anddevkit-upgrade.yml job 'upgrade' needs a container runtime but runs on "${{ … || vars.CI_RUNNER_SMALL || 'ubuntu-26.04' }}", not on the gated resolve-toolchain runners output (#2045).Checklist
CHANGELOG.md(the[1.19.0]section, because this targets the release branch) and pasted the entry aboveAdditional Notes
DEVKIT_CI_RUNNERunder the gate. The decision says "otherwise every lane runs on hostedubuntu-26.04, as in 1.18.x", with the goal that no consumer breaks on upgrade. In 1.18.x the repo's own legacy key routed container-mode lanes on purpose. Honouring it is the 1.18.x behaviour, and it is the kind of explicit repo statement the decision asks for. Dropping it would silently move a self-hosted container-mode repo onto hosted runners, which fails on a billing-blocked org. So the gate ignores the inheritedCI_RUNNER_*variables, not the legacy key. The legacy migration text and the upgrade strip both account for this, so following the migration never drops a repo onto hosted runners.CI_RUNNER_*pool must provide, per mode. The gate is keyed on the delivery mode, as decided.direnv: no docker at all. Since fix: realise direnv scaffold sources with flake prefetch #2040 the direnv Scaffold Drift step fetches the pin withnix flake prefetch, and the upgrade runsinstall.shwithout a runtime; the pool needsnix,jqandrsync.bare:ci.yml's Scaffold Drift (docker login/pull/run) anddevkit-upgrade'supgrade(install.sh --docker) need a docker CLI and daemon. The gate does not apply inbare, so abarerepo whose pool has no container runtime still fails those two lanes. This needs its own issue (reported to the architect, not filed here).devcontainer/both, gated: every lane is hosted, but theresolve-toolchainjobs still run on the directvars.CI_RUNNER_SMALL || vars.DEVKIT_CI_RESOLVE_RUNNERexpression and need a docker CLI (no daemon) fordocker login/docker manifest inspect.devkit-upgrade's new resolve job probes the image of the current pin, as every other resolve job in that repo does. The image cleanup deletes only untagged versions, so a pinned tag stays resolvable.Refs: #2045