dependabot-go_modules 0.238.0 → 0.240.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/helpers/build +1 -1
- data/lib/dependabot/go_modules/file_fetcher.rb +0 -10
- data/lib/dependabot/go_modules/file_updater/go_mod_updater.rb +2 -6
- data/lib/dependabot/go_modules/file_updater.rb +1 -0
- data/lib/dependabot/go_modules/requirement.rb +7 -1
- data/lib/dependabot/go_modules/resolvability_errors.rb +3 -1
- data/lib/dependabot/go_modules/update_checker/latest_version_finder.rb +5 -12
- data/lib/dependabot/go_modules/update_checker.rb +0 -1
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 529ab6a43cd91b307fc18e1e33f3de1d69c5ac312b975277d007c3b8cbc92c02
|
4
|
+
data.tar.gz: 036bd9736ad3510a1687838c1e1b2cb3ac997a0d255ff447cf81603f89148984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0172d9f2438553394fd84169561e6c0385d89c8c46d689cd6bdf8c9da8d56b865a2dbef84ee2e4f19e2f52170e0526329585e3292a33846ff1494a45a49554a
|
7
|
+
data.tar.gz: 9b2fc02ce1900450f28d73412c898424d0e3ab8219e683f0cda8095e7185ffd332967158a0bfb553c923452a093736c79b3db11b22aecbace032f1113e7302ae
|
data/helpers/build
CHANGED
@@ -20,8 +20,6 @@ module Dependabot
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def ecosystem_versions
|
23
|
-
return nil unless go_mod
|
24
|
-
|
25
23
|
{
|
26
24
|
package_managers: {
|
27
25
|
"gomod" => go_mod.content.match(/^go\s(\d+\.\d+)/)&.captures&.first || "unknown"
|
@@ -37,14 +35,6 @@ module Dependabot
|
|
37
35
|
directory,
|
38
36
|
clone_repo_contents
|
39
37
|
) do
|
40
|
-
unless go_mod
|
41
|
-
raise(
|
42
|
-
Dependabot::DependencyFileNotFound,
|
43
|
-
Pathname.new(File.join(directory, "go.mod"))
|
44
|
-
.cleanpath.to_path
|
45
|
-
)
|
46
|
-
end
|
47
|
-
|
48
38
|
fetched_files = [go_mod]
|
49
39
|
# Fetch the (optional) go.sum
|
50
40
|
fetched_files << go_sum if go_sum
|
@@ -5,7 +5,6 @@ require "dependabot/shared_helpers"
|
|
5
5
|
require "dependabot/errors"
|
6
6
|
require "dependabot/logger"
|
7
7
|
require "dependabot/go_modules/file_updater"
|
8
|
-
require "dependabot/go_modules/native_helpers"
|
9
8
|
require "dependabot/go_modules/replace_stubber"
|
10
9
|
require "dependabot/go_modules/resolvability_errors"
|
11
10
|
|
@@ -250,7 +249,7 @@ module Dependabot
|
|
250
249
|
write_go_mod(body)
|
251
250
|
end
|
252
251
|
|
253
|
-
def handle_subprocess_error(stderr)
|
252
|
+
def handle_subprocess_error(stderr)
|
254
253
|
stderr = stderr.gsub(Dir.getwd, "")
|
255
254
|
|
256
255
|
# Package version doesn't match the module major version
|
@@ -265,10 +264,7 @@ module Dependabot
|
|
265
264
|
end
|
266
265
|
|
267
266
|
repo_error_regex = REPO_RESOLVABILITY_ERROR_REGEXES.find { |r| stderr =~ r }
|
268
|
-
if repo_error_regex
|
269
|
-
error_message = filter_error_message(message: stderr, regex: repo_error_regex)
|
270
|
-
ResolvabilityErrors.handle(error_message, goprivate: @goprivate)
|
271
|
-
end
|
267
|
+
ResolvabilityErrors.handle(stderr, goprivate: @goprivate) if repo_error_regex
|
272
268
|
|
273
269
|
path_regex = MODULE_PATH_MISMATCH_REGEXES.find { |r| stderr =~ r }
|
274
270
|
if path_regex
|
@@ -84,6 +84,7 @@ module Dependabot
|
|
84
84
|
SharedHelpers.with_git_configured(credentials: []) do
|
85
85
|
`git config --global user.email "no-reply@github.com"`
|
86
86
|
`git config --global user.name "Dependabot"`
|
87
|
+
`git config --global init.defaultBranch "placeholder-default-branch"`
|
87
88
|
`git init .`
|
88
89
|
`git add .`
|
89
90
|
`git commit -m'fake repo_contents_path'`
|
@@ -7,12 +7,17 @@
|
|
7
7
|
# - https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md #
|
8
8
|
################################################################################
|
9
9
|
|
10
|
+
require "sorbet-runtime"
|
11
|
+
|
12
|
+
require "dependabot/requirement"
|
10
13
|
require "dependabot/utils"
|
11
14
|
require "dependabot/go_modules/version"
|
12
15
|
|
13
16
|
module Dependabot
|
14
17
|
module GoModules
|
15
|
-
class Requirement <
|
18
|
+
class Requirement < Dependabot::Requirement
|
19
|
+
extend T::Sig
|
20
|
+
|
16
21
|
WILDCARD_REGEX = /(?:\.|^)[xX*]/
|
17
22
|
OR_SEPARATOR = /(?<=[a-zA-Z0-9*])\s*\|{2}/
|
18
23
|
|
@@ -40,6 +45,7 @@ module Dependabot
|
|
40
45
|
|
41
46
|
# Returns an array of requirements. At least one requirement from the
|
42
47
|
# returned array must be satisfied for a version to be valid.
|
48
|
+
sig { override.params(requirement_string: T.nilable(String)).returns(T::Array[Requirement]) }
|
43
49
|
def self.requirements_array(requirement_string)
|
44
50
|
return [new(nil)] if requirement_string.nil?
|
45
51
|
|
@@ -8,7 +8,9 @@ module Dependabot
|
|
8
8
|
|
9
9
|
def self.handle(message, goprivate:)
|
10
10
|
mod_path = message.scan(GITHUB_REPO_REGEX).last
|
11
|
-
|
11
|
+
unless mod_path && message.include?("If this is a private repository")
|
12
|
+
raise Dependabot::DependencyFileNotResolvable, message
|
13
|
+
end
|
12
14
|
|
13
15
|
# Module not found on github.com - query for _any_ version to know if it
|
14
16
|
# doesn't exist (or is private) or we were just given a bad revision by this manifest
|
@@ -25,7 +25,10 @@ module Dependabot
|
|
25
25
|
# (Private) module could not be fetched
|
26
26
|
/module .*: git ls-remote .*: exit status 128/m
|
27
27
|
].freeze
|
28
|
-
|
28
|
+
# The module was retracted from the proxy
|
29
|
+
# OR the version of Go required is greater than what Dependabot supports
|
30
|
+
# OR other go.mod version errors
|
31
|
+
INVALID_VERSION_REGEX = /(go: loading module retractions for)|(version "[^"]+" invalid)/m
|
29
32
|
PSEUDO_VERSION_REGEX = /\b\d{14}-[0-9a-f]{12}$/
|
30
33
|
|
31
34
|
def initialize(dependency:, dependency_files:, credentials:,
|
@@ -111,17 +114,7 @@ module Dependabot
|
|
111
114
|
retry_count += 1
|
112
115
|
retry if transitory_failure?(e) && retry_count < 2
|
113
116
|
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
def handle_subprocess_error(error)
|
118
|
-
if RESOLVABILITY_ERROR_REGEXES.any? { |rgx| error.message =~ rgx }
|
119
|
-
ResolvabilityErrors.handle(error.message, goprivate: @goprivate)
|
120
|
-
elsif INVALID_VERSION_REGEX.match?(error.message)
|
121
|
-
raise Dependabot::DependencyFileNotResolvable, error.message
|
122
|
-
end
|
123
|
-
|
124
|
-
raise
|
117
|
+
ResolvabilityErrors.handle(e.message, goprivate: @goprivate)
|
125
118
|
end
|
126
119
|
|
127
120
|
def transitory_failure?(error)
|
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.240.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-12 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.240.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.240.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: debug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.58.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.58.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rubocop-performance
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,6 +206,20 @@ dependencies:
|
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '3.18'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: webrick
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '1.7'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '1.7'
|
209
223
|
description: Dependabot-Go_Modules provides support for bumping Go Modules versions
|
210
224
|
via Dependabot. If you want support for multiple package managers, you probably
|
211
225
|
want the meta-gem dependabot-omnibus.
|
@@ -239,7 +253,7 @@ licenses:
|
|
239
253
|
- Nonstandard
|
240
254
|
metadata:
|
241
255
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
242
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
256
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.240.0
|
243
257
|
post_install_message:
|
244
258
|
rdoc_options: []
|
245
259
|
require_paths:
|