Commit 6f40ed7
fix(ci): an already-closed cross-repo issue gets the PR backlink instead of being skipped whole (#9716)
* fix(ci): an already-closed cross-repo issue gets the PR backlink instead of being skipped whole
The per-target loop skipped an already-closed issue entirely, and the skip
covered two calls of which only one is redundant. Re-closing a closed issue is
a no-op worth avoiding; dropping the BACKLINK is the half this workflow's own
header calls the defect it exists to fix -- "no reference to the PR on the
issue's own page either, so the next reader has no way to find the fix".
"Already closed" is three situations and the API can separate the ones that
matter:
not_planned / duplicate -> post nothing, annotate. A comment claiming this PR
fixed it contradicts the triage decision recorded on the issue. Measured:
26 of 144 recently closed issues in this repo carry one of those reasons,
so this is not a theoretical branch. `state_reason` is nullable in practice
(objectui#4478 answers null from `issues.get`), and null is read as
"no objection recorded".
closed by an earlier run of this job -> post nothing, it is already there.
The API cannot tell this from a human close -- `closed_by` is a login and
every seat here shares one identity -- so the backlink now carries a
per-PR marker on both paths and the loop looks for it.
closed by hand before the merge -> leave the backlink, change nothing else.
Idempotency was a prerequisite rather than a nicety: there was none on the
comment path, and the skip WAS the re-run guard -- the job summary told people
"already-closed targets are skipped, so they are not re-commented". That
sentence is now true by construction instead of by side effect.
The marker is per-PR and therefore stable across runs, which fixes the
degradation direction when the comment listing cannot be read: skip and say so
(at-most-once). Posting blind would strand a permanent second backlink on
another repo's closed issue. merge-queue-triage.yml reaches the opposite
conclusion from the same trade because its marker carries a run id.
The post-loop verdict no longer reports every failure as "could NOT be closed
and is still open" -- a lost backlink on an already-closed issue sends the
reader to do the one thing already done. Each failure records which half it
lost.
Harness (#9645): L2 is rewritten rather than deleted, plus L6-L11 for the
re-run, the triage contradiction, the unreadable listing, the null reason, the
backlink-refused verdict, and a two-run ROUND TRIP that feeds run 1's output
into run 2. 52 assertions over 10 scenarios -> 88 over 16; 7 mutations -> 11.
The harness also grew a guard it needed: adding `listComments` moved real
behaviour and all 52 assertions stayed GREEN, because the unstubbed method
threw inside the script's own try and was absorbed by the degradation branch
the new code had just added. Unmodelled API calls are now recorded
out-of-band and fail the scenario regardless of its own assertions.
Refs #9595, #9575, #4482
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja
* test(ci): close the unmodelled-API blind spot at every level of the harness doubles
The guard added with the backlink fix covered `github.rest.issues.*` only,
which leaves the identical bug one level up: `github.paginate`,
`github.request` and `github.graphql` are all reachable from a github-script
body and were plain `undefined`, so a call to one throws a TypeError inside the
script's own try and is absorbed by whatever degradation that catch implements.
The top-level `exec`/`glob`/`io`/`fetch` stubs threw but recorded nothing, so
the same absorption applied to them.
Every level now records into one sink before throwing, and `judge` already
fails the scenario on the record. Verified by mutating the shipped script to
call `github.paginate(...)` and `github.rest.issues.addLabels(...)`: both are
named by the failure text instead of vanishing into a degradation branch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2065e31 commit 6f40ed7
2 files changed
Lines changed: 520 additions & 80 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
43 | 72 | | |
44 | 73 | | |
45 | 74 | | |
| |||
278 | 307 | | |
279 | 308 | | |
280 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
281 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
282 | 332 | | |
283 | 333 | | |
284 | 334 | | |
285 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
286 | 342 | | |
287 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
288 | 411 | | |
289 | 412 | | |
| 413 | + | |
290 | 414 | | |
291 | 415 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 416 | + | |
296 | 417 | | |
297 | 418 | | |
298 | 419 | | |
| |||
305 | 426 | | |
306 | 427 | | |
307 | 428 | | |
308 | | - | |
309 | | - | |
310 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
311 | 432 | | |
312 | 433 | | |
313 | 434 | | |
314 | 435 | | |
315 | 436 | | |
316 | | - | |
| 437 | + | |
317 | 438 | | |
318 | 439 | | |
319 | 440 | | |
| |||
322 | 443 | | |
323 | 444 | | |
324 | 445 | | |
325 | | - | |
| 446 | + | |
326 | 447 | | |
327 | 448 | | |
328 | | - | |
| 449 | + | |
329 | 450 | | |
330 | | - | |
| 451 | + | |
331 | 452 | | |
332 | 453 | | |
333 | 454 | | |
334 | | - | |
335 | | - | |
| 455 | + | |
| 456 | + | |
336 | 457 | | |
337 | 458 | | |
338 | 459 | | |
| |||
343 | 464 | | |
344 | 465 | | |
345 | 466 | | |
346 | | - | |
347 | | - | |
348 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
349 | 471 | | |
0 commit comments