Repository navigation
feat(ci): make the CI dev-shell gcroot path configurable - #1603
Merged
Merged
Conversation
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
setup-devkit-toolchain's direnv branch realises the consumer dev-shell into aNix profile under
$RUNNER_TEMP. The--profileis what makes it a gcrootrather than a bare
nix develop, and on a hosted runner that placement isright — the machine is discarded with the job anyway.
An ephemeral self-hosted runner inverts the trade-off:
RUNNER_TEMPiswiped between jobs while the
/nix/store— the whole reason to run one —persists. Nothing roots the dev-shell between jobs, so a routine
nix.gcon thehost collects the closure every CI run needs. Measured on a
direnvconsumerwith a heavy dev-shell: a 26 s
Set up devkit toolchainstep becoming180–237 s, in each of the three toolchain lanes that run per CI run.
This adds an opt-in
.vig-oskey naming a persistent path for that profile.Absent or empty — the shipped default — reproduces today's behaviour byte for
byte for every consumer, hosted and self-hosted alike.
Type of Change
feat-- New featureModifiers
!) -- This change breaks backward compatibilityChanges Made
Wired the way
DEVKIT_CI_RUNNER(#1173) is, per the issue discussion — sameclass of fact (an infrastructure detail of the runner this repo builds on),
declared in the consumer's committed manifest, so there is no repo variable to
declare and it round-trips a
--forceupgrade:assets/workspace/.vig-os— newDEVKIT_DEV_PROFILE_PATH=key, shippedempty, documented with the self-hosted rationale.
resolve-toolchain— reads the key and emits adev-profile-pathoutput.Vets it once, on the cheap hosted producer job: a relative path, a path inside
the runner's
_work/_temptree, or the filesystem root fails there, beforeany lane realises a dev-shell. Trailing slashes are trimmed.
setup-devkit-toolchain— new optionaldev-profile-pathinput, routedthrough
env:(never inline${{ }}inrun:). The step resolves it, orfalls back to
$RUNNER_TEMP/devkit-dev-profilewhen unset, and all fournix developcalls use the resolved path. What only the target host cananswer — is the parent directory creatable, is it writable — is checked there
and fails the step loudly. Neither layer falls back silently: a job-scoped
gcroot is indistinguishable from the bug.
ci.yml— thelint,testandcommit-checkslanes pass the resolvedpath. Deliberately only those three: they are exactly the jobs
DEVKIT_CI_RUNNERcan move onto a consumer's runner, and the three the issuemeasured. Everything else in the scaffold stays on the hosted default, where
RUNNER_TEMPis the correct place for the root.init-workspace.sh— the key is read before the template overwrite andwritten back, so an upgrade cannot silently re-root the dev-shell in
RUNNER_TEMP.docs/MIGRATION.md— new "Keep the dev-shell gcroot across ephemeralself-hosted jobs" section plus the manifest-key table row, including the
runner-host notes: slots on one host are expected to share the path
(concurrent
nix develop --profilerealisations take the profile lock andconverge), and it must be a local persistent directory, not a per-job tmpfs.
Changelog Entry
Testing
just test)Manual Testing Details
TDD, RED committed first (
ecfc316,33a044e) then the implementation(
bdbe469). New/extended coverage:tests/test_toolchain_dev_profile.py(new, 21 tests) — the input's shape anddefault; the
env:routing (no${{ }}inrun:); every--profileusingthe resolved value;
resolve-toolchain's emission (absent / empty / absolute/ whitespace / quoted / trailing slash, and every delivery mode) and its
refusals, executed against the action's real bash; the
ci.ymlre-export andthe three lane call sites.
tests/test_setup_toolchain_env.py— six executed-bash cases on the stepitself: the unset default is still
$RUNNER_TEMP/devkit-dev-profile, aconfigured path moves every realisation, and relative / uncreatable /
unwritable paths fail the step without realising anything. The
nixstub nowlogs each
--profileit is handed; the step harness was refactored to exposethe process so the refusal paths are assertable.
tests/test_vig_os_manifest.py,tests/bats/init-workspace.bats— the keyships declared-and-empty, the output is declared, and the value round-trips an
upgrade.
Local runs: full
pytestgreen apart from two pre-existing environmentfailures (
test_image.py::test_manifest_files— local.pymarkdownvs thepulled image — and
test_integration.py::test_github_cli_authentication), bothverified failing on a stashed clean tree.
prek run --all-filesgreen.Not verifiable locally: the acceptance criteria that need a real ephemeral
self-hosted runner (profile surviving a job boundary and a
nix-collect-garbage, second run not re-realising). Those want a live run onthe reporting consumer once this is adopted.
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
The wiring shape follows the recommendation in the issue comment rather than an
Actions variable. The comment's two implementation notes are both addressed: the
shared-path expectation is documented in
MIGRATION.md, the.vig-oskeycomment and the action's input table; and the fail-loudly constraint is split
between resolve time (a value no host could make persistent) and step time (what
only the target host can answer).
The
_work/_tempguard catches the mistake the knob exists to prevent —rooting inside the tree the runner clears — but it cannot prove an arbitrary
path is persistent, and does not claim to.
Refs: #1601