Repository navigation
test(consumer-matrix): gate release N runner migration - #1958
Merged
Merged
Conversation
This was referenced Oct 29, 2026
gerchowl
added a commit
that referenced
this pull request
Oct 29, 2026
## Description Add a strict GitHub Actions expression evaluator so test tooling can execute the managed workflows' runner wiring. Unknown syntax raises with the whole expression and position, even in short-circuited branches. Case-insensitive lookup closes a fork-safety regression that previously went undetected. ## Type of Change - [x] `test` -- Adding or updating tests ### Modifiers - [ ] Breaking change (`!`) ## Changes Made - Add `evaluate(expression, context)`, typed `render(value, context)` for runs-on, and string-valued `render_input(value, context)` for step/reusable-job with values. The JSON CLI is `python -m tests.github_expression --context ctx.json --expr '...'`; `--input` stringifies its result. Context-file errors exit 2 without a traceback. - Place the helper in `tests/` beside `workflow_scaffold.py` and `nix_helpers.py`: shared pytest/bats infrastructure belongs here; `packages/vig-utils` ships consumer utilities. Document usage and strict limits in the module docstring. - Support the managed subset: context/property lookups, literal string indexing with runner array conversion/floor/bounds semantics, double-valued literals, grouping, logical/equality operators, interpolation, and case-insensitive fromJSON/toJSON function names. Other functions, numeric/dynamic indexing, and filters raise. - Resolve property names case-insensitively and reject ambiguous object keys. Reject non-standard JSON constants; treat context NaN as falsy; use per-character simple uppercase mappings for OrdinalIgnoreCase equality and property matching. Keep keyword literals lowercase per the runner lexer. Use one number parser for hex literals and coercion, rejecting invalid/overflowing hex literals and preserving signed Int32 values. Match double precision, G15 formatting and negative zero. Reject non-finite numeric CLI results (exit 2) to keep stdout valid JSON; name unsupported YAML scalar types accurately. - Match toJSON output with two-space indentation, LF newlines, compact empty collections, G15 scalar numbers, and Newtonsoft string escaping. Tests cite GitHub documentation and the runner/Newtonsoft source used for exact formatting. - Evaluate every shipped runs-on, resolve-step with, and reusable-job with value for fork PR, same-repo PR, and push contexts, with runner variables set/unset. Mutation tests copy workflows and prove that the exact mixed-case fork escape and a reusable-input contains call fail the gate. - Audit of runs-on/with/env (including reusable jobs and devkit-upgrade step env) at origin/dev and 1.18.0 found bracket indexing only in origin/dev release-core.yml runs-on. Keep literal string indexes and implement the runner Index.cs array behavior; numeric/dynamic indexes and filters stay outside the managed subset. - No workflow/action or S8 consumer-matrix changes; lane-mapping assertions remain S8's responsibility. ## Changelog Entry No changelog needed: internal test tooling with no user-visible impact; CLAUDE.md requires test changelog entries for user-visible impact. ## Testing - [x] Touched tests pass locally - [x] Manual testing performed ### Manual Testing Details - TDD history retains the original RED commits. Round-two RED: 33 failed, 63 passed (exit 1), committed as `dbe30e27` before implementation. Authorized toJSON RED: 53 failed, 95 passed (exit 1). A tokenizer quote regression separately failed twice before its fix. - Round-three RED: 23 failed, 154 passed (exit 1), committed before implementation; regressions cover hex literals, string array indexes, Unicode ordinal mapping, double precision, negative zero, CLI JSON and YAML date diagnostics. - Final `uv run --with pytest-xdist pytest tests/test_github_expression.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1959-r3`: 177 passed, exit 0. - `ruff check`, `ruff format --check`, and `git diff --check`: exit 0. Commits run inside `nix develop` with hooks enabled. - Exact-output tests cover nested objects, arrays, empty collections, quoted Unicode strings, Unicode line separators, null, booleans, numbers, and mixed-case function names. Subprocess tests cover both CLI output modes and missing/unreadable/invalid/non-object context files. ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly (module docstring; generated docs unaffected) - [ ] I have updated CHANGELOG.md (internal test tooling; see above) - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing touched unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Additional Notes Prerequisite for S8 (#1935 / #1958). The expanded review requirements bring the helper and tests to 764 lines, exceeding the approximately 450-line target; coverage has been retained as directed by the review briefs. No full-suite local run on the shared host; pushed-head CI is the final gate. Refs: #1959
This was referenced Oct 29, 2026
Open
gerchowl
added a commit
that referenced
this pull request
Oct 29, 2026
## Description Add a small workflow replay helper so consumer-matrix tests can execute workflow scripts with evaluated env and conditions, isolated shells, and real output/environment propagation. ## Type of Change - [ ] `feat` -- New feature - [ ] `fix` -- Bug fix - [ ] `docs` -- Documentation only - [ ] `chore` -- Maintenance task - [ ] `refactor` -- Code restructuring - [x] `test` -- Adding or updating tests - [x] `ci` -- CI/CD pipeline changes - [ ] `build` -- Build system or dependency changes - [ ] `revert` -- Reverts a previous commit - [ ] `style` -- Code style ### Modifiers - [ ] Breaking change (`!`) ## Changes Made - Add `tests.workflow_replay.Replay` and a JSON CLI with explicit step selection and seeded context for external boundaries. - Reuse the expression evaluator for conditions and stringified env/run values; add the authorized `steps` and `env` context roots. - Run steps in separate bash processes, parse single-line and multiline command files, and expose outputs to later steps. Document supported behavior and refusals in the module docstring. - Fetch only tag `1.18.0` before devkit project tests: checkout is shallow, and the real pre-N workflow test intentionally fails if the tag is absent. This step is limited to the pytest suite; consumer workflows and S8 cells are untouched. ## Diff map - `tests/github_expression.py` and its tests: accept `steps` and `env` roots with the existing case-insensitive lookup and ambiguity checks. - `tests/workflow_replay.py`, `_file_values`: strict UTF-8 command-file decoding, LF-only parsing, multiline values and malformed-entry errors. - `Replay.resolve_env` / validation: env precedence, literal workspace-relative working directories, and explicit refusals of unsupported step/job fields. - `Replay.run` / execution / result handling: Linux implicit vs explicit bash defaults, isolated scripts, step outputs/outcome/conclusion, replacement of seeded replayed ids, and context-derived default variables. - `tests/test_workflow_replay.py`: behavioral contracts, runner-source citations, real tag env resolution, mutations, byte-level regressions, CLI and failure cases. - `.github/actions/test-project/action.yml`: fetch only the required historical tag before project pytest runs. ## Changelog Entry No changelog needed: internal test infrastructure. The earlier entries in both root and generated devcontainer changelogs have been removed. ## Testing - [ ] Tests pass locally (`just test`) — full suite delegated to CI per task instructions. - [x] Manual testing performed (describe below) ### Manual Testing Details TDD tests committed before implementation. Initial helper RED exited 1. Fix-round RED (commit `956372bc`) exited 1: 19 failed, 196 passed. GREEN: `uv run --with pytest-xdist pytest tests/test_workflow_replay.py tests/test_github_expression.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1963-r4b-green` — 215 passed, exit 0. Tests cover both shell-default paths and workflow/job defaults; success/failure/skipped results; replacement of stale seeded outputs; Linux CR and strict UTF-8 handling; rejected job fields and invalid run types; literal/expression working directories; default runner env; and visibility of own step env in its condition. StepsRunner.cs confirms that env evaluation precedes step condition evaluation, which the helper already did correctly. Hooks run inside `nix develop`. The targeted CI fetch is configuration, so no separate TDD cycle applies. CI on `48ea8d5eeb08fe07acd4230c77dcac8236c94f67`: all 16 checks passed, including Test Summary. Project Tests ran 3139 tests successfully, including every new regression case. [CI run](https://github.com/vig-os/devkit/actions/runs/40843564828). ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly (module docstring) - [ ] I have updated `CHANGELOG.md` — unnecessary for internal test tooling - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Additional Notes Local composite actions are explicitly refused; S8 currently extracts their run steps directly. Job scheduling and external actions remain unsupported and are refused explicitly. Seeded step context stands in only for external boundaries that are not replayed; replayed ids replace their seeds. Failures stop replay after recording outcome/conclusion in `step_context`. PR #1958 will adopt the helper separately. Refs: #1963
gerchowl
force-pushed
the
feature/1935-release-n-gate
branch
from
October 29, 2026 09:03
be5b42f to
8d4c7d7
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
Gate release N runner migration in the consumer matrix: key-only consumers keep selecting their legacy pool and receive the full actionable warning; variables-only consumers resolve every class and project lane correctly without a legacy warning. A local gitflow consumer has
devahead ofmainand adopts N using the real upgrade and PR-body steps from immutable tag1.18.0: the key survives, the old body omits migration guidance, and the adoption CI resolver emits that guidance independently.Type of Change
test-- Adding or updating testsModifiers
!) -- This change breaks backward compatibilityChanges Made
runner-key-onlyandrunner-gitflow; changeci-runnerto variable inputs with parameterized, generic fixture labels.install.sh, each with its own evaluated environment and shell. The ADR’s S8 file list did not include the transport adapter or tag-fetch steps:install-transport.shis needed to execute the actual installer while keeping curl, docker, and gh local and strict; the CI fetch steps make the immutable 1.18.0 source available to Consumer Matrix and Project BATS. The target version comes from the repository’s.vig-osrelease pin. Local download/container/PR adapters replace only external boundaries and reject unknown commands. The container adapter forwards only the installer’s-evalues into a clean environment.docs/RELEASE_CYCLE.md. CI discovers cells from the script; both Consumer Matrix and Project BATS now fetch the required 1.18.0 tag. Move this tag forward only when the oldest supported pre-N release changes.Changelog Entry
Added
Testing
Manual Testing Details
nix develop --command bats tests/bats/consumer-matrix.bats: RED exit 1 before implementation; tests committed separately. GREEN exit 0, all 31 tests passing, including hook drift, M7, M2/M3, PR-step BASE/HOOK_DRIFT changes, seeded-file write-back, truncated migration text, and missing-tag regressions. Each round’s regression tests were committed RED before implementation (exit 1). Shellcheck andgit diff --check: exit 0. Commit hooks run in the dev shell. The pushed-head CI runs the complete consumer matrix.Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
The live self-hosted consumer run remains the architect's release-gate step after merge. These cells execute rendered scripts locally; they do not run workloads on the fixture runner labels or change runner infrastructure. The cells now use the merged expression evaluator (#1959) and step replay helper (#1963): managed resolve-step
with:values and every job’sruns-onare evaluated for same-repository and fork PRs; adoption steps evaluate their ownenv:in separate shells and communicate through command-file outputs.Refs: #1935