Repository navigation
Commit 0444041
ci(readiness): scope concurrency to bound PR refreshes (#2423)
* ci(readiness): scope concurrency to bound PR refreshes
Squad PR Readiness used a workflow-level concurrency group keyed by head
repository and branch. Every workflow_run delivery joins that group before
any job's if: is evaluated. So skipped runs (fork and push runs of Squad
CI, cancelled requests) cancelled real checklist refreshes, and PRs from
one head branch to different bases cancelled each other.
Split the writer into two jobs. bind joins no group and exposes the
binding as job outputs. readiness runs only for a bound PR and joins
squad-pr-readiness-<PR number> with cancel-in-progress. The bind job is
named readiness-bind and added to SELF_CHECK_NAMES, because workflow_run
check runs land on the dev tip, which is the head of any PR from dev.
The split tests now check each job's checkout, require dependent jobs to
wait for the binding, and simulate which group each delivery joins.
Closes #2420
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(readiness): skip stale bound snapshots
The bind job checks the PR head outside the posting job's concurrency
group. A delivery could therefore bind head A, reach the posting job
after head B was pushed and refreshed, and overwrite B's checklist with
A's: scripts/pr-readiness.mjs queried CI for A without comparing it with
the live PR head.
run() now compares PR_HEAD_SHA with the live PR head when it first reads
the PR, before any CI query, and again just before it writes. On a
mismatch it logs one line naming both SHAs, writes nothing and exits 0.
If the PR cannot be read before writing, it fails without writing.
The posting job's group is now keyed by PR number and head SHA. Keyed
by PR alone, such a late job could cancel the current head's refresh
(cancel-in-progress) or replace it while pending, then skip as stale,
so no checklist was posted for the current head. Refreshes of one head
still share a group, so the newer one wins.
Tests cover out-of-order completion: a late run, a head that moves while
the checks run, an unreadable head, and a matching head that still
writes. The concurrency simulation checks that a late run bound to an
older head joins a different group from the current head's refresh.
Closes #2420
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e85b4d5 commit 0444041
4 files changed
Lines changed: 448 additions & 38 deletions
File tree
- .github/workflows
- scripts
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| |||
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 41 | | |
35 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
| |||
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
47 | 65 | | |
48 | | - | |
| 66 | + | |
49 | 67 | | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
53 | | - | |
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
| |||
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
79 | 115 | | |
80 | | - | |
81 | 116 | | |
82 | 117 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
88 | 123 | | |
89 | 124 | | |
90 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
427 | 433 | | |
428 | 434 | | |
429 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
430 | 451 | | |
431 | 452 | | |
432 | 453 | | |
433 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
434 | 459 | | |
435 | 460 | | |
436 | 461 | | |
437 | 462 | | |
438 | 463 | | |
439 | | - | |
| 464 | + | |
440 | 465 | | |
441 | 466 | | |
442 | 467 | | |
| |||
491 | 516 | | |
492 | 517 | | |
493 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
494 | 529 | | |
495 | 530 | | |
496 | 531 | | |
| |||
610 | 645 | | |
611 | 646 | | |
612 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
613 | 656 | | |
614 | 657 | | |
615 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
| 827 | + | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
| 847 | + | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| |||
940 | 942 | | |
941 | 943 | | |
942 | 944 | | |
943 | | - | |
| 945 | + | |
944 | 946 | | |
945 | 947 | | |
946 | 948 | | |
| |||
1063 | 1065 | | |
1064 | 1066 | | |
1065 | 1067 | | |
| 1068 | + | |
1066 | 1069 | | |
1067 | 1070 | | |
1068 | 1071 | | |
1069 | 1072 | | |
1070 | 1073 | | |
1071 | | - | |
1072 | | - | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
1073 | 1079 | | |
1074 | 1080 | | |
1075 | 1081 | | |
| |||
1108 | 1114 | | |
1109 | 1115 | | |
1110 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1111 | 1214 | | |
0 commit comments