dependabot-bundler 0.402.0 → 0.404.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.
- checksums.yaml +4 -4
- data/helpers/v2/sorbet/config +11 -0
- data/helpers/v2/spec/bundler_endpoint_specification_metadata_patch_spec.rb +5 -1
- data/helpers/v2/spec/bundler_version_constraint_spec.rb +1 -1
- data/helpers/v2/spec/functions/conflicting_dependency_resolver_spec.rb +22 -1
- data/helpers/v2/spec/functions/dependency_source_spec.rb +17 -1
- data/helpers/v2/spec/functions/file_parser_spec.rb +9 -1
- data/helpers/v2/spec/functions/force_updater_spec.rb +2 -0
- data/helpers/v2/spec/functions/version_resolver_spec.rb +2 -0
- data/helpers/v2/spec/functions_spec.rb +9 -2
- data/helpers/v2/spec/native_spec_helper.rb +10 -2
- data/helpers/v2/spec/ruby_version_spec.rb +7 -1
- data/helpers/v2/spec/shared_contexts.rb +13 -4
- data/helpers/v4/sorbet/config +11 -0
- data/helpers/v4/spec/bundler_endpoint_specification_metadata_patch_spec.rb +5 -1
- data/helpers/v4/spec/bundler_version_constraint_spec.rb +1 -1
- data/helpers/v4/spec/functions/conflicting_dependency_resolver_spec.rb +22 -1
- data/helpers/v4/spec/functions/dependency_source_spec.rb +17 -1
- data/helpers/v4/spec/functions/file_parser_spec.rb +9 -1
- data/helpers/v4/spec/functions/force_updater_spec.rb +2 -0
- data/helpers/v4/spec/functions/version_resolver_spec.rb +2 -0
- data/helpers/v4/spec/functions_spec.rb +9 -2
- data/helpers/v4/spec/native_spec_helper.rb +10 -2
- data/helpers/v4/spec/ruby_version_spec.rb +7 -1
- data/helpers/v4/spec/shared_contexts.rb +13 -4
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74bb023878fca92a71647b41b25abe369287dbec10a93a12b634ee5efa322d7d
|
|
4
|
+
data.tar.gz: e5198f710f4a759c09c1906c8dadd243919658eb1607f55fe814779ffa6bff4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9516b3b9d9519364b4efcb8dc947d93c61575b0ca64b6fade90576a988013e38e7ae80ccfff16c03d5c60d63f5e818a397bc3bc4793b544aec22ab509f301c4
|
|
7
|
+
data.tar.gz: 416e8850870bad849c7a28e8d924272bbe8515193004841a353c46f427e2585d1a84526165dc4b87ad23100f9fb5f051901a8845351e4afcb00737e2324e5f03
|
|
@@ -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:
|
|
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,12 +1,16 @@
|
|
|
1
|
-
# typed:
|
|
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:
|
|
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:
|
|
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,13 +1,16 @@
|
|
|
1
|
-
# typed:
|
|
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
|
|
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:
|
|
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(
|
|
65
|
+
File.read(File.join("../../spec/fixtures", File.join(name)))
|
|
58
66
|
end
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
# typed:
|
|
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:
|
|
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
|
|
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 =
|
|
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:
|
|
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,12 +1,16 @@
|
|
|
1
|
-
# typed:
|
|
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:
|
|
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:
|
|
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,13 +1,16 @@
|
|
|
1
|
-
# typed:
|
|
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
|
|
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:
|
|
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(
|
|
65
|
+
File.read(File.join("../../spec/fixtures", File.join(name)))
|
|
58
66
|
end
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
# typed:
|
|
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:
|
|
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
|
|
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 =
|
|
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,
|
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.
|
|
4
|
+
version: 0.404.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.
|
|
18
|
+
version: 0.404.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.
|
|
25
|
+
version: 0.404.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.
|
|
368
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.404.0
|
|
367
369
|
rdoc_options: []
|
|
368
370
|
require_paths:
|
|
369
371
|
- lib
|