dependabot-pub 0.191.1 → 0.192.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/lib/dependabot/pub/helpers.rb +111 -9
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f15dc7a1209e1297ec70c3d83305d985dc388a4aba078e7c5a384bab68058503
|
|
4
|
+
data.tar.gz: 0a1f1919d76cbd00ee898f6782754fa1df920be90ab580bacdf26e6626a9429b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a2b713c6d4677285406fb343a8712174f118763d9dc1826cbb6a07cb8d0bff7198e32d42010b60c1d2422d6105c3d89eb5b1afaa761b7711d4e1397dfaea02f
|
|
7
|
+
data.tar.gz: 79b4e6a383504a13cfe88c0ae3cc5f9c001957588edc3b1bf48ad11c34ba867ddd458bc4e26a0ab5744488c316ffce09fd0d6bcd31fc34bb2fde42f86b38ea27
|
|
@@ -11,6 +11,21 @@ require "dependabot/pub/requirement"
|
|
|
11
11
|
module Dependabot
|
|
12
12
|
module Pub
|
|
13
13
|
module Helpers
|
|
14
|
+
def self.pub_helpers_path
|
|
15
|
+
File.join(ENV["DEPENDABOT_NATIVE_HELPERS_PATH"], "pub")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.run_infer_sdk_versions(url: nil)
|
|
19
|
+
stdout, _, status = Open3.capture3(
|
|
20
|
+
{},
|
|
21
|
+
File.join(pub_helpers_path, "infer_sdk_versions"),
|
|
22
|
+
*("--flutter-releases-url=#{url}" if url)
|
|
23
|
+
)
|
|
24
|
+
return nil unless status.success?
|
|
25
|
+
|
|
26
|
+
JSON.parse(stdout)
|
|
27
|
+
end
|
|
28
|
+
|
|
14
29
|
private
|
|
15
30
|
|
|
16
31
|
def dependency_services_list
|
|
@@ -42,6 +57,94 @@ module Dependabot
|
|
|
42
57
|
end
|
|
43
58
|
end
|
|
44
59
|
|
|
60
|
+
# Clones the flutter repo into /tmp/flutter if needed
|
|
61
|
+
def ensure_flutter_repo
|
|
62
|
+
return if File.directory?("/tmp/flutter/.git")
|
|
63
|
+
|
|
64
|
+
# Make a flutter checkout
|
|
65
|
+
_, stderr, status = Open3.capture3(
|
|
66
|
+
{},
|
|
67
|
+
"git",
|
|
68
|
+
"clone",
|
|
69
|
+
"--no-checkout",
|
|
70
|
+
"https://github.com/flutter/flutter",
|
|
71
|
+
chdir: "/tmp/"
|
|
72
|
+
)
|
|
73
|
+
raise Dependabot::DependabotError, "Cloning Flutter failed: #{stderr}" unless status.success?
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Will ensure that /tmp/flutter contains the flutter repo checked out at `ref`.
|
|
77
|
+
def check_out_flutter_ref(ref)
|
|
78
|
+
ensure_flutter_repo
|
|
79
|
+
# Ensure we have the right version (by tag)
|
|
80
|
+
_, stderr, status = Open3.capture3(
|
|
81
|
+
{},
|
|
82
|
+
"git",
|
|
83
|
+
"fetch",
|
|
84
|
+
"origin",
|
|
85
|
+
ref,
|
|
86
|
+
chdir: "/tmp/flutter"
|
|
87
|
+
)
|
|
88
|
+
raise Dependabot::DependabotError, "Fetching Flutter version #{ref} failed: #{stderr}" unless status.success?
|
|
89
|
+
|
|
90
|
+
# Check out the right version in git.
|
|
91
|
+
_, stderr, status = Open3.capture3(
|
|
92
|
+
{},
|
|
93
|
+
"git",
|
|
94
|
+
"checkout",
|
|
95
|
+
ref,
|
|
96
|
+
chdir: "/tmp/flutter"
|
|
97
|
+
)
|
|
98
|
+
return if status.success?
|
|
99
|
+
|
|
100
|
+
raise Dependabot::DependabotError, "Checking out flutter #{ref} failed: #{stderr}"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
## Detects the right flutter release to use for the pubspec.yaml.
|
|
104
|
+
## Then checks it out if it is not already.
|
|
105
|
+
## Returns the sdk versions
|
|
106
|
+
def ensure_right_flutter_release
|
|
107
|
+
@ensure_right_flutter_release ||= begin
|
|
108
|
+
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
|
|
115
|
+
|
|
116
|
+
check_out_flutter_ref flutter_ref
|
|
117
|
+
|
|
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?
|
|
126
|
+
|
|
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
|
|
139
|
+
|
|
140
|
+
parsed = JSON.parse(stdout)
|
|
141
|
+
{
|
|
142
|
+
"flutter" => parsed["frameworkVersion"],
|
|
143
|
+
"dart" => parsed["dartSdkVersion"]
|
|
144
|
+
}
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
45
148
|
def run_dependency_services(command, stdin_data: nil)
|
|
46
149
|
SharedHelpers.in_a_temporary_directory do
|
|
47
150
|
dependency_files.each do |f|
|
|
@@ -49,26 +152,25 @@ module Dependabot
|
|
|
49
152
|
FileUtils.mkdir_p File.dirname(in_path_name)
|
|
50
153
|
File.write(in_path_name, f.content)
|
|
51
154
|
end
|
|
155
|
+
sdk_versions = ensure_right_flutter_release
|
|
52
156
|
SharedHelpers.with_git_configured(credentials: credentials) do
|
|
53
157
|
env = {
|
|
54
158
|
"CI" => "true",
|
|
55
159
|
"PUB_ENVIRONMENT" => "dependabot",
|
|
56
|
-
"FLUTTER_ROOT" => "/
|
|
57
|
-
"PUB_HOSTED_URL" => options[:pub_hosted_url]
|
|
160
|
+
"FLUTTER_ROOT" => "/tmp/flutter",
|
|
161
|
+
"PUB_HOSTED_URL" => options[:pub_hosted_url],
|
|
162
|
+
# This variable will make the solver run assuming that Dart SDK version.
|
|
163
|
+
# TODO(sigurdm): Would be nice to have a better handle for fixing the dart sdk version.
|
|
164
|
+
"_PUB_TEST_SDK_VERSION" => sdk_versions["dart"]
|
|
58
165
|
}
|
|
59
166
|
Dir.chdir File.join(Dir.pwd, dependency_files.first.directory) do
|
|
60
167
|
stdout, stderr, status = Open3.capture3(
|
|
61
168
|
env.compact,
|
|
62
|
-
"
|
|
63
|
-
"--no-analytics",
|
|
64
|
-
"pub",
|
|
65
|
-
"global",
|
|
66
|
-
"run",
|
|
67
|
-
"pub:dependency_services",
|
|
169
|
+
File.join(Helpers.pub_helpers_path, "dependency_services"),
|
|
68
170
|
command,
|
|
69
171
|
stdin_data: stdin_data
|
|
70
172
|
)
|
|
71
|
-
raise Dependabot::DependabotError, "
|
|
173
|
+
raise Dependabot::DependabotError, "dependency_services failed: #{stderr}" unless status.success?
|
|
72
174
|
return stdout unless block_given?
|
|
73
175
|
|
|
74
176
|
yield
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-pub
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.192.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.
|
|
19
|
+
version: 0.192.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.192.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: debase
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|