[codex] add test impact plan workflow#794
Merged
Merged
Conversation
857e17d to
bf1e4a3
Compare
bf1e4a3 to
7834629
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.
Summary
Adds a deterministic test impact planner that summarizes how a PR changes test coverage signals, similar to a lightweight
tfplanfor tests.scripts/test_impact_plan.pyto classify test file deltas, test case/assertion deltas, added skips/known failures, workflow runner changes, path filters,continue-on-error, e2e retry changes, GitHub API files that lack patch data, renamed files moving into/out of test scope, and incomplete PR file-list data.just test-impact-planso developers can preview the plan for a branch.pull_request_target:test-impact-planruns onpull_requestwith read-only permissions and records the trigger.test-impact-plan-commentruns onworkflow_run, checks out trusted default-branch code, verifies the PR context is current/open/targeting this repo, re-fetches PR metadata/files via GitHub API, runs the trusted planner, writes the job summary, and posts/updates one sticky PR comment.Notes
The workflow is advisory and does not block merges by itself.
The privileged comment workflow does not trust artifacts or PR-produced output. It uses
workflow_runonly as a trigger, then re-fetches PR data from GitHub and runs the planner from trusted default-branch code.Because the
workflow_runworkflow must exist on the default branch, sticky comments will apply to future PRs after this lands.Validation
--github-pr-files-jsonpython3 scripts/test_impact_plan.py --github-pr-files-json /tmp/duckgres-pr794-files.json --expected-file-count $(jq -r '.changed_files' /tmp/duckgres-pr794.json)python3 scripts/test_impact_plan.py --base origin/main --head HEADPYTHONPYCACHEPREFIX=/tmp/duckgres-pycache python3 -m py_compile scripts/test_impact_plan.pyruby -e 'require "psych"; Dir[".github/workflows/test-impact-plan*.yml"].each { |p| Psych.load_file(p); puts "ok #{p}" }'git diff --cached --checkjust lintin a clean temporary copy with only this branch's changes appliedLocal
just lintin the active worktree is currently blocked by an unrelated unstaged edit inserver/conn_cleanup_test.go(testingimport unused after a local test deletion).