New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(git): initialise submodules when cloning repos #4353
Conversation
Question: Don't we need to prevent Renovate from scanning files within the submodules and attempting to update them? |
Good question, it's not a scenario I've considered. I'll test later. |
Maybe the submodule checkout should be an option, because you have to add an exclude rule for the submodule folders to renovate. Maybe we can check for a |
I think the submodules are only required for artifact generation (lock files, etc), so potentially we can lazily fetch them as-needed. But if we fetch them prior to scanning/extracting then we ideally need a way to automatically exclude them. |
There's one possibility I can think of where submodules might be useful during extraction. It's possible for some managers like Maven that a package could point to a "parent" package and that parent package includes information such as the default registry to use. In this case if we don't have submodules resolved then the package package would look like a broken local link. It's an edge case but maybe a valid one. However, preventing problems during extraction could be pretty simple - we already call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that the getFileList()
function doesn't return submodule files to the upper layer which extracts packages
Sure, I'll see what the best way to do this is, with an eye on implementing #2502 next. |
I've added the check to
I'm more of a fan of enabling it by default. I think it's a sensible default, and makes it easier for users to onboard to renovate. |
@rarkins This is ready for review |
@JamieMagee hadn't you added code to exclude submodules files from the |
Yeah, I even added tests. Looks like the branch I rebased was out of date with origin, so I pushed an old commit. |
Thanks. FYI, my position on rebasing is:
|
Sure, I understand that the merging strategy is mostly a personal preference. |
🎉 This PR is included in version 19.52.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@rarkins Are we able to exclude the submodule recurse from happening? Currently this breaks renovate for us as our git submodules belong to private repositories. |
@ajcann Yeah, this should be fairly easy to add a config flag for. |
See https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---recurse-submodulesltpathspec
Fixes #1356