Commit 6198b4e
committed
build: collapse chains of skipped workflow runs
The validate job's 'Look for prior successful runs' step finds a prior
successful run that is commit- or tree-same and records its URL via
core.notice and as the validate.outputs.skip output, which downstream
jobs surface to users.
When the prior run was itself a skip-run (i.e. its only successful work
was recording a notice pointing at a yet earlier run), we end up with a
chain of skip-runs each pointing at the previous skip-run, rather than
at the run that actually built and tested the tree. Following such a
chain by hand to find the real build is tedious.
Bottom out that chain in the script: after identifying a candidate run,
inspect its Validation job's annotations for the same 'Skipping: There
already is a successful run: <url>' notice. If present, fetch the
referenced run, verify it is still completed and successful, and repeat
until we reach a run that is not itself a skip-run. Use that URL for
both the notice and the job output, so consumers always see the real
underlying run.
Also add console logs along the way (initial match, each chain hop,
stop conditions) to make future debugging straightforward, and grant
the workflow checks: read so the script can call checks.listAnnotations.
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>1 parent e4016c8 commit 6198b4e
1 file changed
Lines changed: 88 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
67 | 68 | | |
68 | 69 | | |
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 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
70 | 154 | | |
71 | 155 | | |
72 | 156 | | |
| |||
101 | 185 | | |
102 | 186 | | |
103 | 187 | | |
104 | | - | |
105 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
106 | 192 | | |
107 | 193 | | |
108 | 194 | | |
| |||
0 commit comments