Commit 976aac4
authored
Build: better support for empty default branch (#12462)
The basic idea is to have the value of latest in sync with the value
from the default branch, which we already do. But, in case the default
branch is left empty, we were falling back to master, which is just a
guess of the default, so instead of guessing the value, we just don't
update it if we don't know its value. When cloning the repo, we have
access to the default branch, so that's when we update latest for those
projects.
Note this is only relevant for projects that aren't linked to a remote
repository, since for those we know the default branch. So, when we try
to build the latest version of a project that doesn't have a default
branch, we:
- Omit the ref from the fetch command.
- Use the default branch from the repository for the checkout (we could
skip this step, but since we have a new feature that keeps the files
from a previous clone, we need to do a checkout to make sure we are
building from the given branch/commit).
- Update the identifier from latest to the default branch we detected
from the cloned repository.
There's still the problem about latest's identifier being out of sync
when the default branch changes, but that's fixed after a new build, and
this isn't a new problem (now users aren't blocked at least), and
changing the default branch of a repo isn't something users do that
often, and this only affects projects that aren't linked to a
repository, so I think we are okay with that for now.
This replaces #10927
Closes #122311 parent 7021e8f commit 976aac4
File tree
10 files changed
+449
-72
lines changed- readthedocs
- api/v2/views
- builds
- doc_builder
- projects
- tasks
- tests
- proxito/tests
- rtd_tests/tests
- vcs_support/backends
10 files changed
+449
-72
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
337 | | - | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 | | |
361 | 364 | | |
362 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
238 | 255 | | |
239 | 256 | | |
240 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
1204 | | - | |
| 1204 | + | |
| 1205 | + | |
1205 | 1206 | | |
1206 | | - | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1207 | 1215 | | |
1208 | 1216 | | |
1209 | 1217 | | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
| 1218 | + | |
1213 | 1219 | | |
1214 | 1220 | | |
1215 | 1221 | | |
| |||
1227 | 1233 | | |
1228 | 1234 | | |
1229 | 1235 | | |
1230 | | - | |
1231 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1232 | 1252 | | |
1233 | 1253 | | |
1234 | 1254 | | |
| |||
1328 | 1348 | | |
1329 | 1349 | | |
1330 | 1350 | | |
1331 | | - | |
1332 | | - | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
1333 | 1358 | | |
1334 | 1359 | | |
1335 | 1360 | | |
1336 | 1361 | | |
1337 | 1362 | | |
1338 | 1363 | | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
1339 | 1367 | | |
1340 | 1368 | | |
1341 | 1369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| |||
665 | 670 | | |
666 | 671 | | |
667 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
668 | 687 | | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
| 688 | + | |
680 | 689 | | |
681 | 690 | | |
682 | 691 | | |
| |||
0 commit comments