Repository navigation
ci-local-merge: list a PR's files from the paginated files API - #476
Merged
Merged
Conversation
`gh pr diff --name-only` refuses a diff over 20,000 lines, so the merge script could not work out which workflows #473 triggers (it adds about 34,000 lines of generated designs and evidence frames) and refused it. List the files from GitHub's paginated pulls/<n>/files instead, with a renamed file's old path as the pull_request path filters see it, and refuse when GitHub lists fewer files than the PR changes (the listing stops at 3,000). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Local CI passed on 04b3671 ( GitHub would run for this PR: desktop.yml, phone.yml. Merged on this local pass (macOS runner queue); GitHub CI runs on the merge commit on main.
Notes:
|
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.
Why
tools/ci-local-merge.sh 473refused #473 although its local CI evidence was complete: the script listed the PR's files withgh pr diff --name-only, and GitHub's diff endpoint refuses a diff over 20,000 lines (#473 adds about 34,000, mostly the generated designs and evidence frames App Flow keeps). #473 was then merged by running the script's own checks, unchanged, with the file list from the paginated files API (see its merge comment).What
pr_fileslists the files fromgh api --paginate repos/{owner}/{repo}/pulls/<n>/files, each file's path plus a renamed file's old path, which is how the workflows'pull_requestpath filters see a rename. Names with spaces survive (one line per file).changedFiles(the listing stops at 3,000), since the triggered workflows would then be unknown.docs/local-ci.mdsays where the files come from.Tests
python3 -m unittest tools/test_ci_local.py: 38 tests, including the newPullRequestFiles(paginated listing, renamed paths, a name with spaces).python3 -m unittest discover -s tools -p 'test_*.py': 153 tests.pr_files(473)returns 235 files, equal to the PR'schangedFilesand togit diff --name-onlyof its range.🤖 Generated with Claude Code