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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a982693e5e8916b1432adf5d8d37621cb645ca5c2a04b4fe82f68137ec7c286
4
- data.tar.gz: 4b052daf1c0d4256b49e7b79a31235ff7e32157a2d4ac718f4ec9414fff8149e
3
+ metadata.gz: ae1319638c70bd17c82c7349b142a5e9047f002ca604fd5313107dc6d177801a
4
+ data.tar.gz: 1ca50d4cbd430e77fe396ac66a78d3d4f2c39b01aaaf725e64a5bda701898d30
5
5
  SHA512:
6
- metadata.gz: e4dd8b081534cb1415f75db9f5ac43b0cd4916e40eb57e9946b7fbc778c54a28d0200d04c804af382f93049ee0bd79b5d9f4950dfa5a6bf0630968d9482a5b66
7
- data.tar.gz: ce8df6bbbfbb706a472dfea47f26b47644eaf1616ca9b21b7b70f67417497d65b5ce836c7b012aed3f79fc8bdd783122a80aa276049a1a320262c9662f1f7a60
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["DEPENDABOT_NATIVE_HELPERS_PATH"], "pub")
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 = if versions
110
- "refs/tags/#{versions['flutter']}"
111
- else
112
- # Choose the 'stable' version if the tool failed to infer a version.
113
- "stable"
114
- end
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
- # Run `flutter --version` to make Flutter download engine artifacts and create flutter/version.
119
- _, stderr, status = Open3.capture3(
120
- {},
121
- "/tmp/flutter/bin/flutter",
122
- "doctor",
123
- chdir: "/tmp/flutter/"
124
- )
125
- raise Dependabot::DependabotError, "Running 'flutter doctor' failed: #{stderr}" unless status.success?
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
- # Run `flutter --version --machine` to get the current flutter version.
128
- stdout, stderr, status = Open3.capture3(
129
- {},
130
- "/tmp/flutter/bin/flutter",
131
- "--version",
132
- "--machine",
133
- chdir: "/tmp/flutter/"
134
- )
135
- unless status.success?
136
- raise Dependabot::DependabotError,
137
- "Running 'flutter --version --machine' failed: #{stderr}"
138
- end
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
- parsed = JSON.parse(stdout)
141
- {
142
- "flutter" => parsed["frameworkVersion"],
143
- "dart" => parsed["dartSdkVersion"].split.first
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/.freeze
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 langauges, we define a requirements array.
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/.freeze
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.211.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-08-23 00:00:00.000000000 Z
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.211.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.211.0
26
+ version: 0.213.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: debase
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: 0.10.16
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: 0.10.16
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.11.1
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.11.1
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.35.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.35.1
138
+ version: 1.37.1
153
139
  - !ruby/object:Gem::Dependency
154
- name: ruby-debug-ide
140
+ name: rubocop-performance
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - "~>"
158
144
  - !ruby/object:Gem::Version
159
- version: 0.7.3
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: 0.7.3
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: 2.7.0
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: 2.7.0
256
+ version: 3.1.0
271
257
  requirements: []
272
- rubygems_version: 3.1.6
258
+ rubygems_version: 3.3.7
273
259
  signing_key:
274
260
  specification_version: 4
275
261
  summary: Dart (pub) support for dependabot