dependabot-bundler 0.403.0 → 0.405.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/v2/sorbet/config +11 -0
  3. data/helpers/v2/spec/bundler_endpoint_specification_metadata_patch_spec.rb +5 -1
  4. data/helpers/v2/spec/bundler_version_constraint_spec.rb +1 -1
  5. data/helpers/v2/spec/functions/conflicting_dependency_resolver_spec.rb +22 -1
  6. data/helpers/v2/spec/functions/dependency_source_spec.rb +17 -1
  7. data/helpers/v2/spec/functions/file_parser_spec.rb +9 -1
  8. data/helpers/v2/spec/functions/force_updater_spec.rb +2 -0
  9. data/helpers/v2/spec/functions/version_resolver_spec.rb +2 -0
  10. data/helpers/v2/spec/functions_spec.rb +9 -2
  11. data/helpers/v2/spec/native_spec_helper.rb +10 -2
  12. data/helpers/v2/spec/ruby_version_spec.rb +7 -1
  13. data/helpers/v2/spec/shared_contexts.rb +13 -4
  14. data/helpers/v4/sorbet/config +11 -0
  15. data/helpers/v4/spec/bundler_endpoint_specification_metadata_patch_spec.rb +5 -1
  16. data/helpers/v4/spec/bundler_version_constraint_spec.rb +1 -1
  17. data/helpers/v4/spec/functions/conflicting_dependency_resolver_spec.rb +22 -1
  18. data/helpers/v4/spec/functions/dependency_source_spec.rb +17 -1
  19. data/helpers/v4/spec/functions/file_parser_spec.rb +9 -1
  20. data/helpers/v4/spec/functions/force_updater_spec.rb +2 -0
  21. data/helpers/v4/spec/functions/version_resolver_spec.rb +2 -0
  22. data/helpers/v4/spec/functions_spec.rb +9 -2
  23. data/helpers/v4/spec/native_spec_helper.rb +10 -2
  24. data/helpers/v4/spec/ruby_version_spec.rb +7 -1
  25. data/helpers/v4/spec/shared_contexts.rb +13 -4
  26. data/lib/dependabot/bundler/file_updater.rb +1 -1
  27. data/lib/dependabot/bundler/update_checker/force_updater.rb +6 -1
  28. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28c96cdd649d9342630193c5aee009a84f4c9adfda3613166bd8ac32a5cee4c6
4
- data.tar.gz: 93d19e9e411e1dfff646c21c2ff7dd6b2561e3fe84f6e3aa431e0418ec3e86bd
3
+ metadata.gz: 1d4d59f36a5bef1c42b25af43a030249168c8a86f0695f8350cd75718f86223f
4
+ data.tar.gz: b3697979fc1aa53bfccef8162bc45040ea838f710f869cab62b2667a853d091f
5
5
  SHA512:
6
- metadata.gz: '06439f586ee6183e2cab67a544e17534086d1d8d46f48e76302d8ec5c0514ee05070e010a3cacf56d7e506afb33b1556b3df495abf88e6a3474abeaee587fbff'
7
- data.tar.gz: fb7f82f7b7c78d4a6dd27ae1c225ca0f523c78b80e55a918828aa2fa298ac3136b7343f44834288b1ba75a9c892d1b80ff1345dc0c5253e13d29889725a21cbf
6
+ metadata.gz: 071d4be21188643986a1a92b84624654c57efa3d62fc5a9ac79425ab9e970446fda5c06bf20398adb737a984694c0081cd6a6afaec2c04e72be23f736a74e033
7
+ data.tar.gz: bf2587b03199968f6d1af777b912fb5981e7f9f4f8aee71f604a189cd1a7737c5aacf9c28ce5e64c1f4bcafb5b083d3e27e492d4ad70e6c194b3c9a61fab5bc3
@@ -0,0 +1,11 @@
1
+ # Run from bundler/helpers/v2 with the repository root Gemfile.
2
+ --dir=spec
3
+ --dir=../../../sorbet/rbi
4
+ --dir=../../../common/lib
5
+ lib/bundler_version_constraint.rb
6
+ --ignore=/fixtures/
7
+ --ignore=/tmp/
8
+ --disable-watchman
9
+ --enable-experimental-rspec
10
+ --enable-experimental-requires-ancestor
11
+ --suppress-payload-superclass-redefinition-for=RDoc::Markup::Heading
@@ -1,11 +1,15 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
 
6
6
  RSpec.describe BundlerEndpointSpecificationMetadataPatch do
7
+ extend T::Sig
8
+
9
+ sig { returns(Bundler::Fetcher) }
7
10
  let(:spec_fetcher) { instance_double(Bundler::Fetcher, uri: URI("https://example.com")) }
