Repository navigation
Commit 7a2b98e
committed
fix(ci): the agy local-diff fallback cannot merge-base in a shallow clone
Synced from RustyNES (PR #375), stacked on the file-count fix in this same
branch. That fix alone is not enough: it gets the fallback started, and then the
run dies one step later.
[agy-review] diff exceeds GitHub's 300-file API limit; falling back to a local git diff
[agy-review] fetched PR refs using git's ambient credentials
[agy-review] could not compute the merge base for PR #373
The workflow checks out with `fetch-depth: 1`, deliberately -- the comment says
the fallback "fetches exactly the two refs it needs on demand, so a full history
clone would be paid on every run for a path most runs never take". But two refs
fetched into a shallow repository arrive as DISCONNECTED shallow histories, with
no common ancestor for `git merge-base` to find, so it fails even though both
fetches succeeded.
Asks the compare API for the merge base and fetches that single commit instead
of unshallowing. Diffing two commits needs both trees, not the history between
them, so a shallow fetch of the merge base suffices, and a repo with a large
history does not pay a full clone on a path that exists only because the PR is
already unusually big. `--deepen=250` covers a server that refuses a bare-SHA
fetch.
Verified upstream against a genuinely shallow clone -- the earlier attempt was
checked in a full clone, where `git merge-base` succeeds and the bug cannot be
seen. Reproduced the runner's exact failure at `--depth 1`, then confirmed the
fix in that same clone: merge base resolved via the API (identical to a full
clone's `git merge-base`), SHA fetch accepted, resulting diff 12,021 lines /
586,242 bytes.1 parent 3e03914 commit 7a2b98e
1 file changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
265 | 289 | | |
266 | 290 | | |
267 | 291 | | |
| |||
0 commit comments