Repository navigation
fix(ci): extend runner host Nix configuration - #1916
Merged
Merged
Conversation
gerchowl
force-pushed
the
bugfix/1907-nix-config-extend
branch
from
October 26, 2026 18:48
19caa67 to
2a3dd87
Compare
gerchowl
force-pushed
the
bugfix/1907-nix-config-extend
branch
from
October 26, 2026 19:02
2a3dd87 to
a53cc1b
Compare
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
Preserve a self-hosted runner's valid ambient
NIX_CONFIGwhen configuring preinstalled host Nix in direnv mode. Runner caches, keys, experimental features and CPU limits survive into subsequent steps. Reject malformed configuration with a warning that never includes diagnostic values or access tokens. Register masks for accepted ambient access tokens and potentially credential-bearing URL values before exporting them, so later step environment headers cannot expose them.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
Register one
add-maskfor every token on every ambientaccess-tokensline before the firstGITHUB_ENVwrite; escape workflow-command data. Mask URL values with userinfo or query parameters as well. The Nix settings reference identifiesnetrc-fileandsecret-key-filesas paths, so their file contents are never exported.Probe command support without ambient
NIX_CONFIG: usenix config showwhen available, otherwisenix show-config(including Nix 2.18). If neither command works, fail explicitly rather than label the ambient value malformed.Validate with the selected command, preserving accepted ambient config ahead of devkit's lines. Rejected config produces a generic warning with diagnostic values redacted. Select a heredoc delimiter absent from the value.
Enumerated settings:
extra-experimental-features,extra-substituters, andextra-trusted-public-keysadd to runner lists.accept-flake-config = truedeliberately remains owned by devkit: the toolchain must accept the consumer repository flake's cache configuration. Devkit writes no CPU limits or replacement cache lists.Share expected values in the tests with explicit install/host feature keys, and compare whole URL sets. Document behavior in the self-hosted migration section. There is no devkit-owned
.github/actions/setup-devkit-toolchaincopy to update.Changelog Entry
Fixed
NIX_CONFIG, including runner caches and CPU limits, and add devkit's features and cache settings;extra-experimental-featuresextends the hostnix.conffeature list instead of replacing itshow-configbefore Nix 2.20); fail explicitly if neither command is available. Drop malformed ambient configuration with a warning that redacts diagnostic values; keep the exported configuration valid and the environment delimiter collision-safeTesting
Manual Testing Details
nix develop --command uv run --with pytest-xdist pytest tests/test_setup_toolchain_env.py -k 'validation or malformed_token' -n 4 --basetemp="$HOME/.cache/devkit-pytest/1907-r2"exited 1: 4 failed, 2 passed; failing tests committed first.nix develop --command uv run --with pytest-xdist pytest tests/test_setup_toolchain_env.py -k masks_credentials -n 4 --basetemp="$HOME/.cache/devkit-pytest/1907-r3"exited 1: both credential-mask regressions failed before implementation; failing tests committed first. The test validates the ambient input with real Nix and observes that mask commands precede the first environment-file write.nix develop --command uv run --with pytest-xdist pytest tests/test_setup_toolchain_env.py tests/test_workflow_devkit_upgrade.py tests/test_scaffold_drift.py -n 4 --basetemp="$HOME/.cache/devkit-pytest/1907-r3"exited 0: 112 passed.nix develop --command uv run --with pytest-xdist pytest tests/test_setup_toolchain_env.py tests/test_workflow_devkit_upgrade.py tests/test_scaffold_drift.py -n 4 --basetemp="$HOME/.cache/devkit-pytest/1907-r2"exited 0: 110 passed.fatal: failed to copy file ... .git/objects/99/ef67180523274a572a087c52216bf697f891aa: No such file or directory. Disk usage was 6%; no cache/store cleanup or test changes were made. CI is the full-suite authority per the task brief.cores = 2,max-jobs = 3, ambient features and devkit settings. Coverage includes empty/unset input, modern/legacy validation, unavailable validator, redaction of malformed token config and delimiter collisions.--with pytest-xdistsupplies the missing local dependency. Commit hooks run insidenix develop, including scaffold changelog synchronization.CI on
a53cc1b4778bbcfb8cb87ab11283e3b989c5ef02: all 16 checks pass, including CodeQL, Project Tests, Project Flake Gates, container/integration suites, both security scans and Test Summary.gh pr checks 1916 --watchexited 0. The passing CI run is authoritative over the local post-rebase Git object-copy failure noted above.Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
On multi-user Nix, cache entries still require a trusted user, as documented in the existing action comment. Container and flake-evaluation suites are left to CI per the task brief.
Refs: #1907