ci: skip test suites for markdown-only changes - #772
Merged
Merged
Conversation
Ignore .md/.mdx files in the zig-tests change detection and in the operator and proxy suite path patterns, so a docs-only change runs admission and policy but no test suites. Fixture READMEs under testdata/ stay in scope because the GLiNER2.5 oracle scripts check them.
Address review: the scope tests parsed the old 'git diff --quiet' text; QUANT_KERNEL_COMPILER.md is read by a Zig test and must stay in scope; rename detection hid code-to-markdown renames; and a git failure was treated as no changes. The filter now lives in scripts/ci/zig-relevant-changes.sh with --no-renames, a DOC_TEST_INPUTS allowlist, conservative selection on git error, and unit tests.
Address review: the workflow runs from the default branch but checks out the PR head, so an older branch without scripts/ci/zig-relevant- changes.sh made every 'if ! script' read as no relevant changes and skipped all Zig validation. The filter is now written by the changes job into RUNNER_TEMP from a heredoc in zig-tests.yml, so it exists for every checkout; the VOPR step requires qualification if it is somehow absent. The scope test extracts the embedded text and exercises it.
Contributor
Author
|
/ci run bf1c6ef |
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.
Summary
A docs-only change currently runs the Zig base suite, the e2e base build, and (when it touches
go/pkg/operator/) the operator suite, because nothing in change detection distinguishes markdown from code. #769 moved ~100 markdown files and ran all of those.zig-tests.yml: thechangesjob writes a change-filter script from an embedded heredoc into$RUNNER_TEMPand both the fivechangesblocks and the VOPR qualification block call it instead ofgit diff --quiet. It is embedded rather than checked in because the workflow runs from the default branch while the checkout is the PR head: an older branch without the file would otherwise makeif ! scriptread as "no relevant changes" and skip all Zig validation. The VOPR step requires qualification if the helper is somehow absent. The filter drops.md/.mdxpaths before deciding, with two exceptions that stay in scope: fixture READMEs under atestdata/directory (the GLiNER2.5 oracle scripts check them) and aDOC_TEST_INPUTSallowlist, currentlyzig/pkg/inference/QUANT_KERNEL_COMPILER.md, which a Zig test reads directly. It diffs with--no-renamesso renaming code to Markdown still counts, and a git failure selects tests rather than skipping them.pr-ci-config.json: the operator and proxy path patterns exclude markdown via a negative lookahead, sogo/pkg/operator/work-log/*.mdno longer selects the operator suite.scripts/ci/test_zig_validation_scope.py: the two existing pathspec tests parse the new invocation, plus eight new cases that extract the embedded filter from the workflow and run it in a temp repo: markdown-only, code change, testdata README, allowlisted doc, code-to-markdown rename, pathspec outside the change, bad base revision, and missing--.pr-ci.test.cjs: three assertions for the path patterns.pr-ci.cjsitself is unchanged.zig/CI.md: one bullet documenting the rule.Suites with no path pattern (policy, zig, sdks) still dispatch; the Zig suite's inner
changesjob then skips its test jobs, and sdks-ci's own classifier already scopes by suffix. Theresultjob already treats "changes selected nothing" as a pass rather than a failure.Verification
python3 -m unittest scripts/ci/test_zig_validation_scope.py: 10 pass.node --test .github/scripts/pr-ci.test.cjs: 83 pass.actionlint .github/workflows/zig-tests.yml: clean.zig/**(it edits a Zig and a Python comment) and not relevant undergo/pkg/operator/**(markdown only).Note
zig/CI.mdasks that controller and test code stay identical across this repo and colony.pr-ci.cjsis untouched; the three new assertions inpr-ci.test.cjssit inside the existingif (config.suites.some(s => s.id === 'zig'))branch, so colony's copy of the test file needs the same three lines to stay in sync.