Commit 374602a
authored
ci: add precomputed pipeline variables (#15582)
## Description
This PRs adds an initial "setup" stage to the pipeline where we compute
and expose the following variables to the rest of the pipeline:
- **GH_PR_NUMBER:** The GitHub PR number if there is an open PR for this
commit, empty otherwise
- **HAS_OPEN_PR:** "true" if there is an open PR for this commit,
"false" otherwise
- **IS_MAIN_BRANCH:** "true" if the current branch is main
- **IS_RELEASE_BRANCH:** "true" if the current branch is a release
branch (e.g., "1.2"), "false" otherwise
- **IS_RELEASE:** "true" if the current commit is a release tag (e.g.,
"v1.2.3"), "false" otherwise
- **IS_MERGE_QUEUE:** "true" if the current branch is a merge queue
branch (e.g., starts with "gh-readonly-queue/"), "false" otherwise
The goal is to provide consistent controls for which jobs to run when,
e.g. should a job run only when we have a PR open or only during a
release?
real example, with #15572 we want to be sure we still restrict
benchmarks to only run/pass when we have an open PR to reduce volume,
today that is controlled by the fact that the GHA wheel building only
happens when a PR is open.
## Testing
<!-- Describe your testing strategy or note what tests are included -->
## Risks
<!-- Note any risks associated with this change, or "None" if no risks
-->
## Additional Notes
<!-- Any other information that would be helpful for reviewers -->1 parent db5d2d3 commit 374602a
File tree
5 files changed
+99
-29
lines changed- .gitlab
- templates
- scripts
5 files changed
+99
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
41 | 42 | | |
42 | 43 | | |
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 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
44 | 89 | | |
45 | 90 | | |
46 | 91 | | |
| |||
55 | 100 | | |
56 | 101 | | |
57 | 102 | | |
58 | | - | |
| 103 | + | |
59 | 104 | | |
60 | 105 | | |
61 | 106 | | |
62 | 107 | | |
63 | 108 | | |
64 | 109 | | |
65 | | - | |
| 110 | + | |
66 | 111 | | |
67 | 112 | | |
68 | 113 | | |
| |||
118 | 163 | | |
119 | 164 | | |
120 | 165 | | |
121 | | - | |
| 166 | + | |
122 | 167 | | |
123 | 168 | | |
124 | 169 | | |
| |||
131 | 176 | | |
132 | 177 | | |
133 | 178 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
138 | 189 | | |
139 | 190 | | |
140 | 191 | | |
| |||
148 | 199 | | |
149 | 200 | | |
150 | 201 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
155 | 206 | | |
156 | 207 | | |
157 | 208 | | |
| |||
177 | 228 | | |
178 | 229 | | |
179 | 230 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
184 | 235 | | |
185 | 236 | | |
186 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| |||
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
212 | 229 | | |
213 | 230 | | |
214 | 231 | | |
| |||
0 commit comments