How to use branching and pull requests with sub modules.

I have created a main repo “infrastructure as code” and 5 sub modules:
infrastructure as code

Now that we have our core code in these directories, we have started with our feature branches on all the repos and require a pull request to make any changes on any of the code in these directories. We started out with “Require a minimum number of reviewers” 1, and “Allow users to approve their own changes” to start with. We also have as optional “Check for linked work items” and required “Check of comment resolution.”

When I set this up, I set the same requirements for the main repo, “infrastructure as code”. This is the question. It looks like it tracks changes to the sub repos and requires a push to update what was done in the sub repo. Which I can’t do because of the restrictions not allowing git push. Does this mean I need to create a branch with the main “infrastructure as code” every time I create a branch for a sub repo and update it after and do a second pull request there. Or, do I need to take the restrictions off the main repo, so the update push can be done as needed? Or do I just put the restrictions on the main only and not the sub repos, or some other option I have not yet considered?

Not sure of the level of Git knowledge here but I would probably ask at e.g. stackoverflow instead.
Git with submodules is a whole different ball game in complexity when it comes to actually working with them.

Fredrik, Thanks for your response. I continue to be amazed that even with all this talk about DevOps in the PowerShell community, there seems to be very few people doing much of it. As I go further and further down the path, there seems to be little or no answers to many of the questions that get into the details of building and maintaining a production enterprise environment. This isn’t just the PowerShell community, this is true with Chef, and Azuredevops, The only people that seem to be in the thick of it are the connections I have with Microsoft engineers that are maintaining their infrastructure. The search goes on…

Well I can’t speak for the whole community but it kind of depends on the scope.
I assume that very few in this forum have actually used sub modules in Git, since it’s not really a forum about Git.
But maybe someone will prove me wrong.

Haven’t had the need to use sub modules myself and from what I’ve read both in the Git documentation and various blogs, it looks like it’s something to avoid as long as you can.
Easy concept to understand with nested repos but the actual usage once you start to collaborate with others, look like a nightmare.
Is there a particular reason why you chose to use sub modules?

In regard to DevOps and Infrastructure as Code, I think the issue is that it’s not actually a specific thing or tool.
There are a lot of tools that can be used in a DevOps / IaC environment and it looks different in each organisation.
E.g. have a look at Stackshare and you’ll see a variety of tools used.

By looking at those examples you’ll see some common tools but also a wide array of tools that are not.
Also it doesn’t say how they are using the tools which will most likely also be unique to each organisation.

So the lack of answers in the communities are most likely down to the convoluted stacks that are used even if they share common attributes.

It will surprise me if most people have not used git. At the last PowerShell summit, we did show a lot of new people how to use it. I hope they start using repos early in their PowerShell carriers. Not sure you really get my point, but thanks for your comments.

Yeah I think you misunderstand me or I’ve misunderstod what you meant.

Git Submodule

Is not what I would call a basic to intermidate level of Git, in terms of its usage.
I think most here are using Git but Git with submodules, doubt it.
But again maybe someone has.

The main point though is that this is a forum about powershell.
So if you’re looking for specific Git answers then most likely you’ll find faster help in a forum about Git.

Yes this is, but during the Summit last year, we discussed the broadening of the scope of questions to include DevOps issues, like ARM templates, Git, Chef, all the many pieces that PowerShell has lead many of us too. I am not expecting everyone to know this kind of thing, I just need one person. Thanks.