8
11
 
12
+ sig { params(metadata: T::Array[T::Array[T.anything]]).returns(Bundler::EndpointSpecification) }
9
13
  def build_spec(metadata)
10
14
  Bundler::EndpointSpecification.new("failbot", "2.0.1", "ruby", spec_fetcher, [], metadata)
11
15
  end
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
@@ -1,12 +1,16 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe Functions::ConflictingDependencyResolver do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
 
12
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
13
+ sig { returns(Functions::ConflictingDependencyResolver) } # rubocop:disable RSpec/DescribedClass -- Concrete type.
10
14
  let(:conflicting_dependency_resolver) do
11
15
  described_class.new(
12
16
  dependency_name: dependency_name,
@@ -15,12 +19,17 @@ RSpec.describe Functions::ConflictingDependencyResolver do
15
19
  )
16
20
  end
17
21
 
22
+ sig { returns(String) }
18
23
  let(:dependency_name) { "dummy-pkg-a" }
24
+ sig { returns(String) }
19
25
  let(:target_version) { "2.0.0" }
20
26
 
27
+ sig { returns(String) }
21
28
  let(:project_name) { "blocked_by_subdep" }
29
+ # rubocop:enable RSpec/ScatteredLet
22
30
 
23
31
  describe "#conflicting_dependencies" do
32
+ sig { returns(T::Array[T::Hash[String, String]]) }
24
33
  subject(:conflicting_dependencies) do
25
34
  in_tmp_folder { conflicting_dependency_resolver.conflicting_dependencies }
26
35
  end
@@ -37,9 +46,14 @@ RSpec.describe Functions::ConflictingDependencyResolver do
37
46
  end
38
47
 
39
48
  context "when dealing with nested transitive dependencies" do
49
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
50
+ sig { returns(String) }
40
51
  let(:project_name) { "transitive_blocking" }
52
+ sig { returns(String) }
41
53
  let(:dependency_name) { "activesupport" }
54
+ sig { returns(String) }
42
55
  let(:target_version) { "6.0.0" }
56
+ # rubocop:enable RSpec/ScatteredLet
43
57
 
44
58
  it "returns a list of dependencies that block the update" do
