Skip to content

Let validate-task.yml Read Its Test Matrix From a Tracked File - #4261

Merged
ptr727 merged 4 commits into
developfrom
feature/test-matrix-file-4236
Nov 17, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/test-matrix-file-4236

Conversation

@ptr727

@ptr727 ptr727 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #4236

  • Adds a test-matrix-file input to validate-task.yml. It names a repository-relative tracked file whose content is a test-matrix value, so a caller whose legs are written by a tool passes one with: line instead of carrying a matrix-reading job.
  • The test-matrix job checks the caller's tree out only when the input is set. It lands either input in one resolved file, so the existing label and python-version checks and the matrix build read the same bytes whichever input the caller used. No second parser exists.
  • Setting both inputs, a path naming no file inside the checked-out tree, and content the inline input would refuse each fail with an ::error:: naming the path. The annotation text is escaped per the workflow command encoding rules.
  • The unit-test job reads a new legs output from the test-matrix job rather than the raw input, so the hook check, the dependency install, the hook, and the no-sync pytest run apply for either source.
  • docs/reusable-workflows.md documents the input, and both test-pull-request*.yml snippets gain one comment line saying it exists. The documented smoke stub carries the same line, since a test holds it equal to the snippet.

Tests

  • New test_validator_test_matrix_file_takes_the_inline_input_checks runs the check step's and the build step's own scripts under bash. It covers each input building the legs it holds, the default interpreter legs, mutual exclusion, a missing file, a directory, a duplicate label, and non-JSON content. It also checks that a pretty-printed refused file reaches the annotation encoded as one line.
  • The path is checked with -f only. The caller owns both the tree and the workflow, and a stray path still meets the content check, so no containment test is added.
  • Existing validator tests follow the step and gate changes.
  • Full suite, spec/validate.py, actionlint, shellcheck on the extracted step scripts, and the prose gate pass locally.

The change adds workflow comment lines, so it carries the comments label.

Open local-review findings

The opening push spent its local edit budget, so these were listed open. Both are fixed in 11501e60, which a clean local pass covers.

  • introduced, Fixed in 11501e60: tests/test_release_guards.py, the new test's refusal cases passed no malformed inline test-matrix value, so the inline branch's annotation subject was untested.
  • introduced, Fixed in 11501e60: docs/reusable-workflows.md, the "The nested check then reads Unit test job (<label>)" sentence followed the both-empty sentence, so "then" read as describing the wrong case.

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 17, 2026 08:29
A repository whose pytest legs are written by a scheduled tool keeps them
in a tracked file, since that tool cannot write under .github/workflows/.
Each caller then carried its own job to read the file into a job output.

The new test-matrix-file input names that file. The test-matrix job checks
the caller's tree out only when it is set, and lands either input in one
resolved file, so the existing label and python-version checks and the
matrix build read the same bytes whichever input the caller used. Setting
both, a path naming no file inside the checked-out tree, and content the
inline input would refuse each fail with an error naming the path.

The unit-test job reads a legs output from the test-matrix job rather
than the raw input, so the hook steps run for either source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop the realpath containment test, since the caller owns both the tree
and the workflow, and a stray path still meets the content check. Test the
annotation against a pretty-printed refused file rather than a path no
caller writes. Correct the doc's claim that every error names the path,
and tell a snippet carrier the input needs a pin that declares it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 17, 2026 16:49
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7c082a0 and 11501e6.

Files selected for processing: 5

  • .github/workflows/validate-task.yml
  • catalog/snippets/workflows/test-pull-request-smoke.yml
  • catalog/snippets/workflows/test-pull-request.yml
  • docs/reusable-workflows.md
  • tests/test_release_guards.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head e5da9c1d3b66deac56fdf1c8d2d6b79f753aa437, the content this pull request carries at that commit against develop, and it recorded 2 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical path-validation vulnerability remains in the workflow, allowing arbitrary runner files to be copied and exposed in annotations, and the documentation and test-coverage issues are still unresolved.

