dependabot-common 0.334.0 → 0.335.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/clients/azure.rb +108 -60
- data/lib/dependabot/clients/bitbucket.rb +17 -4
- data/lib/dependabot/clients/codecommit.rb +17 -7
- data/lib/dependabot/config/file.rb +31 -28
- data/lib/dependabot/dependency.rb +18 -7
- data/lib/dependabot/dependency_file.rb +17 -6
- data/lib/dependabot/dependency_graphers/README.md +54 -0
- data/lib/dependabot/dependency_graphers/base.rb +118 -0
- data/lib/dependabot/dependency_graphers/generic.rb +76 -0
- data/lib/dependabot/dependency_graphers.rb +33 -0
- data/lib/dependabot/file_fetchers/base.rb +11 -4
- data/lib/dependabot/file_filtering.rb +9 -5
- data/lib/dependabot/file_parsers/base.rb +8 -2
- data/lib/dependabot/file_updaters/artifact_updater.rb +1 -0
- data/lib/dependabot/git_commit_checker.rb +17 -10
- data/lib/dependabot/git_metadata_fetcher.rb +4 -2
- data/lib/dependabot/metadata_finders/base/changelog_finder.rb +6 -2
- data/lib/dependabot/metadata_finders/base/changelog_pruner.rb +4 -2
- data/lib/dependabot/notices.rb +7 -3
- data/lib/dependabot/package/release_cooldown_options.rb +6 -2
- data/lib/dependabot/pull_request_creator/azure.rb +15 -3
- data/lib/dependabot/pull_request_creator/bitbucket.rb +13 -3
- data/lib/dependabot/pull_request_creator/branch_namer/base.rb +8 -2
- data/lib/dependabot/pull_request_creator/branch_namer/dependency_group_strategy.rb +15 -5
- data/lib/dependabot/pull_request_creator/branch_namer/multi_ecosystem_strategy.rb +15 -5
- data/lib/dependabot/pull_request_creator/branch_namer/solo_strategy.rb +11 -7
- data/lib/dependabot/pull_request_creator/branch_namer.rb +11 -2
- data/lib/dependabot/pull_request_creator/codecommit.rb +20 -7
- data/lib/dependabot/pull_request_creator/commit_signer.rb +10 -4
- data/lib/dependabot/pull_request_creator/github.rb +18 -5
- data/lib/dependabot/pull_request_creator/gitlab.rb +16 -4
- data/lib/dependabot/pull_request_creator/labeler.rb +35 -19
- data/lib/dependabot/pull_request_creator/message_builder/issue_linker.rb +15 -10
- data/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb +7 -2
- data/lib/dependabot/pull_request_creator/message_builder.rb +16 -6
- data/lib/dependabot/pull_request_creator/pr_name_prefixer.rb +7 -2
- data/lib/dependabot/pull_request_creator.rb +31 -12
- data/lib/dependabot/pull_request_updater/azure.rb +9 -2
- data/lib/dependabot/pull_request_updater/github.rb +10 -3
- data/lib/dependabot/pull_request_updater/gitlab.rb +9 -2
- data/lib/dependabot/pull_request_updater.rb +11 -4
- data/lib/dependabot/security_advisory.rb +12 -6
- data/lib/dependabot/shared_helpers.rb +36 -19
- data/lib/dependabot/source.rb +14 -4
- data/lib/dependabot/update_checkers/base.rb +13 -5
- data/lib/dependabot.rb +1 -1
- metadata +16 -12
@@ -35,8 +35,13 @@ module Dependabot
|
|
35
35
|
signature_key: String
|
36
36
|
).void
|
37
37
|
end
|
38
|
-
def initialize(
|
39
|
-
|
38
|
+
def initialize(
|
39
|
+
author_details:,
|
40
|
+
commit_message:,
|
41
|
+
tree_sha:,
|
42
|
+
parent_sha:,
|
43
|
+
signature_key:
|
44
|
+
)
|
40
45
|
@author_details = author_details
|
41
46
|
@commit_message = commit_message
|
42
47
|
@tree_sha = tree_sha
|
@@ -49,8 +54,9 @@ module Dependabot
|
|
49
54
|
begin
|
50
55
|
require "gpgme"
|
51
56
|
rescue LoadError
|
52
|
-
raise LoadError,
|
53
|
-
|
57
|
+
raise LoadError,
|
58
|
+
"Please add `gpgme` to your Gemfile or gemspec " \
|
59
|
+
"enable commit signatures"
|
54
60
|
end
|
55
61
|
|
56
62
|
email = author_details[:email]
|
@@ -85,11 +85,24 @@ module Dependabot
|
|
85
85
|
)
|
86
86
|
.void
|
87
87
|
end
|
88
|
-
def initialize(
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
88
|
+
def initialize(
|
89
|
+
source:,
|
90
|
+
branch_name:,
|
91
|
+
base_commit:,
|
92
|
+
credentials:,
|
93
|
+
files:,
|
94
|
+
commit_message:,
|
95
|
+
pr_description:,
|
96
|
+
pr_name:,
|
97
|
+
author_details:,
|
98
|
+
signature_key:,
|
99
|
+
custom_headers:,
|
100
|
+
labeler:,
|
101
|
+
reviewers:,
|
102
|
+
assignees:,
|
103
|
+
milestone:,
|
104
|
+
require_up_to_date_base:
|
105
|
+
)
|
93
106
|
@source = source
|
94
107
|
@branch_name = branch_name
|
95
108
|
@base_commit = base_commit
|
@@ -73,10 +73,22 @@ module Dependabot
|
|
73
73
|
)
|
74
74
|
.void
|
75
75
|
end
|
76
|
-
def initialize(
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
def initialize(
|
77
|
+
source:,
|
78
|
+
branch_name:,
|
79
|
+
base_commit:,
|
80
|
+
credentials:,
|
81
|
+
files:,
|
82
|
+
commit_message:,
|
83
|
+
pr_description:,
|
84
|
+
pr_name:,
|
85
|
+
author_details:,
|
86
|
+
labeler:,
|
87
|
+
approvers:,
|
88
|
+
assignees:,
|
89
|
+
milestone:,
|
90
|
+
target_project_id:
|
91
|
+
)
|
80
92
|
@source = source
|
81
93
|
@branch_name = branch_name
|
82
94
|
@base_commit = base_commit
|
@@ -50,9 +50,15 @@ module Dependabot
|
|
50
50
|
)
|
51
51
|
.void
|
52
52
|
end
|
53
|
-
def initialize(
|
54
|
-
|
55
|
-
|
53
|
+
def initialize(
|
54
|
+
source:,
|
55
|
+
custom_labels:,
|
56
|
+
credentials:,
|
57
|
+
dependencies:,
|
58
|
+
includes_security_fixes:,
|
59
|
+
label_language:,
|
60
|
+
automerge_candidate:
|
61
|
+
)
|
56
62
|
@source = source
|
57
63
|
@custom_labels = custom_labels
|
58
64
|
@credentials = credentials
|
@@ -143,18 +149,20 @@ module Dependabot
|
|
143
149
|
|
144
150
|
sig { returns(Integer) }
|
145
151
|
def precision
|
146
|
-
T.must(
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
152
|
+
T.must(
|
153
|
+
dependencies.map do |dep|
|
154
|
+
new_version_parts = T.must(version(dep)).split(/[.+]/)
|
155
|
+
old_version_parts = previous_version(dep)&.split(/[.+]/) || []
|
156
|
+
all_parts = new_version_parts.first(3) + old_version_parts.first(3)
|
157
|
+
# rubocop:disable Performance/RedundantEqualityComparisonBlock
|
158
|
+
next 0 unless all_parts.all? { |part| part.to_i.to_s == part }
|
159
|
+
# rubocop:enable Performance/RedundantEqualityComparisonBlock
|
160
|
+
next 1 if new_version_parts[0] != old_version_parts[0]
|
161
|
+
next 2 if new_version_parts[1] != old_version_parts[1]
|
162
|
+
|
163
|
+
3
|
164
|
+
end.min
|
165
|
+
)
|
158
166
|
end
|
159
167
|
|
160
168
|
# rubocop:disable Metrics/PerceivedComplexity
|
@@ -383,7 +391,9 @@ module Dependabot
|
|
383
391
|
sig { returns(T::Array[String]) }
|
384
392
|
def create_github_dependencies_label
|
385
393
|
T.unsafe(github_client_for_source).add_label(
|
386
|
-
source.repo,
|
394
|
+
source.repo,
|
395
|
+
DEFAULT_DEPENDENCIES_LABEL,
|
396
|
+
"0366d6",
|
387
397
|
description: "Pull requests that update a dependency file",
|
388
398
|
accept: "application/vnd.github.symmetra-preview+json"
|
389
399
|
)
|
@@ -397,7 +407,9 @@ module Dependabot
|
|
397
407
|
sig { returns(T::Array[String]) }
|
398
408
|
def create_gitlab_dependencies_label
|
399
409
|
T.unsafe(gitlab_client_for_source).create_label(
|
400
|
-
source.repo,
|
410
|
+
source.repo,
|
411
|
+
DEFAULT_DEPENDENCIES_LABEL,
|
412
|
+
"#0366d6",
|
401
413
|
description: "Pull requests that update a dependency file"
|
402
414
|
)
|
403
415
|
@labels = [*@labels, DEFAULT_DEPENDENCIES_LABEL].uniq
|
@@ -406,7 +418,9 @@ module Dependabot
|
|
406
418
|
sig { returns(T::Array[String]) }
|
407
419
|
def create_github_security_label
|
408
420
|
T.unsafe(github_client_for_source).add_label(
|
409
|
-
source.repo,
|
421
|
+
source.repo,
|
422
|
+
DEFAULT_SECURITY_LABEL,
|
423
|
+
"ee0701",
|
410
424
|
description: "Pull requests that address a security vulnerability",
|
411
425
|
accept: "application/vnd.github.symmetra-preview+json"
|
412
426
|
)
|
@@ -420,7 +434,9 @@ module Dependabot
|
|
420
434
|
sig { returns(T.nilable(T::Array[String])) }
|
421
435
|
def create_gitlab_security_label
|
422
436
|
T.unsafe(gitlab_client_for_source).create_label(
|
423
|
-
source.repo,
|
437
|
+
source.repo,
|
438
|
+
DEFAULT_SECURITY_LABEL,
|
439
|
+
"#ee0701",
|
424
440
|
description: "Pull requests that address a security vulnerability"
|
425
441
|
)
|
426
442
|
@labels = [*@labels, DEFAULT_SECURITY_LABEL].uniq
|
@@ -12,14 +12,17 @@ module Dependabot
|
|
12
12
|
|
13
13
|
REPO_REGEX = %r{(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)}
|
14
14
|
TAG_REGEX = /(?<tag>(?:\#|GH-)\d+)/i
|
15
|
-
ISSUE_LINK_REGEXS = T.let(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
ISSUE_LINK_REGEXS = T.let(
|
16
|
+
[
|
17
|
+
/
|
18
|
+
(?:(?<=[^A-Za-z0-9\[\\]|^)\\*#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$))|
|
19
|
+
(?:(?<=\s|^)#{REPO_REGEX}#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$))
|
20
|
+
/x,
|
21
|
+
/\[#{TAG_REGEX}\](?=[^A-Za-z0-9\-\(])/,
|
22
|
+
/\[(?<tag>(?:\#|GH-)?\d+)\]\(\)/i
|
23
|
+
].freeze,
|
24
|
+
T::Array[Regexp]
|
25
|
+
)
|
23
26
|
|
24
27
|
sig { returns(T.nilable(String)) }
|
25
28
|
attr_reader :source_url
|
@@ -36,8 +39,10 @@ module Dependabot
|
|
36
39
|
ISSUE_LINK_REGEXS.reduce(text) do |updated_text, regex|
|
37
40
|
updated_text.gsub(regex) do |issue_link|
|
38
41
|
tag = T.must(
|
39
|
-
T.must(
|
40
|
-
|
42
|
+
T.must(
|
43
|
+
issue_link
|
44
|
+
.match(/(?<tag>(?:\#|GH-)?\d+)/i)
|
45
|
+
)
|
41
46
|
.named_captures.fetch("tag")
|
42
47
|
)
|
43
48
|
number = tag.match(/\d+/).to_s
|
@@ -48,8 +48,13 @@ module Dependabot
|
|
48
48
|
)
|
49
49
|
.void
|
50
50
|
end
|
51
|
-
def initialize(
|
52
|
-
|
51
|
+
def initialize(
|
52
|
+
dependency:,
|
53
|
+
source:,
|
54
|
+
metadata_finder:,
|
55
|
+
vulnerabilities_fixed:,
|
56
|
+
github_redirection_service:
|
57
|
+
)
|
53
58
|
@dependency = dependency
|
54
59
|
@source = source
|
55
60
|
@metadata_finder = metadata_finder
|
@@ -89,12 +89,22 @@ module Dependabot
|
|
89
89
|
)
|
90
90
|
.void
|
91
91
|
end
|
92
|
-
def initialize(
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
def initialize(
|
93
|
+
source:,
|
94
|
+
dependencies:,
|
95
|
+
files:,
|
96
|
+
credentials:,
|
97
|
+
pr_message_header: nil,
|
98
|
+
pr_message_footer: nil,
|
99
|
+
commit_message_options: {},
|
100
|
+
vulnerabilities_fixed: {},
|
101
|
+
github_redirection_service: DEFAULT_GITHUB_REDIRECTION_SERVICE,
|
102
|
+
dependency_group: nil,
|
103
|
+
pr_message_max_length: nil,
|
104
|
+
pr_message_encoding: nil,
|
105
|
+
ignore_conditions: [],
|
106
|
+
notices: nil
|
107
|
+
)
|
98
108
|
@dependencies = dependencies
|
99
109
|
@files = files
|
100
110
|
@source = source
|
@@ -43,8 +43,13 @@ module Dependabot
|
|
43
43
|
)
|
44
44
|
.void
|
45
45
|
end
|
46
|
-
def initialize(
|
47
|
-
|
46
|
+
def initialize(
|
47
|
+
source:,
|
48
|
+
dependencies:,
|
49
|
+
credentials:,
|
50
|
+
security_fix: false,
|
51
|
+
commit_message_options: {}
|
52
|
+
)
|
48
53
|
@dependencies = dependencies
|
49
54
|
@source = source
|
50
55
|
@credentials = credentials
|
@@ -6,7 +6,7 @@ require "dependabot/metadata_finders"
|
|
6
6
|
require "dependabot/credential"
|
7
7
|
|
8
8
|
module Dependabot
|
9
|
-
class PullRequestCreator
|
9
|
+
class PullRequestCreator # rubocop:disable Metrics/ClassLength
|
10
10
|
extend T::Sig
|
11
11
|
|
12
12
|
require "dependabot/pull_request_creator/azure"
|
@@ -179,17 +179,36 @@ module Dependabot
|
|
179
179
|
)
|
180
180
|
.void
|
181
181
|
end
|
182
|
-
def initialize(
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
182
|
+
def initialize(
|
183
|
+
source:,
|
184
|
+
base_commit:,
|
185
|
+
dependencies:,
|
186
|
+
files:,
|
187
|
+
credentials:,
|
188
|
+
pr_message_header: nil,
|
189
|
+
pr_message_footer: nil,
|
190
|
+
custom_labels: nil,
|
191
|
+
author_details: nil,
|
192
|
+
signature_key: nil,
|
193
|
+
commit_message_options: {},
|
194
|
+
vulnerabilities_fixed: {},
|
195
|
+
reviewers: nil,
|
196
|
+
assignees: nil,
|
197
|
+
milestone: nil,
|
198
|
+
branch_name_separator: "/",
|
199
|
+
branch_name_prefix: "dependabot",
|
200
|
+
branch_name_max_length: nil,
|
201
|
+
label_language: false,
|
202
|
+
automerge_candidate: false,
|
203
|
+
github_redirection_service: DEFAULT_GITHUB_REDIRECTION_SERVICE,
|
204
|
+
custom_headers: nil,
|
205
|
+
require_up_to_date_base: false,
|
206
|
+
provider_metadata: {},
|
207
|
+
message: nil,
|
208
|
+
dependency_group: nil,
|
209
|
+
pr_message_max_length: nil,
|
210
|
+
pr_message_encoding: nil
|
211
|
+
)
|
193
212
|
@dependencies = dependencies
|
194
213
|
@source = source
|
195
214
|
@base_commit = base_commit
|
@@ -48,8 +48,15 @@ module Dependabot
|
|
48
48
|
)
|
49
49
|
.void
|
50
50
|
end
|
51
|
-
def initialize(
|
52
|
-
|
51
|
+
def initialize(
|
52
|
+
source:,
|
53
|
+
files:,
|
54
|
+
base_commit:,
|
55
|
+
old_commit:,
|
56
|
+
credentials:,
|
57
|
+
pull_request_number:,
|
58
|
+
author_details: nil
|
59
|
+
)
|
53
60
|
@source = source
|
54
61
|
@files = files
|
55
62
|
@base_commit = base_commit
|
@@ -50,9 +50,16 @@ module Dependabot
|
|
50
50
|
)
|
51
51
|
.void
|
52
52
|
end
|
53
|
-
def initialize(
|
54
|
-
|
55
|
-
|
53
|
+
def initialize(
|
54
|
+
source:,
|
55
|
+
base_commit:,
|
56
|
+
old_commit:,
|
57
|
+
files:,
|
58
|
+
credentials:,
|
59
|
+
pull_request_number:,
|
60
|
+
author_details: nil,
|
61
|
+
signature_key: nil
|
62
|
+
)
|
56
63
|
@source = source
|
57
64
|
@base_commit = base_commit
|
58
65
|
@old_commit = old_commit
|
@@ -46,8 +46,15 @@ module Dependabot
|
|
46
46
|
)
|
47
47
|
.void
|
48
48
|
end
|
49
|
-
def initialize(
|
50
|
-
|
49
|
+
def initialize(
|
50
|
+
source:,
|
51
|
+
base_commit:,
|
52
|
+
old_commit:,
|
53
|
+
files:,
|
54
|
+
credentials:,
|
55
|
+
pull_request_number:,
|
56
|
+
target_project_id:
|
57
|
+
)
|
51
58
|
@source = source
|
52
59
|
@base_commit = base_commit
|
53
60
|
@old_commit = old_commit
|
@@ -54,10 +54,17 @@ module Dependabot
|
|
54
54
|
)
|
55
55
|
.void
|
56
56
|
end
|
57
|
-
def initialize(
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
def initialize(
|
58
|
+
source:,
|
59
|
+
base_commit:,
|
60
|
+
old_commit:,
|
61
|
+
files:,
|
62
|
+
credentials:,
|
63
|
+
pull_request_number:,
|
64
|
+
author_details: nil,
|
65
|
+
signature_key: nil,
|
66
|
+
provider_metadata: {}
|
67
|
+
)
|
61
68
|
@source = source
|
62
69
|
@base_commit = base_commit
|
63
70
|
@old_commit = old_commit
|
@@ -32,8 +32,12 @@ module Dependabot
|
|
32
32
|
)
|
33
33
|
.void
|
34
34
|
end
|
35
|
-
def initialize(
|
36
|
-
|
35
|
+
def initialize(
|
36
|
+
dependency_name:,
|
37
|
+
package_manager:,
|
38
|
+
vulnerable_versions: [],
|
39
|
+
safe_versions: []
|
40
|
+
)
|
37
41
|
@dependency_name = dependency_name
|
38
42
|
@package_manager = package_manager
|
39
43
|
@vulnerable_version_strings = T.let(vulnerable_versions || [], T::Array[T.any(String, Dependabot::Requirement)])
|
@@ -143,14 +147,16 @@ module Dependabot
|
|
143
147
|
def check_version_requirements
|
144
148
|
unless vulnerable_versions.is_a?(Array) &&
|
145
149
|
vulnerable_versions.all? { |i| requirement_class <= i.class }
|
146
|
-
raise ArgumentError,
|
147
|
-
|
150
|
+
raise ArgumentError,
|
151
|
+
"vulnerable_versions must be an array " \
|
152
|
+
"of #{requirement_class} instances"
|
148
153
|
end
|
149
154
|
|
150
155
|
unless safe_versions.is_a?(Array) &&
|
151
156
|
safe_versions.all? { |i| requirement_class <= i.class }
|
152
|
-
raise ArgumentError,
|
153
|
-
|
157
|
+
raise ArgumentError,
|
158
|
+
"safe_versions must be an array " \
|
159
|
+
"of #{requirement_class} instances"
|
154
160
|
end
|
155
161
|
end
|
156
162
|
|
@@ -139,11 +139,16 @@ module Dependabot
|
|
139
139
|
)
|
140
140
|
.returns(T.untyped)
|
141
141
|
end
|
142
|
-
def self.run_helper_subprocess(
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
142
|
+
def self.run_helper_subprocess(
|
143
|
+
command:,
|
144
|
+
function:,
|
145
|
+
args:,
|
146
|
+
env: nil,
|
147
|
+
stderr_to_stdout: false,
|
148
|
+
allow_unsafe_shell_command: false,
|
149
|
+
error_class: HelperSubprocessFailed,
|
150
|
+
timeout: CommandHelpers::TIMEOUTS::DEFAULT
|
151
|
+
)
|
147
152
|
start = Time.now
|
148
153
|
stdin_data = JSON.dump(function: function, args: args)
|
149
154
|
cmd = allow_unsafe_shell_command ? command : escape_command(command)
|
@@ -209,8 +214,12 @@ module Dependabot
|
|
209
214
|
end
|
210
215
|
|
211
216
|
sig do
|
212
|
-
params(
|
213
|
-
|
217
|
+
params(
|
218
|
+
stdout: String,
|
219
|
+
stderr: String,
|
220
|
+
error_context: T::Hash[Symbol, T.untyped],
|
221
|
+
error_class: T.class_of(HelperSubprocessFailed)
|
222
|
+
)
|
214
223
|
.returns(HelperSubprocessFailed)
|
215
224
|
end
|
216
225
|
def self.handle_json_parse_error(stdout, stderr, error_context, error_class)
|
@@ -232,8 +241,11 @@ module Dependabot
|
|
232
241
|
|
233
242
|
# rubocop:enable Metrics/MethodLength
|
234
243
|
sig do
|
235
|
-
params(
|
236
|
-
|
244
|
+
params(
|
245
|
+
stderr: T.nilable(String),
|
246
|
+
error_context: T::Hash[Symbol, String],
|
247
|
+
error_class: T.class_of(HelperSubprocessFailed)
|
248
|
+
).void
|
237
249
|
end
|
238
250
|
def self.check_out_of_memory_error(stderr, error_context, error_class)
|
239
251
|
return unless stderr&.include?("JavaScript heap out of memory")
|
@@ -325,8 +337,11 @@ module Dependabot
|
|
325
337
|
|
326
338
|
# rubocop:disable Metrics/PerceivedComplexity
|
327
339
|
sig do
|
328
|
-
params(
|
329
|
-
|
340
|
+
params(
|
341
|
+
credentials: T::Array[Dependabot::Credential],
|
342
|
+
safe_directories: T::Array[String],
|
343
|
+
git_config_global_path: String
|
344
|
+
).void
|
330
345
|
end
|
331
346
|
def self.configure_git_to_use_https_with_credentials(credentials, safe_directories, git_config_global_path)
|
332
347
|
File.open(git_config_global_path, "w") do |file|
|
@@ -445,14 +460,16 @@ module Dependabot
|
|
445
460
|
output_observer: CommandHelpers::OutputObserver
|
446
461
|
).returns(String)
|
447
462
|
end
|
448
|
-
def self.run_shell_command(
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
463
|
+
def self.run_shell_command(
|
464
|
+
command,
|
465
|
+
allow_unsafe_shell_command: false,
|
466
|
+
cwd: nil,
|
467
|
+
env: {},
|
468
|
+
fingerprint: nil,
|
469
|
+
stderr_to_stdout: true,
|
470
|
+
timeout: CommandHelpers::TIMEOUTS::DEFAULT,
|
471
|
+
output_observer: nil
|
472
|
+
)
|
456
473
|
start = Time.now
|
457
474
|
cmd = allow_unsafe_shell_command ? command : escape_command(command)
|
458
475
|
|
data/lib/dependabot/source.rb
CHANGED
@@ -63,8 +63,10 @@ module Dependabot
|
|
63
63
|
(?:#{CODECOMMIT_SOURCE})
|
64
64
|
/x
|
65
65
|
|
66
|
-
IGNORED_PROVIDER_HOSTS = T.let(
|
67
|
-
|
66
|
+
IGNORED_PROVIDER_HOSTS = T.let(
|
67
|
+
%w(gitbox.apache.org svn.apache.org fuchsia.googlesource.com).freeze,
|
68
|
+
T::Array[String]
|
69
|
+
)
|
68
70
|
|
69
71
|
sig { returns(String) }
|
70
72
|
attr_accessor :provider
|
@@ -147,8 +149,16 @@ module Dependabot
|
|
147
149
|
api_endpoint: T.nilable(String)
|
148
150
|
).void
|
149
151
|
end
|
150
|
-
def initialize(
|
151
|
-
|
152
|
+
def initialize(
|
153
|
+
provider:,
|
154
|
+
repo:,
|
155
|
+
directory: nil,
|
156
|
+
directories: nil,
|
157
|
+
branch: nil,
|
158
|
+
commit: nil,
|
159
|
+
hostname: nil,
|
160
|
+
api_endpoint: nil
|
161
|
+
)
|
152
162
|
if (hostname.nil? ^ api_endpoint.nil?) && (provider != "codecommit")
|
153
163
|
msg = "Both hostname and api_endpoint must be specified if either " \
|
154
164
|
"are. Alternatively, both may be left blank to use the " \
|
@@ -65,11 +65,19 @@ module Dependabot
|
|
65
65
|
)
|
66
66
|
.void
|
67
67
|
end
|
68
|
-
def initialize(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
def initialize(
|
69
|
+
dependency:,
|
70
|
+
dependency_files:,
|
71
|
+
credentials:,
|
72
|
+
repo_contents_path: nil,
|
73
|
+
ignored_versions: [],
|
74
|
+
raise_on_ignored: false,
|
75
|
+
security_advisories: [],
|
76
|
+
requirements_update_strategy: nil,
|
77
|
+
dependency_group: nil,
|
78
|
+
update_cooldown: nil,
|
79
|
+
options: {}
|
80
|
+
)
|
73
81
|
@dependency = dependency
|
74
82
|
@dependency_files = dependency_files
|
75
83
|
@repo_contents_path = repo_contents_path
|
data/lib/dependabot.rb
CHANGED