Build: skip checkout step when building latest without an explicit default branch #10927
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, first I was trying to fix the whole webhook/build out of sync with latest, but there are several parts where default branch is set to work in some way, bogus way sometimes, but anyway. Instead of trying to solve the whole thing right now, I'm just doing two things:
The second change probably makes updating the default branch from the webhook useless. We should probably invest a little more of time on re-structuring how latest works and how we keep it in sync, for now I just want to unblock users importing projects manually without an explicit default branch.
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, as it's present in the current implementation (and now users aren't blocked at least), and changing the default branch of a repo isn't something users do that often, so I think we are okay with that for now.
Extra fixes:
--
to end positional arguments in all git commands, this isn't a security issue, as all the git commands are run inside docker.Closes #10915