dependabot-common 0.124.8 → 0.125.4
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 +1 -3
- data/lib/dependabot/file_fetchers/base.rb +4 -8
- data/lib/dependabot/file_parsers/base/dependency_set.rb +2 -6
- data/lib/dependabot/file_updaters/vendor_updater.rb +1 -1
- data/lib/dependabot/git_commit_checker.rb +1 -3
- data/lib/dependabot/git_metadata_fetcher.rb +2 -6
- data/lib/dependabot/metadata_finders/base/changelog_finder.rb +1 -3
- data/lib/dependabot/metadata_finders/base/commits_finder.rb +3 -9
- data/lib/dependabot/pull_request_creator/branch_namer.rb +1 -3
- data/lib/dependabot/pull_request_creator/github.rb +1 -3
- data/lib/dependabot/pull_request_creator/gitlab.rb +1 -3
- data/lib/dependabot/pull_request_creator/message_builder.rb +8 -24
- data/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb +1 -3
- data/lib/dependabot/pull_request_creator/pr_name_prefixer.rb +8 -24
- data/lib/dependabot/shared_helpers.rb +35 -16
- data/lib/dependabot/update_checkers/base.rb +11 -3
- data/lib/dependabot/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab1d6e026ca5a9a1cc8637814dacb5d8238ab248fa3c80df5bc8986f9bd4ea28
|
4
|
+
data.tar.gz: e1f1ceae98349c8336e243491a346ee8e1ce265488aae2e7932066d2c1170992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16fe9bfff89dde150778a188ee2068672d384ceaabb729502e7d79ae6f0a7c7b667adc9e47961b58711212e90d9c7ef551ab377ce71df717ad53f323eabb0d24
|
7
|
+
data.tar.gz: 70af4395acf6a36fbb4fb7bbb589bdee606cec2c03419134b583e302c745cdb49ad55c6312e5f101d8016ab41efdf47a3cc06cfeb312053ba9d540626e212a4d
|
@@ -95,9 +95,7 @@ module Dependabot
|
|
95
95
|
"/_apis/git/repositories/" + source.unscoped_repo +
|
96
96
|
"/commits"
|
97
97
|
|
98
|
-
unless branch_name.to_s.empty?
|
99
|
-
commits_url += "?searchCriteria.itemVersion.version=" + branch_name
|
100
|
-
end
|
98
|
+
commits_url += "?searchCriteria.itemVersion.version=" + branch_name unless branch_name.to_s.empty?
|
101
99
|
|
102
100
|
response = get(commits_url)
|
103
101
|
|
@@ -113,9 +113,7 @@ module Dependabot
|
|
113
113
|
def load_cloned_file_if_present(filename)
|
114
114
|
path = Pathname.new(File.join(directory, filename)).cleanpath.to_path
|
115
115
|
repo_path = File.join(clone_repo_contents, path)
|
116
|
-
unless File.exist?(repo_path)
|
117
|
-
raise Dependabot::DependencyFileNotFound, path
|
118
|
-
end
|
116
|
+
raise Dependabot::DependencyFileNotFound, path unless File.exist?(repo_path)
|
119
117
|
|
120
118
|
content = File.read(repo_path)
|
121
119
|
type = if File.symlink?(repo_path)
|
@@ -135,9 +133,7 @@ module Dependabot
|
|
135
133
|
end
|
136
134
|
|
137
135
|
def fetch_file_from_host(filename, type: "file", fetch_submodules: false)
|
138
|
-
unless repo_contents_path.nil?
|
139
|
-
return load_cloned_file_if_present(filename)
|
140
|
-
end
|
136
|
+
return load_cloned_file_if_present(filename) unless repo_contents_path.nil?
|
141
137
|
|
142
138
|
path = Pathname.new(File.join(directory, filename)).cleanpath.to_path
|
143
139
|
content = _fetch_file_content(path, fetch_submodules: fetch_submodules)
|
@@ -480,10 +476,10 @@ module Dependabot
|
|
480
476
|
return path if Dir.exist?(File.join(path, ".git"))
|
481
477
|
|
482
478
|
FileUtils.mkdir_p(path)
|
483
|
-
br_opt = " --branch
|
479
|
+
br_opt = " --branch #{source.branch} --single-branch" if source.branch
|
484
480
|
SharedHelpers.run_shell_command(
|
485
481
|
<<~CMD
|
486
|
-
git clone --no-tags --no-recurse-submodules --depth
|
482
|
+
git clone --no-tags --no-recurse-submodules --depth 1#{br_opt} #{source.url} #{path}
|
487
483
|
CMD
|
488
484
|
)
|
489
485
|
path
|
@@ -21,9 +21,7 @@ module Dependabot
|
|
21
21
|
attr_reader :dependencies
|
22
22
|
|
23
23
|
def <<(dep)
|
24
|
-
unless dep.is_a?(Dependency)
|
25
|
-
raise ArgumentError, "must be a Dependency object"
|
26
|
-
end
|
24
|
+
raise ArgumentError, "must be a Dependency object" unless dep.is_a?(Dependency)
|
27
25
|
|
28
26
|
existing_dependency = dependency_for_name(dep.name)
|
29
27
|
|
@@ -40,9 +38,7 @@ module Dependabot
|
|
40
38
|
end
|
41
39
|
|
42
40
|
def +(other)
|
43
|
-
unless other.is_a?(DependencySet)
|
44
|
-
raise ArgumentError, "must be a DependencySet"
|
45
|
-
end
|
41
|
+
raise ArgumentError, "must be a DependencySet" unless other.is_a?(DependencySet)
|
46
42
|
|
47
43
|
other.dependencies.each { |dep| self << dep }
|
48
44
|
self
|
@@ -23,7 +23,7 @@ module Dependabot
|
|
23
23
|
)
|
24
24
|
|
25
25
|
status = SharedHelpers.run_shell_command(
|
26
|
-
"git status --untracked-files
|
26
|
+
"git status --untracked-files all --porcelain v1 #{relative_dir}"
|
27
27
|
)
|
28
28
|
changed_paths = status.split("\n").map { |l| l.split(" ") }
|
29
29
|
changed_paths.map do |type, path|
|
@@ -93,9 +93,7 @@ module Dependabot
|
|
93
93
|
select { |t| version_tag?(t.name) && matches_existing_prefix?(t.name) }
|
94
94
|
filtered = tags.
|
95
95
|
reject { |t| tag_included_in_ignore_reqs?(t) }
|
96
|
-
if @raise_on_ignored && tags.any? && filtered.empty?
|
97
|
-
raise Dependabot::AllVersionsIgnored
|
98
|
-
end
|
96
|
+
raise Dependabot::AllVersionsIgnored if @raise_on_ignored && tags.any? && filtered.empty?
|
99
97
|
|
100
98
|
tag = filtered.
|
101
99
|
reject { |t| tag_is_prerelease?(t) && !wants_prerelease? }.
|
@@ -52,13 +52,9 @@ module Dependabot
|
|
52
52
|
response = fetch_raw_upload_pack_for(uri)
|
53
53
|
return response.body if response.status == 200
|
54
54
|
|
55
|
-
unless uri.match?(KNOWN_HOSTS)
|
56
|
-
raise Dependabot::GitDependenciesNotReachable, [uri]
|
57
|
-
end
|
55
|
+
raise Dependabot::GitDependenciesNotReachable, [uri] unless uri.match?(KNOWN_HOSTS)
|
58
56
|
|
59
|
-
if response.status < 400
|
60
|
-
raise "Unexpected response: #{response.status} - #{response.body}"
|
61
|
-
end
|
57
|
+
raise "Unexpected response: #{response.status} - #{response.body}" if response.status < 400
|
62
58
|
|
63
59
|
if uri.match?(/github\.com/i)
|
64
60
|
response = response.data
|
@@ -100,9 +100,7 @@ module Dependabot
|
|
100
100
|
# rubocop:enable Metrics/PerceivedComplexity
|
101
101
|
|
102
102
|
def changelog_from_suggested_url
|
103
|
-
if defined?(@changelog_from_suggested_url)
|
104
|
-
return @changelog_from_suggested_url
|
105
|
-
end
|
103
|
+
return @changelog_from_suggested_url if defined?(@changelog_from_suggested_url)
|
106
104
|
return unless suggested_changelog_url
|
107
105
|
|
108
106
|
# TODO: Support other providers
|
@@ -51,9 +51,7 @@ module Dependabot
|
|
51
51
|
def new_tag
|
52
52
|
new_version = dependency.version
|
53
53
|
|
54
|
-
if git_source?(dependency.requirements) && git_sha?(new_version)
|
55
|
-
return new_version
|
56
|
-
end
|
54
|
+
return new_version if git_source?(dependency.requirements) && git_sha?(new_version)
|
57
55
|
|
58
56
|
return new_ref if new_ref && ref_changed?
|
59
57
|
|
@@ -98,9 +96,7 @@ module Dependabot
|
|
98
96
|
end
|
99
97
|
|
100
98
|
def version_from_tag(tag)
|
101
|
-
if version_class.correct?(tag.gsub(/^v/, ""))
|
102
|
-
version_class.new(tag.gsub(/^v/, ""))
|
103
|
-
end
|
99
|
+
version_class.new(tag.gsub(/^v/, "")) if version_class.correct?(tag.gsub(/^v/, ""))
|
104
100
|
|
105
101
|
return unless tag.gsub(/^[^\d]*/, "").length > 1
|
106
102
|
return unless version_class.correct?(tag.gsub(/^[^\d]*/, ""))
|
@@ -156,9 +152,7 @@ module Dependabot
|
|
156
152
|
def tag_matches_version?(tag, version)
|
157
153
|
return false unless version
|
158
154
|
|
159
|
-
unless version_class.correct?(version)
|
160
|
-
return tag.match?(/(?:[^0-9\.]|\A)#{Regexp.escape(version)}\z/)
|
161
|
-
end
|
155
|
+
return tag.match?(/(?:[^0-9\.]|\A)#{Regexp.escape(version)}\z/) unless version_class.correct?(version)
|
162
156
|
|
163
157
|
version_regex = GitCommitChecker::VERSION_REGEX
|
164
158
|
return false unless tag.match?(version_regex)
|
@@ -120,9 +120,7 @@ module Dependabot
|
|
120
120
|
# Version looks like a git SHA and we could be updating to a specific
|
121
121
|
# ref in which case we return that otherwise we return a shorthand sha
|
122
122
|
if dependency.version.match?(/^[0-9a-f]{40}$/)
|
123
|
-
if ref_changed?(dependency) && new_ref(dependency)
|
124
|
-
return new_ref(dependency)
|
125
|
-
end
|
123
|
+
return new_ref(dependency) if ref_changed?(dependency) && new_ref(dependency)
|
126
124
|
|
127
125
|
dependency.version[0..6]
|
128
126
|
elsif dependency.version == dependency.previous_version &&
|
@@ -443,9 +443,7 @@ module Dependabot
|
|
443
443
|
|
444
444
|
raise_custom_error err, RepoNotFound, err.message
|
445
445
|
when Octokit::UnprocessableEntity
|
446
|
-
if err.message.include?("no history in common")
|
447
|
-
raise_custom_error err, NoHistoryInCommon, err.message
|
448
|
-
end
|
446
|
+
raise_custom_error err, NoHistoryInCommon, err.message if err.message.include?("no history in common")
|
449
447
|
|
450
448
|
raise err
|
451
449
|
else
|
@@ -92,9 +92,7 @@ module Dependabot
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def create_commit
|
95
|
-
if files.count == 1 && files.first.type == "submodule"
|
96
|
-
return create_submodule_update_commit
|
97
|
-
end
|
95
|
+
return create_submodule_update_commit if files.count == 1 && files.first.type == "submodule"
|
98
96
|
|
99
97
|
actions = files.map do |file|
|
100
98
|
if file.type == "symlink"
|
@@ -169,13 +169,9 @@ module Dependabot
|
|
169
169
|
|
170
170
|
# rubocop:disable Metrics/PerceivedComplexity
|
171
171
|
def version_commit_message_intro
|
172
|
-
if dependencies.count > 1 && updating_a_property?
|
173
|
-
return multidependency_property_intro
|
174
|
-
end
|
172
|
+
return multidependency_property_intro if dependencies.count > 1 && updating_a_property?
|
175
173
|
|
176
|
-
if dependencies.count > 1 && updating_a_dependency_set?
|
177
|
-
return dependency_set_intro
|
178
|
-
end
|
174
|
+
return dependency_set_intro if dependencies.count > 1 && updating_a_dependency_set?
|
179
175
|
|
180
176
|
return multidependency_intro if dependencies.count > 1
|
181
177
|
|
@@ -184,9 +180,7 @@ module Dependabot
|
|
184
180
|
"#{from_version_msg(previous_version(dependency))}"\
|
185
181
|
"to #{new_version(dependency)}."
|
186
182
|
|
187
|
-
if switching_from_ref_to_release?(dependency)
|
188
|
-
msg += " This release includes the previously tagged commit."
|
189
|
-
end
|
183
|
+
msg += " This release includes the previously tagged commit." if switching_from_ref_to_release?(dependency)
|
190
184
|
|
191
185
|
if vulnerabilities_fixed[dependency.name]&.one?
|
192
186
|
msg += " **This update includes a security fix.**"
|
@@ -272,9 +266,7 @@ module Dependabot
|
|
272
266
|
end
|
273
267
|
|
274
268
|
def metadata_links
|
275
|
-
if dependencies.count == 1
|
276
|
-
return metadata_links_for_dep(dependencies.first)
|
277
|
-
end
|
269
|
+
return metadata_links_for_dep(dependencies.first) if dependencies.count == 1
|
278
270
|
|
279
271
|
dependencies.map do |dep|
|
280
272
|
"\n\nUpdates `#{dep.display_name}` "\
|
@@ -294,9 +286,7 @@ module Dependabot
|
|
294
286
|
end
|
295
287
|
|
296
288
|
def metadata_cascades
|
297
|
-
if dependencies.one?
|
298
|
-
return metadata_cascades_for_dep(dependencies.first)
|
299
|
-
end
|
289
|
+
return metadata_cascades_for_dep(dependencies.first) if dependencies.one?
|
300
290
|
|
301
291
|
dependencies.map do |dep|
|
302
292
|
msg = "\nUpdates `#{dep.display_name}` "\
|
@@ -375,9 +365,7 @@ module Dependabot
|
|
375
365
|
end
|
376
366
|
|
377
367
|
if dependency.previous_version.match?(/^[0-9a-f]{40}$/)
|
378
|
-
if ref_changed?(dependency) && previous_ref(dependency)
|
379
|
-
return previous_ref(dependency)
|
380
|
-
end
|
368
|
+
return previous_ref(dependency) if ref_changed?(dependency) && previous_ref(dependency)
|
381
369
|
|
382
370
|
"`#{dependency.previous_version[0..6]}`"
|
383
371
|
elsif dependency.version == dependency.previous_version &&
|
@@ -391,9 +379,7 @@ module Dependabot
|
|
391
379
|
|
392
380
|
def new_version(dependency)
|
393
381
|
if dependency.version.match?(/^[0-9a-f]{40}$/)
|
394
|
-
if ref_changed?(dependency) && new_ref(dependency)
|
395
|
-
return new_ref(dependency)
|
396
|
-
end
|
382
|
+
return new_ref(dependency) if ref_changed?(dependency) && new_ref(dependency)
|
397
383
|
|
398
384
|
"`#{dependency.version[0..6]}`"
|
399
385
|
elsif dependency.version == dependency.previous_version &&
|
@@ -448,9 +434,7 @@ module Dependabot
|
|
448
434
|
|
449
435
|
req = updated_reqs.first.fetch(:requirement)
|
450
436
|
return req if req
|
451
|
-
if ref_changed?(dependency) && new_ref(dependency)
|
452
|
-
return new_ref(dependency)
|
453
|
-
end
|
437
|
+
return new_ref(dependency) if ref_changed?(dependency) && new_ref(dependency)
|
454
438
|
|
455
439
|
raise "No new requirement!"
|
456
440
|
end
|
@@ -159,9 +159,7 @@ module Dependabot
|
|
159
159
|
def serialized_vulnerability_details(details)
|
160
160
|
msg = vulnerability_source_line(details)
|
161
161
|
|
162
|
-
if details["title"]
|
163
|
-
msg += "> **#{details['title'].lines.map(&:strip).join(' ')}**\n"
|
164
|
-
end
|
162
|
+
msg += "> **#{details['title'].lines.map(&:strip).join(' ')}**\n" if details["title"]
|
165
163
|
|
166
164
|
if (description = details["description"])
|
167
165
|
description.strip.lines.first(20).each { |line| msg += "> #{line}" }
|
@@ -42,13 +42,9 @@ module Dependabot
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def capitalize_first_word?
|
45
|
-
if commit_message_options.key?(:prefix)
|
46
|
-
return !commit_message_options[:prefix]&.strip&.match?(/\A[a-z]/)
|
47
|
-
end
|
45
|
+
return !commit_message_options[:prefix]&.strip&.match?(/\A[a-z]/) if commit_message_options.key?(:prefix)
|
48
46
|
|
49
|
-
if last_dependabot_commit_style
|
50
|
-
return capitalise_first_word_from_last_dependabot_commit_style
|
51
|
-
end
|
47
|
+
return capitalise_first_word_from_last_dependabot_commit_style if last_dependabot_commit_style
|
52
48
|
|
53
49
|
capitalise_first_word_from_previous_commits
|
54
50
|
end
|
@@ -63,15 +59,11 @@ module Dependabot
|
|
63
59
|
|
64
60
|
def commit_prefix
|
65
61
|
# If a preferred prefix has been explicitly provided, use it
|
66
|
-
if commit_message_options.key?(:prefix)
|
67
|
-
return prefix_from_explicitly_provided_details
|
68
|
-
end
|
62
|
+
return prefix_from_explicitly_provided_details if commit_message_options.key?(:prefix)
|
69
63
|
|
70
64
|
# Otherwise, if there is a previous Dependabot commit and it used a
|
71
65
|
# known style, use that as our model for subsequent commits
|
72
|
-
if last_dependabot_commit_style
|
73
|
-
return prefix_for_last_dependabot_commit_style
|
74
|
-
end
|
66
|
+
return prefix_for_last_dependabot_commit_style if last_dependabot_commit_style
|
75
67
|
|
76
68
|
# Otherwise we need to detect the user's preferred style from the
|
77
69
|
# existing commits on their repo
|
@@ -89,9 +81,7 @@ module Dependabot
|
|
89
81
|
end
|
90
82
|
|
91
83
|
def explicitly_provided_prefix_string
|
92
|
-
unless commit_message_options.key?(:prefix)
|
93
|
-
raise "No explicitly provided prefix!"
|
94
|
-
end
|
84
|
+
raise "No explicitly provided prefix!" unless commit_message_options.key?(:prefix)
|
95
85
|
|
96
86
|
if dependencies.any?(&:production?)
|
97
87
|
commit_message_options[:prefix].to_s
|
@@ -181,9 +171,7 @@ module Dependabot
|
|
181
171
|
end
|
182
172
|
|
183
173
|
# Definitely not using Angular commits if < 30% match angular commits
|
184
|
-
if angular_messages.count.to_f / recent_commit_messages.count < 0.3
|
185
|
-
return false
|
186
|
-
end
|
174
|
+
return false if angular_messages.count.to_f / recent_commit_messages.count < 0.3
|
187
175
|
|
188
176
|
eslint_only_pres = ESLINT_PREFIXES.map(&:downcase) - ANGULAR_PREFIXES
|
189
177
|
angular_only_pres = ANGULAR_PREFIXES - ESLINT_PREFIXES.map(&:downcase)
|
@@ -244,9 +232,7 @@ module Dependabot
|
|
244
232
|
"build"
|
245
233
|
end
|
246
234
|
|
247
|
-
if capitalize_angular_commit_prefix?
|
248
|
-
commit_prefix = commit_prefix.capitalize
|
249
|
-
end
|
235
|
+
commit_prefix = commit_prefix.capitalize if capitalize_angular_commit_prefix?
|
250
236
|
|
251
237
|
commit_prefix
|
252
238
|
end
|
@@ -256,9 +242,7 @@ module Dependabot
|
|
256
242
|
ANGULAR_PREFIXES.any? { |pre| message.match?(/#{pre}[:(]/i) }
|
257
243
|
end
|
258
244
|
|
259
|
-
if semantic_messages.none?
|
260
|
-
return last_dependabot_commit_message&.start_with?(/[A-Z]/)
|
261
|
-
end
|
245
|
+
return last_dependabot_commit_message&.start_with?(/[A-Z]/) if semantic_messages.none?
|
262
246
|
|
263
247
|
capitalized_msgs = semantic_messages.
|
264
248
|
select { |m| m.start_with?(/[A-Z]/) }
|
@@ -83,13 +83,20 @@ module Dependabot
|
|
83
83
|
Shellwords.join(command_parts)
|
84
84
|
end
|
85
85
|
|
86
|
+
# rubocop:disable Metrics/MethodLength
|
86
87
|
def self.run_helper_subprocess(command:, function:, args:, env: nil,
|
87
88
|
stderr_to_stdout: false,
|
88
|
-
|
89
|
+
allow_unsafe_shell_command: false)
|
89
90
|
start = Time.now
|
90
91
|
stdin_data = JSON.dump(function: function, args: args)
|
91
|
-
cmd =
|
92
|
+
cmd = allow_unsafe_shell_command ? command : escape_command(command)
|
92
93
|
env_cmd = [env, cmd].compact
|
94
|
+
if ENV["DEBUG_FUNCTION"] == function
|
95
|
+
escaped_stdin_data = stdin_data.gsub("\"", "\\\"")
|
96
|
+
puts "$ cd #{Dir.pwd} && echo \"#{escaped_stdin_data}\" | #{env_cmd.join(' ')}"
|
97
|
+
# Pause execution so we can run helpers inside the temporary directory
|
98
|
+
byebug # rubocop:disable Lint/Debugger
|
99
|
+
end
|
93
100
|
stdout, stderr, process = Open3.capture3(*env_cmd, stdin_data: stdin_data)
|
94
101
|
time_taken = Time.now - start
|
95
102
|
|
@@ -129,6 +136,7 @@ module Dependabot
|
|
129
136
|
error_context: error_context
|
130
137
|
)
|
131
138
|
end
|
139
|
+
# rubocop:enable Metrics/MethodLength
|
132
140
|
|
133
141
|
def self.excon_middleware
|
134
142
|
Excon.defaults[:middlewares] +
|
@@ -176,15 +184,23 @@ module Dependabot
|
|
176
184
|
# Note: we use --global here (rather than --system) so that Dependabot
|
177
185
|
# can be run without privileged access
|
178
186
|
run_shell_command(
|
179
|
-
|
180
|
-
"insteadOf ssh://git@github.com/
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
"insteadOf git@github.com:
|
185
|
-
|
186
|
-
|
187
|
-
|
187
|
+
"git config --global --replace-all url.https://github.com/."\
|
188
|
+
"insteadOf ssh://git@github.com/"
|
189
|
+
)
|
190
|
+
run_shell_command(
|
191
|
+
"git config --global --add url.https://github.com/."\
|
192
|
+
"insteadOf ssh://git@github.com:"
|
193
|
+
)
|
194
|
+
run_shell_command(
|
195
|
+
"git config --global --add url.https://github.com/."\
|
196
|
+
"insteadOf git@github.com:"
|
197
|
+
)
|
198
|
+
run_shell_command(
|
199
|
+
"git config --global --add url.https://github.com/."\
|
200
|
+
"insteadOf git@github.com/"
|
201
|
+
)
|
202
|
+
run_shell_command(
|
203
|
+
"git config --global --add url.https://github.com/."\
|
188
204
|
"insteadOf git://github.com/"
|
189
205
|
)
|
190
206
|
end
|
@@ -199,7 +215,8 @@ module Dependabot
|
|
199
215
|
File.join(__dir__, "../../bin/git-credential-store-immutable")
|
200
216
|
run_shell_command(
|
201
217
|
"git config --global credential.helper "\
|
202
|
-
"'!#{credential_helper_path} --file
|
218
|
+
"'!#{credential_helper_path} --file #{Dir.pwd}/git.store'",
|
219
|
+
allow_unsafe_shell_command: true
|
203
220
|
)
|
204
221
|
|
205
222
|
github_credentials = credentials.
|
@@ -237,7 +254,8 @@ module Dependabot
|
|
237
254
|
|
238
255
|
def self.reset_git_repo(path)
|
239
256
|
Dir.chdir(path) do
|
240
|
-
run_shell_command("git reset HEAD --hard
|
257
|
+
run_shell_command("git reset HEAD --hard")
|
258
|
+
run_shell_command("git clean -fx")
|
241
259
|
end
|
242
260
|
end
|
243
261
|
|
@@ -262,9 +280,10 @@ module Dependabot
|
|
262
280
|
FileUtils.mv(backup_path, GIT_CONFIG_GLOBAL_PATH)
|
263
281
|
end
|
264
282
|
|
265
|
-
def self.run_shell_command(command)
|
283
|
+
def self.run_shell_command(command, allow_unsafe_shell_command: false)
|
266
284
|
start = Time.now
|
267
|
-
|
285
|
+
cmd = allow_unsafe_shell_command ? command : escape_command(command)
|
286
|
+
stdout, process = Open3.capture2e(cmd)
|
268
287
|
time_taken = Time.now - start
|
269
288
|
|
270
289
|
# Raise an error with the output from the shell session if the
|
@@ -272,7 +291,7 @@ module Dependabot
|
|
272
291
|
return stdout if process.success?
|
273
292
|
|
274
293
|
error_context = {
|
275
|
-
command:
|
294
|
+
command: cmd,
|
276
295
|
time_taken: time_taken,
|
277
296
|
process_exit_value: process.to_s
|
278
297
|
}
|
@@ -48,9 +48,7 @@ module Dependabot
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def updated_dependencies(requirements_to_unlock:)
|
51
|
-
unless can_update?(requirements_to_unlock: requirements_to_unlock)
|
52
|
-
return []
|
53
|
-
end
|
51
|
+
return [] unless can_update?(requirements_to_unlock: requirements_to_unlock)
|
54
52
|
|
55
53
|
case requirements_to_unlock&.to_sym
|
56
54
|
when :none then [updated_dependency_without_unlock]
|
@@ -93,6 +91,16 @@ module Dependabot
|
|
93
91
|
raise NotImplementedError
|
94
92
|
end
|
95
93
|
|
94
|
+
# Finds any dependencies in the lockfile that have a subdependency on the
|
95
|
+
# given dependency that do not satisfy the target_version.
|
96
|
+
# @return [Array<Hash{String => String}]
|
97
|
+
# name [String] the blocking dependencies name
|
98
|
+
# version [String] the version of the blocking dependency
|
99
|
+
# requirement [String] the requirement on the target_dependency
|
100
|
+
def conflicting_dependencies
|
101
|
+
[] # return an empty array for ecosystems that don't support this yet
|
102
|
+
end
|
103
|
+
|
96
104
|
def latest_resolvable_previous_version(_updated_version)
|
97
105
|
dependency.version
|
98
106
|
end
|
data/lib/dependabot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.125.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-codecommit
|
@@ -320,14 +320,14 @@ dependencies:
|
|
320
320
|
requirements:
|
321
321
|
- - "~>"
|
322
322
|
- !ruby/object:Gem::Version
|
323
|
-
version: 0.
|
323
|
+
version: 0.8.0
|
324
324
|
type: :development
|
325
325
|
prerelease: false
|
326
326
|
version_requirements: !ruby/object:Gem::Requirement
|
327
327
|
requirements:
|
328
328
|
- - "~>"
|
329
329
|
- !ruby/object:Gem::Version
|
330
|
-
version: 0.
|
330
|
+
version: 0.8.0
|
331
331
|
- !ruby/object:Gem::Dependency
|
332
332
|
name: vcr
|
333
333
|
requirement: !ruby/object:Gem::Requirement
|