dependabot-go_modules 0.127.1 → 0.129.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66a84b6b47ca0b0c2123cbb74dc9289edf5a3456e47e243b9f5f7e3e811a6e83
|
4
|
+
data.tar.gz: c818cafc810e2d768e1048c30b9c28b06b2f74d0c15fe4fecb38ccc3341b4746
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fafe82fab2b405593f8a7c8a431ff71804189922a9f7d3d920ee6b4295417294e904c4b123fb4f3cdea32e8044ad69f5a130e342418f36d0e819e934be1980b
|
7
|
+
data.tar.gz: 1456d1903e1b9b1b832de978aad3f2ba579d9dc30ef5179f97ef3d9f62963c01e8586967729e44e1da015166fa7e96ba4496d76309311ff79d3414d8b42726fc
|
@@ -159,8 +159,8 @@ module Dependabot
|
|
159
159
|
|
160
160
|
GITHUB_REPO_REGEX = %r{github.com/[^@]*}.freeze
|
161
161
|
def handle_github_unknown_revision(line)
|
162
|
-
|
163
|
-
return unless
|
162
|
+
mod_path = line.scan(GITHUB_REPO_REGEX).first
|
163
|
+
return unless mod_path
|
164
164
|
|
165
165
|
# Query for _any_ version of this module, to know if it doesn't exist (or is private)
|
166
166
|
# or we were just given a bad revision by this manifest
|
@@ -169,9 +169,15 @@ module Dependabot
|
|
169
169
|
File.write("go.mod", "module dummy\n")
|
170
170
|
|
171
171
|
env = { "GOPRIVATE" => "*" }
|
172
|
-
_, _, status = Open3.capture3(env, SharedHelpers.escape_command("go get #{
|
172
|
+
_, _, status = Open3.capture3(env, SharedHelpers.escape_command("go get #{mod_path}"))
|
173
173
|
raise Dependabot::DependencyFileNotResolvable, line if status.success?
|
174
174
|
|
175
|
+
mod_split = mod_path.split("/")
|
176
|
+
repo_path = if mod_split.size > 3
|
177
|
+
mod_split[0..2].join("/")
|
178
|
+
else
|
179
|
+
mod_path
|
180
|
+
end
|
175
181
|
raise Dependabot::GitDependenciesNotReachable, [repo_path]
|
176
182
|
end
|
177
183
|
end
|
@@ -240,12 +240,37 @@ module Dependabot
|
|
240
240
|
(manifest["Replace"] || []).
|
241
241
|
map { |r| r["New"]["Path"] }.
|
242
242
|
compact.
|
243
|
-
select { |p|
|
243
|
+
select { |p| stub_replace_path?(p) }.
|
244
244
|
map { |p| [p, "./" + Digest::SHA2.hexdigest(p)] }.
|
245
245
|
to_h
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
|
+
# returns true if the provided path should be replaced with a stub
|
250
|
+
def stub_replace_path?(path)
|
251
|
+
return true if absolute_path?(path)
|
252
|
+
return false unless relative_replacement_path?(path)
|
253
|
+
|
254
|
+
resolved_path = module_pathname.join(path).realpath
|
255
|
+
inside_repo_contents_path = resolved_path.to_s.start_with?(repo_contents_path.to_s)
|
256
|
+
!inside_repo_contents_path
|
257
|
+
rescue Errno::ENOENT
|
258
|
+
true
|
259
|
+
end
|
260
|
+
|
261
|
+
def absolute_path?(path)
|
262
|
+
path.start_with?("/")
|
263
|
+
end
|
264
|
+
|
265
|
+
def relative_replacement_path?(path)
|
266
|
+
# https://golang.org/ref/mod#go-mod-file-replace
|
267
|
+
path.start_with?("./") || path.start_with?("../")
|
268
|
+
end
|
269
|
+
|
270
|
+
def module_pathname
|
271
|
+
@module_pathname ||= Pathname.new(repo_contents_path).join(directory)
|
272
|
+
end
|
273
|
+
|
249
274
|
def substitute_all(substitutions)
|
250
275
|
body = substitutions.reduce(File.read("go.mod")) do |text, (a, b)|
|
251
276
|
text.sub(a, b)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-go_modules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.129.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.129.1
|
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.129.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|