Skip to content

feat(ci): route scaffolded ci.yml jobs to self-hosted runners via .vig-os - #1174

Merged
c-vigo merged 3 commits into
devfrom
feature/1173-ci-runner-override
Jul 17, 2026
Merged

c-vigo merged 3 commits into
devfrom
feature/1173-ci-runner-override

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1173.

Adds an optional .vig-os key DEVKIT_CI_RUNNER (comma-separated runner labels, e.g. self-hosted,linux,x64,meatgrinder). The scaffold resolve-toolchain action emits a new runner-json output (always a valid JSON array; absent/blank key => ["ubuntu-24.04"], so existing consumers are byte-for-byte unchanged), and the scaffolded ci.yml routes lint, test, commit-checks, and the summary gate through runs-on: ${{ fromJSON(needs.resolve-toolchain.outputs.runner-json) }}.

  • resolve-toolchain stays hosted (chicken-and-egg: it produces the output) and dependency-review stays hosted (public-repo-only, toolchain-free, reads GitHub's dependency-graph API) — documented as a v1 limitation in docs/MIGRATION.md.
  • init-workspace.sh persists DEVKIT_CI_RUNNER across re-scaffolds like the .vig-os upgrade blanks DEVKIT_TAG_PREFIX / DEVKIT_FLOATING_TAGS (silent release-tag regression) #1116 tag-scheme keys, so upgrades don't silently reset a consumer onto hosted runners.
  • No installer flag (v1 minimal per the issue): consumers set the key by editing .vig-os.

Motivating consumer: exo-pet/exo-fleet (self-hosted CI per its ADR-0022; ci.yml is scaffold-managed so hand-edits are clobbered on upgrade).

Verification

  • TDD: RED commit 2ce19443 (11 pytest cases exercising the action's real run: bash against temp manifests: default/single/multi-label/whitespace/per-mode + ci.yml wiring assertions; 2 bats cases for template key + upgrade persistence) → GREEN d967139b → docs 37991149.
  • uv run pytest tests/test_ci_runner.py -q → 11 passed; bats tests/bats/init-workspace.bats --filter 1173 → 2 passed (re-run by the reviewing session, not just the implementing agent).
  • actionlint clean on the touched workflow; full prek run --all-files green in the dev shell; working tree clean.

c-vigo added 3 commits July 17, 2026 12:04
…g-os

Add optional DEVKIT_CI_RUNNER manifest key so a self-hosted consumer routes the
scaffold-managed ci.yml onto its own runners without hand-editing a managed
file. resolve-toolchain emits a runner-json JSON array (default
["ubuntu-24.04"]); the lint/test/commit-checks jobs and the summary gate consume
it via runs-on fromJSON. resolve-toolchain and dependency-review stay hosted.
init-workspace.sh persists the key across re-scaffolds like the tag-scheme keys.

Refs: #1173
@c-vigo
c-vigo marked this pull request as ready for review July 17, 2026 11:03
@c-vigo
c-vigo merged commit 901e2c0 into dev Jul 17, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/1173-ci-runner-override branch July 17, 2026 11:03
c-vigo added a commit that referenced this pull request Jul 17, 2026
… statix/deadnix hooks (#1176)

## Summary

Closes #1171.

Makes Nix a first-class consumer language in the scaffold (ask-gate
cleared by three nix-oriented consumers: exo-pet/exo-fleet,
Personal/vigo-nixos, devkit itself):

- **Detection** (`assets/init-workspace.sh`): a repo is nix-oriented
when it carries `*.nix` files **beyond the scaffold-managed
`./flake.nix`** (pruning `.git/`, `.direnv/`, `.worktrees/`).
`flake.nix` alone can't be the marker — every direnv scaffold ships one,
so naive detection would false-positive on every direnv consumer at
re-scaffold. Deterministic and re-scaffold-safe.
- **Gitignore fragment** (`assets/gitignore.d/nix.gitignore`): `result`,
`result-*`. The #1145 managed set already derives from ALL gitignore.d
fragments, so no migration-logic change was needed (existing #1145 tests
stay green).
- **statix + deadnix on the consumer hook surface** (`nix/hooks.nix`):
`language: system` hookDefs with `scaffold = false` and no `yaml` — both
committed hand-managed YAMLs are byte-unchanged (guarded by the drift
gates + an explicit test); the hooks render only into the
flake-generated consumer config. statix runs `check .` repo-wide
(single-target CLI, respects .gitignore); deadnix runs `--fail
--no-lambda-arg --no-lambda-pattern-names` so the scaffolded template
flake.nix (idiomatic `{ self, … }` pattern, `extraPackages = pkgs: [ ]`
seed) passes out of the box — proven by a test that runs the *exact
rendered hook entries* against a template copy. Devkit's own strict
internal gates (`checks.{statix,deadnix}`) are untouched.
- **CodeQL**: explicit `nix) : ;;` no-op arm (nix is not a CodeQL
language, same as rust), with a bats test proving the matrix stays
`['actions']`-only for a pure-nix consumer.

## Verification

- TDD: RED `77fb07ac` (1 bats + 4 pytest failing pre-implementation; two
deliberate green guards) → `e49d99c8` (detection + fragment) →
`492ac467` (hooks).
- `bats tests/bats/init-workspace.bats` → 221/221; `pytest
tests/test_flake_hooks.py` → 27 passed — both re-run by the reviewing
session.
- Template proof: `statix check assets/workspace/flake.nix` and `deadnix
--fail --no-lambda-arg --no-lambda-pattern-names
assets/workspace/flake.nix` both clean.
- Full `prek run --all-files` in the dev shell: green, working tree
clean (re-run by the reviewing session).

## Notes

- Since #1167, fresh direnv scaffolds default to flake hooks, so nix
consumers get statix/deadnix immediately; a consumer with pre-existing
nix code may see first-run findings — that is the feature working.
Consumers can tighten/loosen via `hooks.deadnix.entry` overrides.
- Expect CHANGELOG (+ mirror) merge conflicts with sibling PRs
#1174/#1175 — union-merge as usual.
c-vigo added a commit that referenced this pull request Jul 17, 2026
## Summary

Closes #1170.

Packages `pymarkdownlnt` 0.9.23 in the flake (`nix/pymarkdown.nix`:
pymarkdownlnt + its two PyPI-only pure-Python deps
`application-properties` 0.9.3 and `columnar` 1.4.1; the native
`pyjson5` comes from nixpkgs) and promotes the `pymarkdown` hook from a
runner-only remote-repo hook to a `language: system` hook across **all
three** artifacts (committed runner YAML, sandbox `checks.pre-commit`
gate, consumer flake-generated surface). This retires the documented
"pymarkdown residual" — the reason direnv consumers lost markdown
linting after #1167/#1168 — and unblocks the direnv-only deployment of
exo-pet/vault (a markdown documentation vault).

- Built against `python314` (toolchain default); all three packages are
pure Python and pass `pythonImportsCheck`.
- `remoteRepos.pymarkdown` pin and its `repoOrder` entry removed; both
committed `.pre-commit-config.yaml`s re-rendered to the system-hook
form.
- "Drops pymarkdown / not in nixpkgs" messaging retired in
`assets/init-workspace.sh`, `docs/NIX.md`, `docs/MIGRATION.md`, and the
#1167 bats assertions.
- **Deliberate deviation from the issue text:** the sandbox gate mirrors
the hook in `fix` mode (on the sandboxed copy, fail-on-modify — same
semantics as the ruff/end-of-file-fixer gates and identical to the
runner), not `scan`: scan is strictly stricter and would fail the gate
on pre-existing MD013 line-length debt, an out-of-scope behavior change.
Documented in the hookDef comment.

## Verification

- TDD: RED `d76dbcc7` → GREEN `bf1c866a` → docs `98db437e`.
- `pymarkdown version` → 0.9.23 in the dev shell; `nix build
.#checks.x86_64-linux.pre-commit` → gate builds and passes — re-run by
the reviewing session.
- `pytest tests/test_flake_hooks.py tests/test_flake_devshell.py` → 40
passed, 1 skipped (re-run by the reviewing session); bats #1167
direnv-hooks tests 6/6.
- Full `prek run --all-files` in the dev shell: green (pymarkdown runs
over all markdown), working tree clean (re-run by the reviewing
session).
- Strict `buildEnv` collision probe (pymarkdown + pythonEnv) assembles
cleanly; the full image build is left to CI.

## Notes

- The NixOS-only `LD_LIBRARY_PATH` libstdc++ shim is no longer strictly
needed for pymarkdown but is left in place (general safety net, minimal
diff).
- Expect CHANGELOG (+ mirror) and `nix/hooks.nix`/test-file merge
conflicts with sibling PRs #1174/#1175/#1176 — union-merge as usual.
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