-
Notifications
You must be signed in to change notification settings - Fork 46
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
Initial stab at enabling git submodule support in between meals #18
Conversation
…meals into restore_submodules
…eals into submodule_support
@@ -168,7 +173,7 @@ def parse_status(changes) | |||
# X: "unknown" change type (most probably a bug, please report it) | |||
|
|||
# rubocop:disable MultilineBlockChain | |||
changes.lines.map do |line| | |||
changes.lines.to_a.reverse.map do |line| |
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.
Why?
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.
To handle the case of a path being removed and re-added as a submodule. Before reversing the order it was only picking up the delete, and not the addition.
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.
Can you provide an example git output? And incorporate that into the test cases? I've got a feeling this fix is incidental and possibly breaking other stuff.
Looks sane. Could you squash into single commit? |
I believe these tests are broken on master as well. |
Nope, they are not. |
Sorry for the delay was at ChefConf last week. When you move an existing cookbook to a submodule the git history looks like:
Between_Meals does detect all of the events and lists them properly in the Changes hash. However the above sequence results in a delete of the foo cookbook from the chef server, not an add/update
This is due to:
While the current hacks (reverse and relaxed regex) do hide this issue for our use case, they're not ideal as you've pointed out. My current thought is to add a gd_revision file for each submodule. |
Meanwhile if you move a cookbook, it'll show up as:
So not only are they sub-optimal, they'll break the common case. But moreover, we are doing all deletes before adds: https://github.com/facebook/grocery-delivery/blob/master/bin/grocery-delivery#L130 So the problem here actually isn't the order (I'm confused as to how the |
@irabinovitch - this might be what you want
somewhere around |
afaik the ordering of output is crucial here. all the |
Pingaling? |
OK, closing after 3 months of no activity. If you get time to work on this again, please feel free to re-open. |
This is an initial stab at enabling git submodule support in between meals. Still doing a bit more testing but wanted to start the PR to get any feedback/concerns.