Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Review multiple sources deprecation #7057

Merged
9 commits merged into from
Apr 11, 2019
Merged

Review multiple sources deprecation #7057

9 commits merged into from
Apr 11, 2019

Conversation

deivid-rodriguez
Copy link
Member

What was the end-user problem that led to this PR?

The problem was that I had not yet reviewed the deprecation about multiple global sources being present on a Gemfile, and thus the specs were skipped.

What was your diagnosis of the problem?

My diagnosis was that we need to delay the removal of multiple sources support to bundler 3, so that we can show the deprecations in the 2.x series.

I also noticed that part of the deprecation message was inaccurate. In order to upgrade the warning to an error, you would also need to configure the lockfile_uses_separate_rubygems_sources setting. Otherwise you will get an error that these two settings depend on each other and can't be enabled separatedly.

What is your fix for the problem, implemented in this PR?

My fix is to delay these feature flags to bundler 3 so that the deprecation specs pass. Also, since before giving this advice I'd like to study why we have two different settings that can't be enabled separately, and why the can't be merged to a single one, I have removed that part of the message for now.

Why did you choose this fix out of the possible options?

I chose this fix because it keeps me moving with reviewing all the deprecations for bundler 3 breaking changes, and makes sure that the deprecations for this change of behavior are tested (and passing).

@deivid-rodriguez
Copy link
Member Author

This PR also includes some extra changes to refactor deprecation specs, and to move the tests for multiple sources support deprecation to the file that tests all deprecations.

As always, I can move those to a separate PR if reviewers feel it's needed 👍.

@deivid-rodriguez
Copy link
Member Author

Ok, so this is failing because this introduces the lockfile incompatibility mentioned in #7007. I would love a review of that PR.

@deivid-rodriguez deivid-rodriguez force-pushed the multiple_sources_deprecation branch 4 times, most recently from 80f6904 to a5c3549 Compare April 5, 2019 15:15
@deivid-rodriguez
Copy link
Member Author

This PR also includes some extra changes to refactor deprecation specs, and to move the tests for multiple sources support deprecation to the file that tests all deprecations.

I ended up extracting these changes to #7105, so I'm going to ask for reviews there first.

`install_gemfile!` already runs that.
Gemfile is not considered in this situation.
Move them to the file where all deprecations are tested. And test just
the simple case, since the deprecations logic should be the same for all
cases.
Currenty one gets errors like

```
Failure/Error: lock_sources.to_set == replacement_sources.to_set

NoMethodError:
  undefined method `to_set' for #<Array:0x0000560a01cd97c0>
  Did you mean?  to_s

```
@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Apr 8, 2019

This PR is now ready. I ended up keeping the instructions to opt-in to the fix in the deprecation message, but merging the lockfile_uses_separate_rubygems_sources and disable_multisource settings together.

Also, there was a failing spec in the list command specs, but it was not related to the list command, but to a slight change in behavior due to the multisource fix.

I'm unsure whether we want this new behavior or not, but since it was unrelated to the list command and I don't want it to block this PR, I refactored the list command specs to not hit the behavior change, and documented the change separately on a different spec. See 59e989f.

Previously, all specs would bundle a Gemfile from the "repo1" source by
default. Then, some list specs would end up using a "repo2" source. The
behavior when changing repo sources is changing with the
`disable_multisource` setting, but it is unrelated to the list command.

So, I refactored the list command specs to not change sources, and
extracted the behavior change about changing sources to a separate spec.
Copy link
Member

@indirect indirect left a comment

Choose a reason for hiding this comment

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

This seems right to me! Thanks for cleaning this up.

@indirect
Copy link
Member

@bundlerbot r+

@ghost
Copy link

ghost commented Apr 11, 2019

Merge conflict (retrying...)

ghost pushed a commit that referenced this pull request Apr 11, 2019
7057: Review multiple sources deprecation r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that I had not yet reviewed the deprecation about multiple global sources being present on a Gemfile, and thus the specs were skipped.

### What was your diagnosis of the problem?

My diagnosis was that we need to delay the removal of multiple sources support to bundler 3, so that we can show the deprecations in the 2.x series.

I also noticed that part of the deprecation message was inaccurate. In order to upgrade the warning to an error, you would also need to configure the `lockfile_uses_separate_rubygems_sources` setting. Otherwise you will get an error that these two settings depend on each other and can't be enabled separatedly.

### What is your fix for the problem, implemented in this PR?

My fix is to delay these feature flags to bundler 3 so that the deprecation specs pass. Also, since before giving this advice I'd like to study why we have two different settings that can't be enabled separately, and why the can't be merged to a single one, I have removed that part of the message for now.

### Why did you choose this fix out of the possible options?

I chose this fix because it keeps me moving with reviewing all the deprecations for bundler 3 breaking changes, and makes sure that the deprecations for this change of behavior are tested (and passing).

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
@ghost
Copy link

ghost commented Apr 11, 2019

Build succeeded

@ghost ghost merged commit 59e989f into master Apr 11, 2019
@ghost ghost deleted the multiple_sources_deprecation branch April 11, 2019 11:15
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants