Commit 9c5f93d
authored
Allow-list the release lines' RC and GA tags for runner groups (#8502)
Release binaries are built from **tags, not branches**: pushing
`v2.14.0-rc1` runs the build workflows at `refs/tags/v2.14.0-rc1`.
GitHub matches `selected_workflows` entries on the exact ref, so the
`@refs/heads/release/2.14` entries this script already emits don't
authorize those runs — which is why
https://github.com/pytorch/pytorch/actions/runs/31528881582 needed the
tag added to the runner groups by hand.
Emit tag refs alongside the branch refs, for **every pinned release
line**, so a patch release on the preceding line keeps runner access
too. Each line contributes its newest GA tag and its newest
`v<version>-rc<n>`, ranked by `(patch, rc)` so `v2.13.1-rc1` supersedes
the rc15 that shipped as `v2.13.0`.
Only the newest of each is kept — pinning every tag would grow the
allow-list and the per-ref discovery cost by a workflow set per tag
(2.13 reached rc15). Eviction is safe: the allow-list is checked when a
job starts, so in-flight builds are unaffected.
Tags come from `git/matching-refs`, one request instead of paging
pytorch/pytorch's whole tag history.
## Testing
8 new unit tests, 22 pass. `lintrunner` clean. End-to-end against the
live API in discovery-only mode:
```
Target refs: ['refs/heads/main', 'refs/heads/nightly', 'refs/heads/release/2.14',
'refs/heads/release/2.13', 'refs/tags/v2.14.0-rc1',
'refs/tags/v2.13.0', 'refs/tags/v2.13.0-rc15']
Desired allow-list (39 references):
...generated-linux-binary-manywheel-nightly.yml@refs/tags/v2.14.0-rc1
```
https://github.com/pytorch/test-infra/actions/runs/31543618002/job/93951275801#step:4:151 parent 3987ba1 commit 9c5f93d
2 files changed
Lines changed: 139 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
148 | 217 | | |
149 | 218 | | |
150 | 219 | | |
151 | 220 | | |
152 | 221 | | |
153 | 222 | | |
154 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
155 | 233 | | |
156 | 234 | | |
157 | 235 | | |
| |||
301 | 379 | | |
302 | 380 | | |
303 | 381 | | |
304 | | - | |
| 382 | + | |
305 | 383 | | |
306 | 384 | | |
307 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 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 | + | |
84 | 141 | | |
85 | 142 | | |
86 | 143 | | |
| |||
0 commit comments