dependabot-pub 0.211.0 → 0.213.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/pub/helpers.rb +63 -33
- data/lib/dependabot/pub/requirement.rb +4 -4
- data/lib/dependabot/pub/version.rb +1 -1
- metadata +19 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae1319638c70bd17c82c7349b142a5e9047f002ca604fd5313107dc6d177801a
|
4
|
+
data.tar.gz: 1ca50d4cbd430e77fe396ac66a78d3d4f2c39b01aaaf725e64a5bda701898d30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15352fd4cb4558b9828c34b1f183ecc77a9e18c2e2249f34b86584cca9c2b6c3dadf07bbc94c26849dd5e561bcb4917d329c5825e9a62a993828856c7f3c607d
|
7
|
+
data.tar.gz: 7f646b209b0031d4c5e9e56afa716ff1877e7d1143c22e4a2866e366d1d1d320fa2672675f82d956640d4c9cabd2e615df4477cedf1689a7fbc0af30649a47b3
|
@@ -5,6 +5,7 @@ require "open3"
|
|
5
5
|
require "digest"
|
6
6
|
|
7
7
|
require "dependabot/errors"
|
8
|
+
require "dependabot/logger"
|
8
9
|
require "dependabot/shared_helpers"
|
9
10
|
require "dependabot/pub/requirement"
|
10
11
|
|
@@ -12,7 +13,7 @@ module Dependabot
|
|
12
13
|
module Pub
|
13
14
|
module Helpers
|
14
15
|
def self.pub_helpers_path
|
15
|
-
File.join(ENV
|
16
|
+
File.join(ENV.fetch("DEPENDABOT_NATIVE_HELPERS_PATH", nil), "pub")
|
16
17
|
end
|
17
18
|
|
18
19
|
def self.run_infer_sdk_versions(url: nil)
|
@@ -35,7 +36,7 @@ module Dependabot
|
|
35
36
|
def dependency_services_report
|
36
37
|
sha256 = Digest::SHA256.new
|
37
38
|
dependency_files.each do |f|
|
38
|
-
sha256 << f.path + "\n" + f.content + "\n"
|
39
|
+
sha256 << (f.path + "\n" + f.content + "\n")
|
39
40
|
end
|
40
41
|
hash = sha256.hexdigest
|
41
42
|
|
@@ -61,6 +62,7 @@ module Dependabot
|
|
61
62
|
def ensure_flutter_repo
|
62
63
|
return if File.directory?("/tmp/flutter/.git")
|
63
64
|
|
65
|
+
Dependabot.logger.info "Cloning the flutter repo https://github.com/flutter/flutter."
|
64
66
|
# Make a flutter checkout
|
65
67
|
_, stderr, status = Open3.capture3(
|
66
68
|
{},
|
@@ -76,6 +78,7 @@ module Dependabot
|
|
76
78
|
# Will ensure that /tmp/flutter contains the flutter repo checked out at `ref`.
|
77
79
|
def check_out_flutter_ref(ref)
|
78
80
|
ensure_flutter_repo
|
81
|
+
Dependabot.logger.info "Checking out Flutter version #{ref}"
|
79
82
|
# Ensure we have the right version (by tag)
|
80
83
|
_, stderr, status = Open3.capture3(
|
81
84
|
{},
|
@@ -106,43 +109,70 @@ module Dependabot
|
|
106
109
|
def ensure_right_flutter_release
|
107
110
|
@ensure_right_flutter_release ||= begin
|
108
111
|
versions = Helpers.run_infer_sdk_versions url: options[:flutter_releases_url]
|
109
|
-
flutter_ref =
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
flutter_ref =
|
113
|
+
if versions
|
114
|
+
Dependabot.logger.info(
|
115
|
+
"Installing the Flutter SDK version: #{versions['flutter']} " \
|
116
|
+
"from channel #{versions['channel']} with Dart #{versions['dart']}"
|
117
|
+
)
|
118
|
+
"refs/tags/#{versions['flutter']}"
|
119
|
+
else
|
120
|
+
Dependabot.logger.info(
|
121
|
+
"Failed to infer the flutter version. Attempting to use latest stable release."
|
122
|
+
)
|
123
|
+
# Choose the 'stable' version if the tool failed to infer a version.
|
124
|
+
"stable"
|
125
|
+
end
|
115
126
|
|
116
127
|
check_out_flutter_ref flutter_ref
|
128
|
+
run_flutter_doctor
|
129
|
+
run_flutter_version
|
130
|
+
end
|
131
|
+
end
|
117
132
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
133
|
+
def run_flutter_doctor
|
134
|
+
Dependabot.logger.info(
|
135
|
+
"Running `flutter doctor` to install artifacts and create flutter/version."
|
136
|
+
)
|
137
|
+
_, stderr, status = Open3.capture3(
|
138
|
+
{},
|
139
|
+
"/tmp/flutter/bin/flutter",
|
140
|
+
"doctor",
|
141
|
+
chdir: "/tmp/flutter/"
|
142
|
+
)
|
143
|
+
raise Dependabot::DependabotError, "Running 'flutter doctor' failed: #{stderr}" unless status.success?
|
144
|
+
end
|
126
145
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
146
|
+
# Runs `flutter version` and returns the dart and flutter version numbers in a map.
|
147
|
+
def run_flutter_version
|
148
|
+
Dependabot.logger.info "Running `flutter --version`"
|
149
|
+
# Run `flutter --version --machine` to get the current flutter version.
|
150
|
+
stdout, stderr, status = Open3.capture3(
|
151
|
+
{},
|
152
|
+
"/tmp/flutter/bin/flutter",
|
153
|
+
"--version",
|
154
|
+
"--machine",
|
155
|
+
chdir: "/tmp/flutter/"
|
156
|
+
)
|
157
|
+
unless status.success?
|
158
|
+
raise Dependabot::DependabotError,
|
159
|
+
"Running 'flutter --version --machine' failed: #{stderr}"
|
160
|
+
end
|
139
161
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
162
|
+
parsed = JSON.parse(stdout)
|
163
|
+
flutter_version = parsed["frameworkVersion"]
|
164
|
+
dart_version = parsed["dartSdkVersion"]&.split&.first
|
165
|
+
unless flutter_version && dart_version
|
166
|
+
raise Dependabot::DependabotError,
|
167
|
+
"Bad output from `flutter --version`: #{stdout}"
|
145
168
|
end
|
169
|
+
Dependabot.logger.info(
|
170
|
+
"Installed the Flutter SDK version: #{flutter_version} with Dart #{dart_version}."
|
171
|
+
)
|
172
|
+
{
|
173
|
+
"flutter" => flutter_version,
|
174
|
+
"dart" => dart_version
|
175
|
+
}
|
146
176
|
end
|
147
177
|
|
148
178
|
def run_dependency_services(command, stdin_data: nil)
|
@@ -14,8 +14,8 @@ module Dependabot
|
|
14
14
|
quoted = OPS.keys.map { |k| Regexp.quote(k) }.join("|")
|
15
15
|
version_pattern = Pub::Version::VERSION_PATTERN
|
16
16
|
|
17
|
-
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{version_pattern})\\s*"
|
18
|
-
PATTERN = /\A#{PATTERN_RAW}\z
|
17
|
+
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{version_pattern})\\s*".freeze
|
18
|
+
PATTERN = /\A#{PATTERN_RAW}\z/
|
19
19
|
|
20
20
|
# Use Pub::Version rather than Gem::Version to ensure that
|
21
21
|
# pre-release versions aren't transformed.
|
@@ -32,7 +32,7 @@ module Dependabot
|
|
32
32
|
[matches[1] || "=", Pub::Version.new(matches[2])]
|
33
33
|
end
|
34
34
|
|
35
|
-
# For consistency with other
|
35
|
+
# For consistency with other languages, we define a requirements array.
|
36
36
|
# Dart doesn't have an `OR` separator for requirements, so it always
|
37
37
|
# contains a single element.
|
38
38
|
def self.requirements_array(requirement_string)
|
@@ -78,7 +78,7 @@ module Dependabot
|
|
78
78
|
|
79
79
|
def convert_range_req(req_string)
|
80
80
|
req_string.scan(
|
81
|
-
/((?:>|<|=|<=|>=)\s*#{Pub::Version::VERSION_PATTERN})\s*/
|
81
|
+
/((?:>|<|=|<=|>=)\s*#{Pub::Version::VERSION_PATTERN})\s*/o
|
82
82
|
).map { |x| x[0].strip }
|
83
83
|
end
|
84
84
|
|
@@ -17,7 +17,7 @@ module Dependabot
|
|
17
17
|
module Pub
|
18
18
|
class Version < Gem::Version
|
19
19
|
VERSION_PATTERN = Gem::Version::VERSION_PATTERN + "(\\+[0-9a-zA-Z\\-.]+)?"
|
20
|
-
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z
|
20
|
+
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/
|
21
21
|
|
22
22
|
attr_reader :build_info
|
23
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-pub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.213.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,42 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.213.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.213.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: webrick
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.2.3
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.2.3
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: debase-ruby_core_source
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
33
|
+
version: '1.7'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- -
|
38
|
+
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
40
|
+
version: '1.7'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: debug
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +72,14 @@ dependencies:
|
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.
|
75
|
+
version: 3.13.0
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.
|
82
|
+
version: 3.13.0
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rake
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,28 +128,28 @@ dependencies:
|
|
142
128
|
requirements:
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
131
|
+
version: 1.37.1
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
138
|
+
version: 1.37.1
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
140
|
+
name: rubocop-performance
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
156
142
|
requirements:
|
157
143
|
- - "~>"
|
158
144
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
145
|
+
version: 1.15.0
|
160
146
|
type: :development
|
161
147
|
prerelease: false
|
162
148
|
version_requirements: !ruby/object:Gem::Requirement
|
163
149
|
requirements:
|
164
150
|
- - "~>"
|
165
151
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
152
|
+
version: 1.15.0
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: simplecov
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,14 +248,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
248
|
requirements:
|
263
249
|
- - ">="
|
264
250
|
- !ruby/object:Gem::Version
|
265
|
-
version:
|
251
|
+
version: 3.1.0
|
266
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
253
|
requirements:
|
268
254
|
- - ">="
|
269
255
|
- !ruby/object:Gem::Version
|
270
|
-
version:
|
256
|
+
version: 3.1.0
|
271
257
|
requirements: []
|
272
|
-
rubygems_version: 3.
|
258
|
+
rubygems_version: 3.3.7
|
273
259
|
signing_key:
|
274
260
|
specification_version: 4
|
275
261
|
summary: Dart (pub) support for dependabot
|