-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Apply patches #212
Apply patches #212
Conversation
I like that change and this is something we should do. One side note, using your scenario with Before this change, This change solves the problem when In order to reduce the likelihood of being stuck in that situation, should we all agree that if we have a MM PR that impacts broadly (likely to cause merge conflicts) many downstream PRs, then, we should wait until all the downstream PRs are ready to merge before merging them. Thoughts? |
Yep, I think that if you end up in a situation where I agree with you - I think a broad impact PR shouldn't be merged until all its downstreams are ready - but I think there will probably be cases where we do it anyway, for instance resources that people are particularly interested in. |
756e1be
to
3e534d3
Compare
I am a robot that works on MagicModules PRs! Once this PR is approved, you can feel free to merge it without taking any further steps. |
This solves a weird problem that I think might start coming up more often.
MMPR1
), and it creates two PRs downstream, in Terraform and Puppet, call themTFPR1
andPPR1
.TFPR1
is merged, butPPR1
is not.MMPR1
cannot be merged.MMPR2
, which affects Terraform, and createsTFPR2
.MMPR2
does not include the commit ofMMPR1
, which is not merged.TFPR2
reverts the changes ofTFPR1
, because the code used to generate it is not present in the version of MagicModules thatMMPR2
is based on.MMPR3
, which makes no changes to the downstream code, will openTFPR3
, revertingTFPR1
.This solves the problem in a way that I kind of like, but I want your opinion on - we fetch any PR which is merged downstream, as a diff which should be applied after our changes. If that PR's patch applies cleanly, that's great. If it doesn't, then we're in a state where we actually can't generate a correct PR, and generation should fail (as it does, in this change) rather than produce a PR which will apply incorrectly.
NB: This has the maybe somewhat forward-looking benefit that it is agnostic to the source of the patches. If someone decided they just had to make a modification to a Terraform resource, but didn't want to bother with the MagicModules work to make that change, this could be modified to fetch that PR as well. Might be handy to have.
Another note - The order of operations here is
This is because applying patches fails if your working tree isn't clean. We need the patches to apply after the generation, because otherwise generation will blow those changes away again. We want the whole thing (generation + patches) as a single commit because splitting it up won't provide any useful information.
What do you think?
[all]
CI change only
[terraform]
[puppet]
[puppet-dns]
[puppet-sql]
[puppet-compute]
[chef]