Commit beeeca0
fix: two bugs pr-state.sh only showed when run against a real fleet
The fixture tests could not see either of these. Both turned up on the
first live run.
1. GraphQL node limit. `--json commits` expands each commit's authors
connection, so gh's cost estimate is limit x commits x authors. At
--limit 100 that is 1,000,000 possible nodes and the query is rejected
outright, so the command produced no output at all. --limit 30 keeps
the worst case at 300,000. There is no cheaper field for "when did HEAD
last move": `gh pr list --json` has no last-commit date, and a review's
own commit SHA is REST-only. The cap is announced when hit rather than
silently truncating, per sweep-prs.
2. Lazy `mergeable`, which is the dangerous one. The first query on a cold
PR returns UNKNOWN *and* only then triggers the computation, so
treating UNKNOWN as "not conflicted" hides precisely the stale PRs this
script exists to surface.
Measured: a first fleet run classified #167 and #619 with no conflict
flag; once earlier queries had warmed them, the identical command
returned `needs-refresh` for both. They were CONFLICTING the whole
time. sweep-prs documents this trap and retries for the same reason;
this reintroduced it.
Now: re-ask while anything is UNKNOWN, and if it survives, render it as
"(+mergeability UNKNOWN — re-run)" rather than letting it fall through
to the clean branch.
Verified by mutation: forcing $mergeUnknown to false reddens
test_unknown_mergeability_is_never_reported_as_clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent cd0c5a5 commit beeeca0
2 files changed
Lines changed: 72 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
188 | 208 | | |
189 | 209 | | |
190 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
52 | 96 | | |
53 | 97 | | |
54 | 98 | | |
| |||
69 | 113 | | |
70 | 114 | | |
71 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
72 | 119 | | |
73 | 120 | | |
74 | 121 | | |
| |||
103 | 150 | | |
104 | 151 | | |
105 | 152 | | |
| 153 | + | |
106 | 154 | | |
107 | 155 | | |
108 | 156 | | |
| |||
0 commit comments