-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Nuget grouped PR's #9228
Fix Nuget grouped PR's #9228
Conversation
During a grouped update, the updater code will keep track of the modified dependency files in-memory and hand them off to the FileUpdater for each iteration of the dependencies:
So I suspect the problem is not that the directory is getting reset each iteration, but the modified dependency files need to be written to disk before the NuGet native updater is used. Does that make sense? |
@jakecoffman The behavior I observed when removing the line that resets the changes was that a single grouped update would work as expected but if multiple individual updates were applied in a single job then the updates would become cumulative where in the end the last update contained all of the previous updates. Wouldn't this mean that the modified dependency files are already being written to the disk? (Please correct me if I'm wrong) In any case, a working solution would be to have the updater only reset if we're not conducting a grouped update which brings a lot of edge cases such as handling multiple groups or a group + an individual update. Let me know if you feel like we should approach this differently. |
We already have that with this helper 👇 dependabot-core/common/lib/dependabot/shared_helpers.rb Lines 44 to 63 in c676f59
For non-grouped updates it goes into this path: dependabot-core/common/lib/dependabot/shared_helpers.rb Lines 52 to 58 in c676f59
For a grouped update it defers to the active workspace, where it resets at the end of all updates:
Here's probably the clearest example of how to use it: dependabot-core/npm_and_yarn/lib/dependabot/npm_and_yarn/file_updater/yarn_lockfile_updater.rb Lines 56 to 70 in 86e8577
|
Issue occured because we were resetting repo files when we shouldn't. Using this helper method allows us to reset only when appropriate.