Skip to content
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

Bundler 2: Add native helpers for LockfileUpdater #3326

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

jurre
Copy link
Member

@jurre jurre commented Mar 23, 2021

Add native helpers for bundler 2 lockfile updater.

@jurre jurre requested a review from a team as a code owner March 23, 2021 13:32
}]
end

it "updates the dependency's revision" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? 😅 seems like the test is checking if we keep the same revision as the old lockfile? 🤔

Looks like the requirements are not being updated at all so not clear what's being tested. What happens if we do end up updating the requirement? Do we need to unlock the other gems also?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was mostly just adapted from the v1 version, but I think what this is supposed to test is that we keep the same remote after the update, but that it does not have the same revision:

            expect(new_remote_line).to eq(original_remote_line)
            expect(new_revision_line).to_not eq(original_revision_line)

This seems right to me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes you're right, totally missed the to_not eq bit! 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's chance it to not_to 👍

expect { updater.updated_dependency_files }.
to raise_error(Dependabot::NotImplemented,
"Bundler 2 adapter does not yet implement update_lockfile")
it "updates the dependencies" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this case already tested elsewhere for bundler v2? Could we ✂️ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, yes! ✨

@jurre jurre force-pushed the jurre/bundler-2-file-updater branch from a449928 to a174de3 Compare March 23, 2021 14:49
Copy link
Contributor

@feelepxyz feelepxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jurre jurre force-pushed the jurre/bundler-2-file-updater branch from 2d1fdf8 to 63db7c0 Compare March 24, 2021 09:03
@@ -1,29 +1,40 @@
# frozen_string_literal: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like my merge on main created a merge conflict in this file

@jurre
Copy link
Member Author

jurre commented Mar 24, 2021

The python failures seem unrelated, and with that suite taking 60m at the minute (💀), I'm gonna go ahead and merge this. If those tests continue to fail and are not a flake, I'll open a separate PR to fix

jurre added 2 commits March 24, 2021 12:38
Add native helpers for bundler 2 lockfile updater.
This makes it a bit more clear that we're testing negation.
@jurre jurre force-pushed the jurre/bundler-2-file-updater branch from 63db7c0 to 53557ec Compare March 24, 2021 11:38
@jurre jurre merged commit f815cb3 into main Mar 24, 2021
@jurre jurre deleted the jurre/bundler-2-file-updater branch March 24, 2021 11:38
@thepwagner thepwagner mentioned this pull request Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants