Fix submodule mirror repository remote using main repo URL #1998
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.
Followup to #1959.
Upon updating to 3.44, we started seeing the new submodule mirror directories having their
origin
remote set to the URL of the pipeline's repo instead of the submodule's repo. This is causing a doublegit fetch
of the main repo to happen, once when checking out the commit to build and once when updating submodules.We also don't want to be running any fetches in the submodule mirror repo since the only branch or PR information the agent has is for the main repo, and those fetches would most likely fail in the submodule mirror.
Reproed in https://github.com/francoiscampbell/buildkite-submodule-test:
We can see that it's setting the
origin
to the wrong URL:and then running a fetch in the submodule mirror directory with the
origin
of the main repo: