From 1953cfdbd34b8f701ea2a330820b6bfb6b56c638 Mon Sep 17 00:00:00 2001 From: Bundlerbot Date: Mon, 26 Nov 2018 23:09:40 +0000 Subject: [PATCH 1/2] Merge #6798 6798: Use https in the Github shortcut by default in Bundler 2 r=colby-swandale a=colby-swandale This PR is setting Git gems to be fetched over https by default. Note: This PR is successing #6791 Closes #6785 Co-authored-by: Colby Swandale (cherry picked from commit cf45792213fadf97f7aa6464de8ebd79f09725d2) --- lib/bundler/dsl.rb | 2 +- spec/bundler/dsl_spec.rb | 6 +++--- spec/other/major_deprecation_spec.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 90ac073c36d..285b1551973 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -305,7 +305,7 @@ def add_git_sources # end repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") # TODO: 2.0 upgrade this setting to the default - if Bundler.settings["github.https"] + if Bundler.feature_flag.github_https? Bundler::SharedHelpers.major_deprecation 3, "The `github.https` setting will be removed" "https://github.com/#{repo_name}.git" else diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 94d54ad8774..8aeca6414ab 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -44,7 +44,7 @@ it "converts :github to :git" do subject.gem("sparks", :github => "indirect/sparks") - github_uri = "git://github.com/indirect/sparks.git" + github_uri = "https://github.com/indirect/sparks.git" expect(subject.dependencies.first.source.uri).to eq(github_uri) end @@ -62,7 +62,7 @@ it "converts 'rails' to 'rails/rails'" do subject.gem("rails", :github => "rails") - github_uri = "git://github.com/rails/rails.git" + github_uri = "https://github.com/rails/rails.git" expect(subject.dependencies.first.source.uri).to eq(github_uri) end @@ -253,7 +253,7 @@ end subject.dependencies.each do |d| - expect(d.source.uri).to eq("git://github.com/spree/spree.git") + expect(d.source.uri).to eq("https://github.com/spree/spree.git") end end end diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 50800dbb0c3..04f71e2eca8 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -198,7 +198,7 @@ end context "with github gems" do - it "warns about the https change" do + it "warns about the https change", :bundler => "3" do msg = <<-EOS The :github git source is deprecated, and will be removed in Bundler 3.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: From 50c3395479ff9bca569212fbdc3a6e8743b92802 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Mon, 3 Jun 2019 19:59:32 +1000 Subject: [PATCH 2/2] fix bug where bundler v3 is running a test for bundflet 2 --- spec/other/major_deprecation_spec.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 04f71e2eca8..0a3c65a1e50 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "major deprecations", :bundler => "< 3" do +RSpec.describe "major deprecations", :bundler => "<= 2" do let(:warnings) { last_command.bundler_err } # change to err in 2.0 let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby(gems)? >= .*/, "") } @@ -198,17 +198,6 @@ end context "with github gems" do - it "warns about the https change", :bundler => "3" do - msg = <<-EOS -The :github git source is deprecated, and will be removed in Bundler 3.0. 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 - expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) - subject.gem("sparks", :github => "indirect/sparks") - end - it "upgrades to https on request" do Bundler.settings.temporary "github.https" => true msg = <<-EOS