fix(#397): guard the gh-pr-edit workaround, since the repo cannot fix gh itself - #807
Merged
Merged
Conversation
… gh itself `gh pr edit` fails on EVERY invocation against this repo. It pre-fetches the PR through GraphQL and that query asks for `repository.pullRequest.projectCards` -- a Projects (classic) field GitHub has sunset -- so the server rejects the whole query before any edit is attempted. Re-verified today on gh 2.46.0, probed with a deliberately invalid label so nothing could mutate: exit 1, same `projectCards` error. `gh issue edit`, `gh pr merge` and `gh api` are unaffected. THE REPO CANNOT FIX THIS. The bug is in the CLI's own query and 2.46.0 is from January 2025; the remaining action is a `gh` upgrade, which is an environment change. So this is `Refs`, not `Closes`, and #397 is retitled to say "upgrade gh" rather than reading as a repo defect somebody could go fix in here. What the repo CAN do is stop depending on the broken path and stop the workaround being tidied away. scripts/__tests__/gh-pr-edit-is-avoided.test.js asserts: - no script, workflow or hook calls `gh pr edit` -- distinguishing a CALL SITE from prose, so CLAUDE.md and the test itself can still name the command out loud; - CLAUDE.md still carries the REST workaround, in runnable form, so a docs tidy cannot leave the warning standing without its remedy. WHY A TEST AND NOT JUST THE NOTE. The failure is quiet in the way that matters: non-zero exit, but a message that reads like a deprecation NOTICE, on stderr. Wrapped as `cmd >/dev/null 2>&1 && echo ok || echo FAILED` it reports FAILED with no visible reason -- which is exactly how it was originally found, one line in a batch of five that looked like an unrelated permissions problem. A script that adopted `gh pr edit` would keep working right up until it silently stopped. Both halves mutation-verified with the mutant confirmed present first: adding a real call site fails it naming `scripts/ci/zz-mutant.sh:2`, and replacing the `gh api -X PATCH` line in CLAUDE.md fails it with "the warning is not actionable". Controls prove the detector separates prose from a call site in both directions. To close #397: upgrade gh, re-run the probe, and if it succeeds delete both the CLAUDE.md note and this test. That test failing after an upgrade is the signal the workaround is no longer needed -- not a regression. pnpm test:scripts: 374 passed. Refs #397
3 tasks
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.
gh pr editfails on every invocation against this repo. Its GraphQL pre-fetch asks forrepository.pullRequest.projectCards— a Projects (classic) field GitHub has sunset — so theserver rejects the whole query before any edit is attempted.
Re-verified today, probed with a deliberately invalid label so nothing could mutate:
gh issue edit,gh pr mergeandgh apiare unaffected.This is
Refs, notCloses— deliberatelyThe repo cannot fix it. The bug is in the CLI's own query, and
gh 2.46.0is from January2025. The remaining action is an environment change — upgrade
gh— so #397 stays open, and isretitled to say that rather than reading as a repo defect somebody could go fix in here.
What the repo can do, and now does
scripts/__tests__/gh-pr-edit-is-avoided.test.js(inpnpm test:scripts, so inside the requiredTest (20.x)check) asserts:gh pr edit— distinguishing a call site from prose,so CLAUDE.md and the test itself can still name the command out loud;
the warning standing without its remedy.
Why a test and not just the note
The failure is quiet in the way that matters: non-zero exit, but a message that reads like a
deprecation notice, on stderr. Wrapped as
cmd >/dev/null 2>&1 && echo ok || echo FAILEDitreports
FAILEDwith no visible reason — which is exactly how it was originally found, one linein a batch of five that looked like an unrelated permissions problem. A script that adopted
gh pr editwould keep working right up until it silently stopped.Mutation-verified, both halves
scripts/ci/zz-mutant.sh:2gh api -X PATCHline in CLAUDE.mdControls prove the detector separates prose from a call site in both directions — a guard that
flagged the documentation would be deleted by the first person it annoyed.
To close #397
Upgrade
gh, re-run the probe above, and if it succeeds delete both the CLAUDE.md note and thistest. That test failing after an upgrade is the signal the workaround is no longer needed —
not a regression.
pnpm test:scripts: 374 passedRefs #397