Skip to content

test(quality): give the changed-path filter suite the push env #881 reads - #884

Open
WilcoLouwerse wants to merge 1 commit into
mainfrom
fix/changed-path-filter-test-branch-env
Open

WilcoLouwerse wants to merge 1 commit into
mainfrom
fix/changed-path-filter-test-branch-env

Conversation

@WilcoLouwerse

Copy link
Copy Markdown
Contributor

Summary

Since #881, a push run's changed-path filter diffs from the head of the last push run that finished uncancelled, and it reads that with gh api and $BRANCH. scripts/test-changed-path-filter.py runs the push cases with neither. set -u stops the script on the unbound BRANCH (rc=127), so the docs-only and src/ push cases fail on main. That turns the required Shared-workflow guard red on every open PR in this repo.

The workflow is fine; only the suite's environment is incomplete:

  • A fake gh on PATH answers the two Actions API calls offline. Its FAKE_GH_LAST is the head it reports, and FAKE_GH_FAIL makes every call fail.
  • The push env now carries BRANCH, GITHUB_REPOSITORY and GITHUB_RUN_ID.
  • Two new cases cover what fix(quality): diff a push from the last finished run, not from the previous tip #881 added:
    • a docs-only push after a cancelled code push must run the test tier;
    • a push whose last finished run cannot be read must run everything.

Test plan

🤖 Generated with Claude Code

…eads

Since #881 a push run diffs from the head of the last push run that
finished uncancelled, which it reads with `gh api` and `$BRANCH`. The
suite ran push cases with neither, so `set -u` stopped the script on the
unbound BRANCH (rc=127) and the docs-only and src/ push cases failed on
main, taking the Shared-workflow guard down with them on every PR.

A fake `gh` on PATH now answers the two Actions API calls offline, and the
push env carries BRANCH and the run ids. Two cases cover what #881 added:
a docs-only push after a cancelled code push must run the test tier, and
so must a push whose last finished run cannot be read. Both fail against
the workflow from before #881, so they test the new path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WilcoLouwerse

Copy link
Copy Markdown
Contributor Author

@rjzondervan @remko48 @bbrands02 @SudoThijn could one of you force-merge this PR? I am not allowed to bypass the branch protection myself. Ruben is restructuring the branches tonight and this weekend, so I want this on main today; then I can still merge the beta release PRs before that.

This branch has not been deployed

No deployments
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