3 open issues
What changed in this PR

This pull request lets validate-task.yml load pytest matrix legs from a repository file while preserving the existing validation and execution flow.

Changes:

  • Adds the mutually exclusive test-matrix-file input, conditional checkout, shared matrix resolution, and downstream leg gating.
  • Adds tests covering file-based matrices, inline matrices, defaults, and rejection cases.
  • Documents the new input in reusable workflow guidance and caller snippets.
File Description
tests/​test_release_guards.py Tests matrix resolution, validation, rejection cases, and downstream workflow gates.
docs/​reusable-workflows.md Documents the file-based pytest matrix input and its execution behavior.
catalog/​snippets/​workflows/​test-pull-request.yml Notes the new matrix-file input for workflow callers.
catalog/​snippets/​workflows/​test-pull-request-smoke.yml Keeps the smoke workflow guidance aligned with the standard snippet.
.github/​workflows/​validate-task.yml Adds file-based matrix input handling, conditional checkout, validation, and resolved-leg propagation.

Review effort: Lite

Comment thread .github/workflows/validate-task.yml Resolved
Comment thread docs/reusable-workflows.md Resolved
Comment thread tests/test_release_guards.py Resolved
@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 11501e60f32eefae750d636c979ed9100f20bf38, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.20%. Comparing base (7c082a0) to head (11501e6).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4261   +/-   ##
========================================
  Coverage    78.20%   78.20%           
========================================
  Files           42       42           
  Lines        15415    15415           
========================================
  Hits         12055    12055           
  Misses        3360     3360           
Flag Coverage Δ
python-3.13 78.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 2e1dd77 into develop Nov 17, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/test-matrix-file-4236 branch November 17, 2026 17:12
ptr727 added a commit that referenced this pull request Nov 17, 2026
…trap Secret Restore (#4255)

## Summary

Promotes `develop` to `main`. It carries nine changes:

- [#4247](#4247): retires
the `CLAUDE.md` pointer file, the second half of #4074. The hub's copy
and its `spec/files.json` entry are gone, and a `retire` gap records
why. The audit now reports a retired path the hub no longer tracks. A
copy matching a past hub revision is reported for deletion, and any
other copy is reported for the maintainer. It merged on the maintainer's
go-ahead after reading its diff, which touches
`host-setup/agent-safety/README.md`.
- [#4256](#4256): that
match compares line endings alone, so a retired copy differing in an
action pin or a `needs:` list goes to the maintainer. It answers a
Copilot finding on this promotion.
- [#4260](#4260): the
audit run stamp names the commits it read. HEAD carries `-dirty` where
the read paths differ from it, and `main <sha>` is added where the
fetched `main` differs.
- [#4259](#4259):
`pr-review-conduct` states the `pr_review.py` spelling rule once for
every call a fleet skill prints. Under a restricted uv cache, a merge or
a branch delete is reported to the maintainer as a blocked write.
- [#4261](#4261):
`validate-task.yml` takes a `test-matrix-file` input, read through the
same validation as `test-matrix`.
- [#4257](#4257): the
pre-commit snippet says to exclude `hub_fetch_run.py` from a
repository's own ruff with `force-exclude = true`. The short-form
`AUDIT.md` snippet drops its two hub-audit authority sentences.
- [#4246](#4246):
`bootstrap.sh --secrets` and `bootstrap.ps1 -Secrets` restore named
secret buckets, on their own or as a step of a `--host` or `--dev`
stand-up.
- [#4250](#4250): `host-*`
buckets in `scripts/secrets_sync.py` may each hold the same
home-relative title.
- [#4258](#4258): a dry
run with no 1Password account is refused rather than enrolling one, and
the root-refused secrets tests skip on a root runner. It answers two
CodeRabbit findings on this promotion.

Hosts already carry the load-both setting the retirement relies on, from
the 2.0.1483 kit.

Closes #4074
Closes #4236
Closes #4238
Closes #4239
Closes #4242
Closes #4243
Closes #4248
Closes #4249

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants