Skip to content

test(consumer-matrix): gate release N runner migration - #1958

Merged
gerchowl merged 6 commits into
devfrom
feature/1935-release-n-gate
Oct 29, 2026
Merged

gerchowl merged 6 commits into
devfrom
feature/1935-release-n-gate

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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 dev ahead of main and adopts N using the real upgrade and PR-body steps from immutable tag 1.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 tests

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Add runner-key-only and runner-gitflow; change ci-runner to variable inputs with parameterized, generic fixture labels.
  • Execute the rendered resolver and assert its class sources, lane outputs, and complete migration warning. Seed the full 1.18.0 scaffold and execute its upgrade and PR-body steps through the unchanged current 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.sh is 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-os release pin. Local download/container/PR adapters replace only external boundaries and reject unknown commands. The container adapter forwards only the installer’s -e values into a clean environment.
  • Add rendering tests and failure canaries for truncated warnings, incorrect outputs, and an unexpected migration section.
  • Document the cells in 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.
  • A second adoption with N’s migration environment proves the installer forwards context, strips the inert key, and reconciles stock seeded hooks. Do not depend on unmerged S6/S7b work.

Changelog Entry

Added

  • Release N runner migration matrix (#1935)
    • Gate key-only, variables-only, and gitflow adoption with dev ahead of main; verify runner outputs and the full migration warning.

Testing

  • Tests pass locally (only the touched Bats file, as scoped)
  • Manual testing performed (describe below)

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 and git diff --check: exit 0. Commit hooks run in the dev shell. The pushed-head CI runs the complete consumer matrix.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors beyond the intentional legacy migration warning
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (touched Bats file)
  • Any dependent changes have been merged and published

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’s runs-on are evaluated for same-repository and fork PRs; adoption steps evaluate their own env: in separate shells and communicate through command-file outputs.

Refs: #1935

@gerchowl
gerchowl requested a review from c-vigo as a code owner October 29, 2026 03:07
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
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
gerchowl force-pushed the feature/1935-release-n-gate branch from be5b42f to 8d4c7d7 Compare October 29, 2026 09:03
@gerchowl
gerchowl merged commit 91556a3 into dev Oct 29, 2026
16 checks passed
@gerchowl
gerchowl deleted the feature/1935-release-n-gate branch October 29, 2026 09:17
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