Repository navigation
Let validate-task.yml Read Its Test Matrix From a Tracked File - #4261
Conversation
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou'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. View limit details
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. |
|
A recorded local strict-review pass covers head |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 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-fileinput, 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
|
A recorded local strict-review pass covers head |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
…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)


Summary
Closes #4236
test-matrix-fileinput tovalidate-task.yml. It names a repository-relative tracked file whose content is atest-matrixvalue, so a caller whose legs are written by a tool passes onewith:line instead of carrying a matrix-reading job.test-matrixjob checks the caller's tree out only when the input is set. It lands either input in one resolved file, so the existing label andpython-versionchecks and the matrix build read the same bytes whichever input the caller used. No second parser exists.::error::naming the path. The annotation text is escaped per the workflow command encoding rules.unit-testjob reads a newlegsoutput from thetest-matrixjob 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.mddocuments the input, and bothtest-pull-request*.ymlsnippets 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
test_validator_test_matrix_file_takes_the_inline_input_checksruns 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.-fonly. The caller owns both the tree and the workflow, and a stray path still meets the content check, so no containment test is added.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
commentslabel.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 in11501e60:tests/test_release_guards.py, the new test's refusal cases passed no malformed inlinetest-matrixvalue, so the inline branch's annotation subject was untested.introduced, Fixed in11501e60:docs/reusable-workflows.md, the "The nested check then readsUnit test job (<label>)" sentence followed the both-empty sentence, so "then" read as describing the wrong case.🤖 Generated with Claude Code