45
59
  expect(conflicting_dependencies).to contain_exactly(
@@ -90,10 +104,16 @@ RSpec.describe Functions::ConflictingDependencyResolver do
90
104
  end
91
105
 
92
106
  context "with multiple blocking dependencies" do
107
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
108
+ sig { returns(String) }
93
109
  let(:dependency_name) { "activesupport" }
110
+ sig { returns(String) }
94
111
  let(:current_version) { "5.0.0" }
112
+ sig { returns(String) }
95
113
  let(:target_version) { "6.0.0" }
114
+ sig { returns(String) }
96
115
  let(:project_name) { "multiple_blocking" }
116
+ # rubocop:enable RSpec/ScatteredLet
97
117
 
98
118
  it "returns all of the blocking dependencies" do
99
119
  expect(conflicting_dependencies).to contain_exactly(
@@ -120,6 +140,7 @@ RSpec.describe Functions::ConflictingDependencyResolver do
120
140
  end
121
141
 
122
142
  context "without any blocking dependencies" do
143
+ sig { returns(String) }
123
144
  let(:target_version) { "1.0.0" }
124
145
 
125
146
  it "returns an empty list" do
@@ -1,12 +1,16 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe Functions::DependencySource do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
 
12
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
13
+ sig { returns(Functions::DependencySource) } # rubocop:disable RSpec/DescribedClass -- Concrete type.
10
14
  let(:dependency_source) do
11
15
  described_class.new(
12
16
  gemfile_name: "Gemfile",
@@ -14,13 +18,18 @@ RSpec.describe Functions::DependencySource do
14
18
  )
15
19
  end
16
20
 
21
+ sig { returns(String) }
17
22
  let(:dependency_name) { "business" }
18
23
 
24
+ sig { returns(String) }
19
25
  let(:project_name) { "specified_source_no_lockfile" }
26
+ sig { returns(String) }
20
27
  let(:registry_url) { "https://repo.fury.io/greysteil/" }
28
+ sig { returns(String) }
21
29
  let(:gemfury_business_url) do
22
30
  "https://repo.fury.io/greysteil/api/v1/dependencies?gems=business"
23
31
  end
32
+ # rubocop:enable RSpec/ScatteredLet
24
33
 
25
34
  before do
26
35
  stub_request(:get, registry_url + "versions")
@@ -35,6 +44,7 @@ RSpec.describe Functions::DependencySource do
35
44
  end
36
45
 
37
46
  describe "#private_registry_versions" do
47
+ sig { returns(T::Array[Gem::Version]) }
38
48
  subject(:private_registry_versions) do
39
49
  in_tmp_folder { dependency_source.private_registry_versions }
40
50
  end
@@ -50,6 +60,7 @@ RSpec.describe Functions::DependencySource do
50
60
  end
51
61
 
52
62
  context "when specified as the default source" do
63
+ sig { returns(String) }
53
64
  let(:project_name) { "specified_default_source_no_lockfile" }
54
65
 
55
66
  it "returns all versions from the private source" do
@@ -158,9 +169,14 @@ RSpec.describe Functions::DependencySource do
158
169
  end
159
170
 
160
171
  context "when only the old Bundler index format is implemented" do
172
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
173
+ sig { returns(String) }
161
174
  let(:project_name) { "sidekiq_pro" }
175
+ sig { returns(String) }
162
176
  let(:dependency_name) { "sidekiq-pro" }
177
+ sig { returns(String) }
163
178
  let(:registry_url) { "https://gems.contribsys.com/" }
179
+ # rubocop:enable RSpec/ScatteredLet
164
180
 
165
181
  before do
166
182
  stub_request(:get, registry_url + "versions")
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
@@ -6,8 +6,11 @@ require "shared_contexts"
6
6
  require "json"
7
7
 
8
8
  RSpec.describe Functions::FileParser do
9
+ extend T::Sig
10
+
9
11
  include_context "when in a temporary bundler directory"
10
12
 
13
+ sig { returns(Functions::FileParser) } # rubocop:disable RSpec/DescribedClass -- Concrete type.
11
14
  let(:dependency_source) do
12
15
  described_class.new(
13
16
  lockfile_name: "Gemfile.lock"
@@ -15,12 +18,14 @@ RSpec.describe Functions::FileParser do
15
18
  end
16
19
 
17
20
  describe "#parsed_gemfile" do
21
+ sig { returns(T::Array[T::Hash[Symbol, T.anything]]) }
18
22
  subject(:parsed_gemfile) do
19
23
  in_tmp_folder do
20
24
  dependency_source.parsed_gemfile(gemfile_name: "Gemfile")
21
25
  end
22
26
  end
23
27
 
28
+ sig { returns(String) }
24
29
  let(:project_name) { "gemfile" }
25
30
 
26
31
  it "parses gemfile" do
@@ -44,6 +49,7 @@ RSpec.describe Functions::FileParser do
44
49
  end
45
50
 
46
51
  context "with a git source" do
52
+ sig { returns(String) }
47
53
  let(:project_name) { "git_source" }
48
54
 
49
55
  it "parses gemfile" do
@@ -110,12 +116,14 @@ RSpec.describe Functions::FileParser do
110
116
  end
111
117
 
112
118
  describe "#parsed_gemspec" do
119
+ sig { returns(T::Array[T::Hash[Symbol, T.anything]]) }
113
120
  subject(:parsed_gemspec) do
114
121
  in_tmp_folder do |_tmp_path|
115
122
  dependency_source.parsed_gemspec(gemspec_name: "example.gemspec")
116
123
  end
117
124
  end
118
125
 
126
+ sig { returns(String) }
119
127
  let(:project_name) { "gemfile_exact" }
120
128
 
121
129
  it "parses gemspec" do
@@ -1,6 +1,8 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
+ # Sorbet cannot resolve the child-context-only dependency_name and target_version fixtures.
5
+
4
6
  require "native_spec_helper"
5
7
  require "shared_contexts"
6
8
 
@@ -1,6 +1,8 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
+ # Sorbet cannot resolve the child-only requirement_string fixture or generated its examples.
5
+
4
6
  require "native_spec_helper"
5
7
  require "shared_contexts"
6
8
 
@@ -1,13 +1,16 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe Functions do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
 
10
12
  describe "#jfrog_source" do
13
+ sig { returns(String) }
11
14
  let(:project_name) { "jfrog_source" }
12
15
 
13
16
  it "returns the jfrog source" do
@@ -24,6 +27,7 @@ RSpec.describe Functions do
24
27
  end
25
28
 
26
29
  describe "#git_specs" do
30
+ sig { returns(T::Array[T::Hash[Symbol, String]]) }
27
31
  subject(:git_specs) do
28
32
  in_tmp_folder do
29
33
  described_class.git_specs(
@@ -34,12 +38,14 @@ RSpec.describe Functions do
34
38
  end
35
39
  end
36
40
 
41
+ sig { returns(String) }
37
42
  let(:project_name) { "git_source" }
38
43
 
44
+ sig { params(count: Integer).void }
39
45
  def expect_specs(count)
40
46
  expect(git_specs.size).to eq(count)
41
47
  git_specs.each do |gs|
42
- uri = URI.parse(gs[:auth_uri])
48
+ uri = URI.parse(gs.fetch(:auth_uri))
43
49
  expect(uri.scheme).to(satisfy { |s| s.match?(/https?/o) })
44
50
  end
45
51
  end
@@ -49,6 +55,7 @@ RSpec.describe Functions do
49
55
  end
50
56
 
51
57
  context "with github shorthand" do
58
+ sig { returns(String) }
52
59
  let(:project_name) { "github_source" }
53
60
 
54
61
  it "returns git specs" do
@@ -1,7 +1,9 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "sorbet-runtime"
4
5
  require "rspec/its"
6
+ require "rspec/sorbet"
5
7
  require "webmock/rspec"
6
8
  require "webmock/http_lib_adapters/excon_adapter"
7
9
  require "debug"
@@ -27,6 +29,8 @@ require "functions"
27
29
 
28
30
  require "gem_net_http_adapter"
29
31
 
32
+ extend T::Sig # rubocop:disable Style/MixinUsage
33
+
30
34
  RSpec.configure do |config|
31
35
  config.color = true
32
36
  config.order = :rand
@@ -34,6 +38,9 @@ RSpec.configure do |config|
34
38
  config.raise_errors_for_deprecations!
35
39
  end
36
40
 
41
+ RSpec::Sorbet.allow_doubles!
42
+
43
+ sig { params(project: String).returns(T::Array[T::Hash[Symbol, String]]) }
37
44
  def project_dependency_files(project)
38
45
  project_path = File.expand_path(File.join("../../spec/fixtures/projects/bundler2", project))
39
46
 
@@ -53,6 +60,7 @@ def project_dependency_files(project)
53
60
  end
54
61
  end
55
62
 
63
+ sig { params(name: String).returns(String) }
56
64
  def fixture(*name)
57
- File.read(File.join("../../spec/fixtures", File.join(*name)))
65
+ File.read(File.join("../../spec/fixtures", File.join(name)))
58
66
  end
@@ -1,15 +1,21 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe BundlerDefinitionRubyVersionPatch do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
  include_context "when stubbing rubygems compact index"
10
12
 
13
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
14
+ sig { returns(String) }
11
15
  let(:project_name) { "ruby_version_implied" }
16
+ sig { returns(T.any(Bundler::UI::Shell, Bundler::UI::Silent)) }
12
17
  let(:ui) { Bundler.ui }
18
+ # rubocop:enable RSpec/ScatteredLet
13
19
 
14
20
  before do
15
21
  Bundler.ui = Bundler::UI::Silent.new
@@ -1,15 +1,19 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "tmpdir"
5
5
  require "bundler/compact_index_client"
6
6
  require "bundler/compact_index_client/updater"
7
7
 
8
- TMP_DIR_PATH = File.expand_path("../tmp", __dir__)
8
+ TMP_DIR_PATH = T.let(File.expand_path("../tmp", __dir__), String)
9
9
 
10
10
  RSpec.shared_context "when in a temporary bundler directory" do
11
+ extend T::Sig
12
+
13
+ sig { returns(String) }
11
14
  let(:project_name) { "gemfile" }
12
15
 
16
+ sig { returns(Pathname) }
13
17
  let(:tmp_path) do
14
18
  FileUtils.mkdir_p(TMP_DIR_PATH)
15
19
  dir = Dir.mktmpdir("native_helper_spec_", TMP_DIR_PATH)
@@ -18,10 +22,15 @@ RSpec.shared_context "when in a temporary bundler directory" do
18
22
 
19
23
  before do
20
24
  project_dependency_files(project_name).each do |file|
21
- File.write(File.join(tmp_path, file[:name]), file[:content])
25
+ File.write(File.join(tmp_path, file.fetch(:name)), file.fetch(:content))
22
26
  end
23
27
  end
24
28
 
29
+ sig do
30
+ type_parameters(:Result)
31
+ .params(block: T.proc.params(directory: String).returns(T.type_parameter(:Result)))
32
+ .returns(T.type_parameter(:Result))
33
+ end
25
34
  def in_tmp_folder(&block)
26
35
  Dir.chdir(tmp_path, &block)
27
36
  end
@@ -40,7 +49,7 @@ RSpec.shared_context "when stubbing rubygems compact index" do
40
49
  fixtures =
41
50
  Dir[File.join("../../spec", "fixtures", "rubygems_responses", "info-*")]
42
51
  fixtures.each do |path|
43
- dep_name = path.split("/").last.gsub("info-", "")
52
+ dep_name = File.basename(path).gsub("info-", "")
44
53
  stub_request(:get, "https://index.rubygems.org/info/#{dep_name}")
45
54
  .to_return(
46
55
  status: 200,
@@ -0,0 +1,11 @@
1
+ # Run from bundler/helpers/v4 with the repository root Gemfile.
2
+ --dir=spec
3
+ --dir=../../../sorbet/rbi
4
+ --dir=../../../common/lib
5
+ lib/bundler_version_constraint.rb
6
+ --ignore=/fixtures/
7
+ --ignore=/tmp/
8
+ --disable-watchman
9
+ --enable-experimental-rspec
10
+ --enable-experimental-requires-ancestor
11
+ --suppress-payload-superclass-redefinition-for=RDoc::Markup::Heading
@@ -1,11 +1,15 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
 
6
6
  RSpec.describe BundlerEndpointSpecificationMetadataPatch do
7
+ extend T::Sig
8
+
9
+ sig { returns(Bundler::Fetcher) }
7
10
  let(:spec_fetcher) { instance_double(Bundler::Fetcher, uri: URI("https://example.com")) }
8
11
 
12
+ sig { params(metadata: T::Array[T::Array[T.anything]]).returns(Bundler::EndpointSpecification) }
9
13
  def build_spec(metadata)
10
14
  Bundler::EndpointSpecification.new("failbot", "2.0.1", "ruby", spec_fetcher, [], metadata)
11
15
  end
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
@@ -1,12 +1,16 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe Functions::ConflictingDependencyResolver do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
 
12
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
13
+ sig { returns(Functions::ConflictingDependencyResolver) } # rubocop:disable RSpec/DescribedClass -- Concrete type.
10
14
  let(:conflicting_dependency_resolver) do
11
15
  described_class.new(
12
16
  dependency_name: dependency_name,
@@ -15,12 +19,17 @@ RSpec.describe Functions::ConflictingDependencyResolver do
15
19
  )
16
20
  end
17
21
 
22
+ sig { returns(String) }
18
23
  let(:dependency_name) { "dummy-pkg-a" }
24
+ sig { returns(String) }
19
25
  let(:target_version) { "2.0.0" }
20
26
 
27
+ sig { returns(String) }
21
28
  let(:project_name) { "blocked_by_subdep" }
29
+ # rubocop:enable RSpec/ScatteredLet
22
30
 
23
31
  describe "#conflicting_dependencies" do
32
+ sig { returns(T::Array[T::Hash[String, String]]) }
24
33
  subject(:conflicting_dependencies) do
25
34
  in_tmp_folder { conflicting_dependency_resolver.conflicting_dependencies }
26
35
  end
@@ -37,9 +46,14 @@ RSpec.describe Functions::ConflictingDependencyResolver do
37
46
  end
38
47
 
39
48
  context "when dealing with nested transitive dependencies" do
49
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
50
+ sig { returns(String) }
40
51
  let(:project_name) { "transitive_blocking" }
52
+ sig { returns(String) }
41
53
  let(:dependency_name) { "activesupport" }
54
+ sig { returns(String) }
42
55
  let(:target_version) { "6.0.0" }
56
+ # rubocop:enable RSpec/ScatteredLet
43
57
 
44
58
  it "returns a list of dependencies that block the update" do
45
59
  expect(conflicting_dependencies).to contain_exactly(
@@ -90,10 +104,16 @@ RSpec.describe Functions::ConflictingDependencyResolver do
90
104
  end
91
105
 
92
106
  context "with multiple blocking dependencies" do
107
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
108
+ sig { returns(String) }
93
109
  let(:dependency_name) { "activesupport" }
110
+ sig { returns(String) }
94
111
  let(:current_version) { "5.0.0" }
112
+ sig { returns(String) }
95
113
  let(:target_version) { "6.0.0" }
114
+ sig { returns(String) }
96
115
  let(:project_name) { "multiple_blocking" }
116
+ # rubocop:enable RSpec/ScatteredLet
97
117
 
98
118
  it "returns all of the blocking dependencies" do
99
119
  expect(conflicting_dependencies).to contain_exactly(
@@ -120,6 +140,7 @@ RSpec.describe Functions::ConflictingDependencyResolver do
120
140
  end
121
141
 
122
142
  context "without any blocking dependencies" do
143
+ sig { returns(String) }
123
144
  let(:target_version) { "1.0.0" }
124
145
 
125
146
  it "returns an empty list" do
@@ -1,12 +1,16 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe Functions::DependencySource do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
 
12
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
13
+ sig { returns(Functions::DependencySource) } # rubocop:disable RSpec/DescribedClass -- Concrete type.
10
14
  let(:dependency_source) do
11
15
  described_class.new(
12
16
  gemfile_name: "Gemfile",
@@ -14,13 +18,18 @@ RSpec.describe Functions::DependencySource do
14
18
  )
15
19
  end
16
20
 
21
+ sig { returns(String) }
17
22
  let(:dependency_name) { "business" }
18
23
 
24
+ sig { returns(String) }
19
25
  let(:project_name) { "specified_source_no_lockfile" }
26
+ sig { returns(String) }
20
27
  let(:registry_url) { "https://repo.fury.io/greysteil/" }
28
+ sig { returns(String) }
21
29
  let(:gemfury_business_url) do
22
30
  "https://repo.fury.io/greysteil/api/v1/dependencies?gems=business"
23
31
  end
32
+ # rubocop:enable RSpec/ScatteredLet
24
33
 
25
34
  before do
26
35
  stub_request(:get, registry_url + "versions")
@@ -35,6 +44,7 @@ RSpec.describe Functions::DependencySource do
35
44
  end
36
45
 
37
46
  describe "#private_registry_versions" do
47
+ sig { returns(T::Array[Gem::Version]) }
38
48
  subject(:private_registry_versions) do
39
49
  in_tmp_folder { dependency_source.private_registry_versions }
40
50
  end
@@ -50,6 +60,7 @@ RSpec.describe Functions::DependencySource do
50
60
  end
51
61
 
52
62
  context "when specified as the default source" do
63
+ sig { returns(String) }
53
64
  let(:project_name) { "specified_default_source_no_lockfile" }
54
65
 
55
66
  it "returns all versions from the private source" do
@@ -158,9 +169,14 @@ RSpec.describe Functions::DependencySource do
158
169
  end
159
170
 
160
171
  context "when only the old Bundler index format is implemented" do
172
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
173
+ sig { returns(String) }
161
174
  let(:project_name) { "sidekiq_pro" }
175
+ sig { returns(String) }
162
176
  let(:dependency_name) { "sidekiq-pro" }
177
+ sig { returns(String) }
163
178
  let(:registry_url) { "https://gems.contribsys.com/" }
179
+ # rubocop:enable RSpec/ScatteredLet
164
180
 
165
181
  before do
166
182
  stub_request(:get, registry_url + "versions")
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
@@ -6,8 +6,11 @@ require "shared_contexts"
6
6
  require "json"
7
7
 
8
8
  RSpec.describe Functions::FileParser do
9
+ extend T::Sig
10
+
9
11
  include_context "when in a temporary bundler directory"
10
12
 
13
+ sig { returns(Functions::FileParser) } # rubocop:disable RSpec/DescribedClass -- Concrete type.
11
14
  let(:dependency_source) do
12
15
  described_class.new(
13
16
  lockfile_name: "Gemfile.lock"
@@ -15,12 +18,14 @@ RSpec.describe Functions::FileParser do
15
18
  end
16
19
 
17
20
  describe "#parsed_gemfile" do
21
+ sig { returns(T::Array[T::Hash[Symbol, T.anything]]) }
18
22
  subject(:parsed_gemfile) do
19
23
  in_tmp_folder do
20
24
  dependency_source.parsed_gemfile(gemfile_name: "Gemfile")
21
25
  end
22
26
  end
23
27
 
28
+ sig { returns(String) }
24
29
  let(:project_name) { "gemfile" }
25
30
 
26
31
  it "parses gemfile" do
@@ -44,6 +49,7 @@ RSpec.describe Functions::FileParser do
44
49
  end
45
50
 
46
51
  context "with a git source" do
52
+ sig { returns(String) }
47
53
  let(:project_name) { "git_source" }
48
54
 
49
55
  it "parses gemfile" do
@@ -110,12 +116,14 @@ RSpec.describe Functions::FileParser do
110
116
  end
111
117
 
112
118
  describe "#parsed_gemspec" do
119
+ sig { returns(T::Array[T::Hash[Symbol, T.anything]]) }
113
120
  subject(:parsed_gemspec) do
114
121
  in_tmp_folder do |_tmp_path|
115
122
  dependency_source.parsed_gemspec(gemspec_name: "example.gemspec")
116
123
  end
117
124
  end
118
125
 
126
+ sig { returns(String) }
119
127
  let(:project_name) { "gemfile_exact" }
120
128
 
121
129
  it "parses gemspec" do
@@ -1,6 +1,8 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
+ # Sorbet cannot resolve the child-context-only dependency_name and target_version fixtures.
5
+
4
6
  require "native_spec_helper"
5
7
  require "shared_contexts"
6
8
 
@@ -1,6 +1,8 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
+ # Sorbet cannot resolve the child-only requirement_string fixture or generated its examples.
5
+
4
6
  require "native_spec_helper"
5
7
  require "shared_contexts"
6
8
 
@@ -1,13 +1,16 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe Functions do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
 
10
12
  describe "#jfrog_source" do
13
+ sig { returns(String) }
11
14
  let(:project_name) { "jfrog_source" }
12
15
 
13
16
  it "returns the jfrog source" do
@@ -24,6 +27,7 @@ RSpec.describe Functions do
24
27
  end
25
28
 
26
29
  describe "#git_specs" do
30
+ sig { returns(T::Array[T::Hash[Symbol, String]]) }
27
31
  subject(:git_specs) do
28
32
  in_tmp_folder do
29
33
  described_class.git_specs(
@@ -34,12 +38,14 @@ RSpec.describe Functions do
34
38
  end
35
39
  end
36
40
 
41
+ sig { returns(String) }
37
42
  let(:project_name) { "git_source" }
38
43
 
44
+ sig { params(count: Integer).void }
39
45
  def expect_specs(count)
40
46
  expect(git_specs.size).to eq(count)
41
47
  git_specs.each do |gs|
42
- uri = URI.parse(gs[:auth_uri])
48
+ uri = URI.parse(gs.fetch(:auth_uri))
43
49
  expect(uri.scheme).to(satisfy { |s| s.match?(/https?/o) })
44
50
  end
45
51
  end
@@ -49,6 +55,7 @@ RSpec.describe Functions do
49
55
  end
50
56
 
51
57
  context "with github shorthand" do
58
+ sig { returns(String) }
52
59
  let(:project_name) { "github_source" }
53
60
 
54
61
  it "returns git specs" do
@@ -1,7 +1,9 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "sorbet-runtime"
4
5
  require "rspec/its"
6
+ require "rspec/sorbet"
5
7
  require "webmock/rspec"
6
8
  require "webmock/http_lib_adapters/excon_adapter"
7
9
  require "debug"
@@ -27,6 +29,8 @@ require "functions"
27
29
 
28
30
  require "gem_net_http_adapter"
29
31
 
32
+ extend T::Sig # rubocop:disable Style/MixinUsage
33
+
30
34
  RSpec.configure do |config|
31
35
  config.color = true
32
36
  config.order = :rand
@@ -34,6 +38,9 @@ RSpec.configure do |config|
34
38
  config.raise_errors_for_deprecations!
35
39
  end
36
40
 
41
+ RSpec::Sorbet.allow_doubles!
42
+
43
+ sig { params(project: String).returns(T::Array[T::Hash[Symbol, String]]) }
37
44
  def project_dependency_files(project)
38
45
  project_path = File.expand_path(File.join("../../spec/fixtures/projects/bundler2", project))
39
46
 
@@ -53,6 +60,7 @@ def project_dependency_files(project)
53
60
  end
54
61
  end
55
62
 
63
+ sig { params(name: String).returns(String) }
56
64
  def fixture(*name)
57
- File.read(File.join("../../spec/fixtures", File.join(*name)))
65
+ File.read(File.join("../../spec/fixtures", File.join(name)))
58
66
  end
@@ -1,15 +1,21 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "native_spec_helper"
5
5
  require "shared_contexts"
6
6
 
7
7
  RSpec.describe BundlerDefinitionRubyVersionPatch do
8
+ extend T::Sig
9
+
8
10
  include_context "when in a temporary bundler directory"
9
11
  include_context "when stubbing rubygems compact index"
10
12
 
13
+ # rubocop:disable RSpec/ScatteredLet -- Grouping lets would detach their required Sorbet signatures.
14
+ sig { returns(String) }
11
15
  let(:project_name) { "ruby_version_implied" }
16
+ sig { returns(T.any(Bundler::UI::Shell, Bundler::UI::Silent)) }
12
17
  let(:ui) { Bundler.ui }
18
+ # rubocop:enable RSpec/ScatteredLet
13
19
 
14
20
  before do
15
21
  Bundler.ui = Bundler::UI::Silent.new
@@ -1,15 +1,19 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "tmpdir"
5
5
  require "bundler/compact_index_client"
6
6
  require "bundler/compact_index_client/updater"
7
7
 
8
- TMP_DIR_PATH = File.expand_path("../tmp", __dir__)
8
+ TMP_DIR_PATH = T.let(File.expand_path("../tmp", __dir__), String)
9
9
 
10
10
  RSpec.shared_context "when in a temporary bundler directory" do
11
+ extend T::Sig
12
+
13
+ sig { returns(String) }
11
14
  let(:project_name) { "gemfile" }
12
15
 
16
+ sig { returns(Pathname) }
13
17
  let(:tmp_path) do
14
18
  FileUtils.mkdir_p(TMP_DIR_PATH)
15
19
  dir = Dir.mktmpdir("native_helper_spec_", TMP_DIR_PATH)
@@ -18,10 +22,15 @@ RSpec.shared_context "when in a temporary bundler directory" do
18
22
 
19
23
  before do
20
24
  project_dependency_files(project_name).each do |file|
21
- File.write(File.join(tmp_path, file[:name]), file[:content])
25
+ File.write(File.join(tmp_path, file.fetch(:name)), file.fetch(:content))
22
26
  end
23
27
  end
24
28
 
29
+ sig do
30
+ type_parameters(:Result)
31
+ .params(block: T.proc.params(directory: String).returns(T.type_parameter(:Result)))
32
+ .returns(T.type_parameter(:Result))
33
+ end
25
34
  def in_tmp_folder(&block)
26
35
  Dir.chdir(tmp_path, &block)
27
36
  end
@@ -40,7 +49,7 @@ RSpec.shared_context "when stubbing rubygems compact index" do
40
49
  fixtures =
41
50
  Dir[File.join("../../spec", "fixtures", "rubygems_responses", "info-*")]
42
51
  fixtures.each do |path|
43
- dep_name = path.split("/").last.gsub("info-", "")
52
+ dep_name = File.basename(path).gsub("info-", "")
44
53
  stub_request(:get, "https://index.rubygems.org/info/#{dep_name}")
45
54
  .to_return(
46
55
  status: 200,
@@ -107,7 +107,7 @@ module Dependabot
107
107
  def check_updated_files(updated_files)
108
108
  return if updated_files.reject { |f| dependency_files.include?(f) }.any?
109
109
 
110
- raise "No files have changed!"
110
+ raise no_files_changed_error("No files have changed!", { updated_files: updated_files.map(&:name) })
111
111
  end
112
112
 
113
113
  sig { returns(T.nilable(Dependabot::DependencyFile)) }
@@ -167,9 +167,14 @@ module Dependabot
167
167
  updated_deps.filter_map do |dep|
168
168
  original_dep =
169
169
  original_dependencies.find { |d| d.name == dep.fetch("name") }
170
+ # Bundler also reports top-level gems that the file parser skips, such as
171
+ # path gems and gems only used on other platforms. Dependabot does not
172
+ # update those, so leave them out.
173
+ next unless original_dep
174
+
170
175
  spec = specs.find { |d| d.fetch("name") == dep.fetch("name") }
171
176
 
172
- next if T.must(spec).fetch("version") == T.must(original_dep).version
177
+ next if T.must(spec).fetch("version") == original_dep.version
173
178
 
174
179
  build_dependency(original_dep, spec)
175
180
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.403.0
4
+ version: 0.405.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.403.0
18
+ version: 0.405.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.403.0
25
+ version: 0.405.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: parallel
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -278,6 +278,7 @@ files:
278
278
  - helpers/v2/monkey_patches/endpoint_specification_metadata_patch.rb
279
279
  - helpers/v2/monkey_patches/git_source_patch.rb
280
280
  - helpers/v2/run.rb
281
+ - helpers/v2/sorbet/config
281
282
  - helpers/v2/spec/bundler_endpoint_specification_metadata_patch_spec.rb
282
283
  - helpers/v2/spec/bundler_version_constraint_spec.rb
283
284
  - helpers/v2/spec/functions/conflicting_dependency_resolver_spec.rb
@@ -305,6 +306,7 @@ files:
305
306
  - helpers/v4/monkey_patches/endpoint_specification_metadata_patch.rb
306
307
  - helpers/v4/monkey_patches/git_source_patch.rb
307
308
  - helpers/v4/run.rb
309
+ - helpers/v4/sorbet/config
308
310
  - helpers/v4/spec/bundler_endpoint_specification_metadata_patch_spec.rb
309
311
  - helpers/v4/spec/bundler_version_constraint_spec.rb
310
312
  - helpers/v4/spec/functions/conflicting_dependency_resolver_spec.rb
@@ -363,7 +365,7 @@ licenses:
363
365
  - MIT
364
366
  metadata:
365
367
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
366
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.403.0
368
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.405.0
367
369
  rdoc_options: []
368
370
  require_paths:
369
371
  - lib