-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
fix(updating): exclude deleted paths on update #1719
Conversation
a27a19f
to
f44d4af
Compare
f44d4af
to
7eb29ad
Compare
Thanks for raising this problem and offering a PR to fix it, @lkubb! 🙏 I wonder whether we could take a different approach involving programmatic use of I haven't tested this idea, so I might have overlooked something. WDYT, @lkubb? |
@sisp Thanks for taking the time to consider my proposal. :) Responding to your issue comment caused me to find another related inconsistency (imho), #1721.
Your proposal additionally allows to fix #1721 elegantly by excluding all deleted paths (if solution (a) from the issue is deemed acceptable).
An issue I can see with your proposal in comparison to mine is that tasks (not migrations, here it's an issue for both) might assume the presence of a specific file, but that's common to all I will implement your proposal as described above, fixing the new issue as well. Happy to iterate on this if there is some disagreement. Thanks again for your time! |
ef99f7f
to
0780374
Compare
Previously, paths that matched a pattern in `skip_if_exists` and that were deleted in the generated project were recreated during each update. These deletions are contained in the diff between old vanilla generated project and the (pre-update) current one. They are not executed though since the paths are excluded from the diff application. Similarly, if a file that was deleted intentionally in a generated project was changed in the template, an update would have regenerated it (but not if it did not have any changes). I'm not completely sure how this manifested, but it probably involved a suppressed merge conflict. This commit ensures that update behavior is always consistent - never regenerate deleted paths during `update` - by acquiring a list of deleted paths and excluding them in the copy operations that are relevant for acquiring the update diff.
0780374
to
30ad622
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1719 +/- ##
==========================================
- Coverage 97.71% 97.61% -0.10%
==========================================
Files 49 49
Lines 4980 5042 +62
==========================================
+ Hits 4866 4922 +56
- Misses 114 120 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks great! Just a few minor remarks, and we need to escape the file names to be excluded (see inline comment).
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.
Sorry, I reviewed the PR before the issues (my fault).
Let's triage the issues first. I'm not yet convinced they're bugs. Thanks!
a2d8e9c
to
ce7c91a
Compare
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.
Thanks! This looks excellent!
Would you please remove those references to issues, so I can merge?
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.
Previously, paths that matched a pattern inskip_if_exists
and that were deleted in the generated project were recreated during each update.These deletions are contained in the diff between old vanilla generated project and the (pre-update) current one. They are not executed though since the paths are excluded from the diff application.Previously, if a file that was deleted intentionally in a generated project was changed in the template, an update would have regenerated it (but not if it did not have any changes).
This patch ensures that update behavior is consistent for paths that are not listed in
skip_if_exists
- don't regenerate deleted paths duringupdate
- by acquiring a list of deleted paths and excluding them in the copy operations that are relevant for acquiring the update diff.skip_if_exists
paths are not excluded, their presence is always ensured, even bycopier update
(#1718 (comment)).Fixes: #1721
Thanks a lot for maintaining this very neat tool btw!