diff options
author | Bundlerbot <bot@bundler.io> | 2019-05-05 08:53:23 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-05-05 08:53:23 +0000 |
commit | cdd661c2b99fe1e6262e80a4be3932620827b285 (patch) | |
tree | b88b1580ba8f27a5d5c0fa0e5ef900f1d5563f3f /spec/other | |
parent | 9cc693b61cf13acb7a610692fd41d26a2caa768c (diff) | |
parent | 26d3a59f61b72d44973f14630c2d889b4ca00a71 (diff) | |
download | bundler-cdd661c2b99fe1e6262e80a4be3932620827b285.tar.gz |
Merge #7142
7142: Fully switch to https sources r=indirect a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that in https://github.com/bundler/bundler/pull/7000 I implemented a plan to migrate to https source by default and deprecate github/gist/bitbucket builtin sources, but I changed my mind and I think it's overkill.
The reasons I changed my mind are:
* We [actually announced the switch](https://bundler.io/blog/2019/01/03/announcing-bundler-2.html) and the fact that it didn't happen was not intented. So this can be considered as fixing a bug.
* We have warned non https git sources for ages
https://github.com/bundler/bundler/blob/a6533c0fe6541cc929f895ee0b7a9b673d34cb4d/lib/bundler/source_list.rb#L144-L153
I think people should be ready by now.
Also, we introduced a new setting `github.https` that seems to do essentially the same thing as `git.allow_insecure`.
### What is your fix for the problem, implemented in this PR?
My fix is to take the initial approach of https://github.com/bundler/bundler/pull/6911 and actually do this in the next release.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/other')
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 8ee48f55d5..fd12c645a8 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -365,38 +365,30 @@ RSpec.describe "major deprecations" do end describe Bundler::Dsl do - let(:msg) do - <<-EOS -The :github git source is deprecated, and will be removed in the future. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: - - git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" } - - EOS - end - before do @rubygems = double("rubygems") allow(Bundler::Source::Rubygems).to receive(:new) { @rubygems } end context "with github gems" do - it "warns about the https change if people are opting out" do - Bundler.settings.temporary "github.https" => false - expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) - expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "Setting `github.https` to false is deprecated and won't be supported in the future.") - subject.gem("sparks", :github => "indirect/sparks") - end + it "warns about removal", :bundler => "2" do + msg = <<-EOS +The :github git source is deprecated, and will be removed in the future. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: + + git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" } - it "upgrades to https by default", :bundler => "2" do + EOS expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) subject.gem("sparks", :github => "indirect/sparks") github_uri = "https://github.com/indirect/sparks.git" expect(subject.dependencies.first.source.uri).to eq(github_uri) end + + pending "should fail with a helpful error", :bundler => "3" end context "with bitbucket gems" do - it "warns about removal" do + it "warns about removal", :bundler => "2" do allow(Bundler.ui).to receive(:deprecate) msg = <<-EOS The :bitbucket git source is deprecated, and will be removed in the future. Add this code to the top of your Gemfile to ensure it continues to work: @@ -411,10 +403,12 @@ The :bitbucket git source is deprecated, and will be removed in the future. Add expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) subject.gem("not-really-a-gem", :bitbucket => "mcorp/flatlab-rails") end + + pending "should fail with a helpful error", :bundler => "3" end context "with gist gems" do - it "warns about removal" do + it "warns about removal", :bundler => "2" do allow(Bundler.ui).to receive(:deprecate) msg = <<-EOS The :gist git source is deprecated, and will be removed in the future. Add this code to the top of your Gemfile to ensure it continues to work: @@ -425,6 +419,8 @@ The :gist git source is deprecated, and will be removed in the future. Add this expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) subject.gem("not-really-a-gem", :gist => "1234") end + + pending "should fail with a helpful error", :bundler => "3" end end |