dependabot-hex 0.124.7 → 0.125.3
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/hex/file_fetcher.rb +7 -6
- data/lib/dependabot/hex/file_parser.rb +3 -3
- data/lib/dependabot/hex/file_updater/lockfile_updater.rb +1 -1
- data/lib/dependabot/hex/file_updater/mixfile_git_pin_updater.rb +1 -3
- data/lib/dependabot/hex/file_updater/mixfile_requirement_updater.rb +1 -3
- data/lib/dependabot/hex/update_checker.rb +3 -9
- data/lib/dependabot/hex/update_checker/file_preparer.rb +3 -9
- data/lib/dependabot/hex/update_checker/requirements_updater.rb +2 -6
- data/lib/dependabot/hex/update_checker/version_resolver.rb +5 -12
- data/lib/dependabot/hex/version.rb +1 -3
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a36c9777c2db45cf67dd2ce2d81aaec014dd27d62edad43069deb80bad80d3fd
|
|
4
|
+
data.tar.gz: d4f53fb6fe1be904d461995842890a5ff8b07a0dd6f06d1460c7724d855fdc8e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ca5e56a99fc842eabdb7707caea000a3e7b8bfcbfd022efabb08ddfee1d05ca2ab5a7ccb17bf921157cc9dc426a5e223c239bb9b48980e6e6e8dc6cfd7f6c30
|
|
7
|
+
data.tar.gz: ca81978e969bde8dcd3fa8136a471cb16b9a96ec6fa6ba50533515806fe9671464070163fe00dc2f0c206e4a20f229ef282b32bd7f907638278e7b281ee93bab
|
|
@@ -8,8 +8,9 @@ module Dependabot
|
|
|
8
8
|
class FileFetcher < Dependabot::FileFetchers::Base
|
|
9
9
|
APPS_PATH_REGEX = /apps_path:\s*"(?<path>.*?)"/m.freeze
|
|
10
10
|
STRING_ARG = %{(?:["'](.*?)["'])}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
SUPPORTED_METHODS = %w(eval_file require_file).join("|").freeze
|
|
12
|
+
SUPPORT_FILE = /Code\.(?:#{SUPPORTED_METHODS})\(#{STRING_ARG}(?:\s*,\s*#{STRING_ARG})?\)/.
|
|
13
|
+
freeze
|
|
13
14
|
|
|
14
15
|
def self.required_files_in?(filenames)
|
|
15
16
|
filenames.include?("mix.exs")
|
|
@@ -26,7 +27,7 @@ module Dependabot
|
|
|
26
27
|
fetched_files << mixfile
|
|
27
28
|
fetched_files << lockfile if lockfile
|
|
28
29
|
fetched_files += subapp_mixfiles
|
|
29
|
-
fetched_files +=
|
|
30
|
+
fetched_files += support_files
|
|
30
31
|
fetched_files
|
|
31
32
|
end
|
|
32
33
|
|
|
@@ -66,9 +67,9 @@ module Dependabot
|
|
|
66
67
|
[]
|
|
67
68
|
end
|
|
68
69
|
|
|
69
|
-
def
|
|
70
|
-
mixfile.content.scan(
|
|
71
|
-
path = Pathname.new(File.join(*
|
|
70
|
+
def support_files
|
|
71
|
+
mixfile.content.scan(SUPPORT_FILE).map do |support_file_args|
|
|
72
|
+
path = Pathname.new(File.join(*support_file_args.compact.reverse)).
|
|
72
73
|
cleanpath.to_path
|
|
73
74
|
fetch_file_from_host(path).tap { |f| f.support_file = true }
|
|
74
75
|
end
|
|
@@ -42,7 +42,7 @@ module Dependabot
|
|
|
42
42
|
def dependency_details
|
|
43
43
|
SharedHelpers.in_a_temporary_directory do
|
|
44
44
|
write_sanitized_mixfiles
|
|
45
|
-
|
|
45
|
+
write_sanitized_supporting_files
|
|
46
46
|
File.write("mix.lock", lockfile.content) if lockfile
|
|
47
47
|
FileUtils.cp(elixir_helper_parse_deps_path, "parse_deps.exs")
|
|
48
48
|
|
|
@@ -73,11 +73,11 @@ module Dependabot
|
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
def
|
|
76
|
+
def write_sanitized_supporting_files
|
|
77
77
|
dependency_files.select(&:support_file).each do |file|
|
|
78
78
|
path = file.name
|
|
79
79
|
FileUtils.mkdir_p(Pathname.new(path).dirname)
|
|
80
|
-
File.write(path, file.content)
|
|
80
|
+
File.write(path, sanitize_mixfile(file.content))
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -18,9 +18,7 @@ module Dependabot
|
|
|
18
18
|
def updated_content
|
|
19
19
|
updated_content = update_pin(mixfile_content)
|
|
20
20
|
|
|
21
|
-
if content_should_change? && mixfile_content == updated_content
|
|
22
|
-
raise "Expected content to change!"
|
|
23
|
-
end
|
|
21
|
+
raise "Expected content to change!" if content_should_change? && mixfile_content == updated_content
|
|
24
22
|
|
|
25
23
|
updated_content
|
|
26
24
|
end
|
|
@@ -20,9 +20,7 @@ module Dependabot
|
|
|
20
20
|
def updated_content
|
|
21
21
|
updated_content = update_requirement(mixfile_content)
|
|
22
22
|
|
|
23
|
-
if content_should_change? && mixfile_content == updated_content
|
|
24
|
-
raise "Expected content to change!"
|
|
25
|
-
end
|
|
23
|
+
raise "Expected content to change!" if content_should_change? && mixfile_content == updated_content
|
|
26
24
|
|
|
27
25
|
updated_content
|
|
28
26
|
end
|
|
@@ -68,9 +68,7 @@ module Dependabot
|
|
|
68
68
|
def latest_resolvable_version_for_git_dependency
|
|
69
69
|
# If the gem isn't pinned, the latest version is just the latest
|
|
70
70
|
# commit for the specified branch.
|
|
71
|
-
unless git_commit_checker.pinned?
|
|
72
|
-
return latest_resolvable_commit_with_unchanged_git_source
|
|
73
|
-
end
|
|
71
|
+
return latest_resolvable_commit_with_unchanged_git_source unless git_commit_checker.pinned?
|
|
74
72
|
|
|
75
73
|
# If the dependency is pinned to a tag that looks like a version then
|
|
76
74
|
# we want to update that tag. The latest version will then be the SHA
|
|
@@ -103,9 +101,7 @@ module Dependabot
|
|
|
103
101
|
def latest_git_version_sha
|
|
104
102
|
# If the gem isn't pinned, the latest version is just the latest
|
|
105
103
|
# commit for the specified branch.
|
|
106
|
-
unless git_commit_checker.pinned?
|
|
107
|
-
return git_commit_checker.head_commit_for_current_branch
|
|
108
|
-
end
|
|
104
|
+
return git_commit_checker.head_commit_for_current_branch unless git_commit_checker.pinned?
|
|
109
105
|
|
|
110
106
|
# If the dependency is pinned to a tag that looks like a version then
|
|
111
107
|
# we want to update that tag. The latest version will then be the SHA
|
|
@@ -225,9 +221,7 @@ module Dependabot
|
|
|
225
221
|
ignore_reqs.any? { |r| r.satisfied_by?(v) }
|
|
226
222
|
end
|
|
227
223
|
|
|
228
|
-
if @raise_on_ignored && filtered.empty? && versions.any?
|
|
229
|
-
raise AllVersionsIgnored
|
|
230
|
-
end
|
|
224
|
+
raise AllVersionsIgnored if @raise_on_ignored && filtered.empty? && versions.any?
|
|
231
225
|
|
|
232
226
|
filtered.max
|
|
233
227
|
end
|
|
@@ -54,14 +54,10 @@ module Dependabot
|
|
|
54
54
|
def mixfile_content_for_update_check(file)
|
|
55
55
|
content = file.content
|
|
56
56
|
|
|
57
|
-
unless dependency_appears_in_file?(file.name)
|
|
58
|
-
return sanitize_mixfile(content)
|
|
59
|
-
end
|
|
57
|
+
return sanitize_mixfile(content) unless dependency_appears_in_file?(file.name)
|
|
60
58
|
|
|
61
59
|
content = relax_version(content, filename: file.name)
|
|
62
|
-
if replace_git_pin?
|
|
63
|
-
content = replace_git_pin(content, filename: file.name)
|
|
64
|
-
end
|
|
60
|
+
content = replace_git_pin(content, filename: file.name) if replace_git_pin?
|
|
65
61
|
|
|
66
62
|
sanitize_mixfile(content)
|
|
67
63
|
end
|
|
@@ -85,9 +81,7 @@ module Dependabot
|
|
|
85
81
|
lower_bound_req = updated_version_req_lower_bound(filename)
|
|
86
82
|
|
|
87
83
|
return lower_bound_req if latest_allowable_version.nil?
|
|
88
|
-
unless version_class.correct?(latest_allowable_version)
|
|
89
|
-
return lower_bound_req
|
|
90
|
-
end
|
|
84
|
+
return lower_bound_req unless version_class.correct?(latest_allowable_version)
|
|
91
85
|
|
|
92
86
|
lower_bound_req + " and <= #{latest_allowable_version}"
|
|
93
87
|
end
|
|
@@ -54,9 +54,7 @@ module Dependabot
|
|
|
54
54
|
update_mixfile_range(last_string_reqs).map(&:to_s).join(" and ")
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
if or_string_reqs.count > 1
|
|
58
|
-
new_requirement = req[:requirement] + " or " + new_requirement
|
|
59
|
-
end
|
|
57
|
+
new_requirement = req[:requirement] + " or " + new_requirement if or_string_reqs.count > 1
|
|
60
58
|
|
|
61
59
|
req.merge(requirement: new_requirement)
|
|
62
60
|
end
|
|
@@ -66,9 +64,7 @@ module Dependabot
|
|
|
66
64
|
def update_source(requirement_hash)
|
|
67
65
|
# Only git sources ever need to be updated. Anything else should be
|
|
68
66
|
# left alone.
|
|
69
|
-
unless requirement_hash.dig(:source, :type) == "git"
|
|
70
|
-
return requirement_hash
|
|
71
|
-
end
|
|
67
|
+
return requirement_hash unless requirement_hash.dig(:source, :type) == "git"
|
|
72
68
|
|
|
73
69
|
requirement_hash.merge(source: updated_source)
|
|
74
70
|
end
|
|
@@ -31,7 +31,7 @@ module Dependabot
|
|
|
31
31
|
def fetch_latest_resolvable_version
|
|
32
32
|
latest_resolvable_version =
|
|
33
33
|
SharedHelpers.in_a_temporary_directory do
|
|
34
|
-
|
|
34
|
+
write_temporary_sanitized_dependency_files
|
|
35
35
|
FileUtils.cp(
|
|
36
36
|
elixir_helper_check_update_path,
|
|
37
37
|
"check_update.exs"
|
|
@@ -43,9 +43,7 @@ module Dependabot
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
return if latest_resolvable_version.nil?
|
|
46
|
-
if latest_resolvable_version.match?(/^[0-9a-f]{40}$/)
|
|
47
|
-
return latest_resolvable_version
|
|
48
|
-
end
|
|
46
|
+
return latest_resolvable_version if latest_resolvable_version.match?(/^[0-9a-f]{40}$/)
|
|
49
47
|
|
|
50
48
|
version_class.new(latest_resolvable_version)
|
|
51
49
|
rescue SharedHelpers::HelperSubprocessFailed => e
|
|
@@ -111,7 +109,7 @@ module Dependabot
|
|
|
111
109
|
|
|
112
110
|
def check_original_requirements_resolvable
|
|
113
111
|
SharedHelpers.in_a_temporary_directory do
|
|
114
|
-
|
|
112
|
+
write_temporary_sanitized_dependency_files(prepared: false)
|
|
115
113
|
FileUtils.cp(
|
|
116
114
|
elixir_helper_check_update_path,
|
|
117
115
|
"check_update.exs"
|
|
@@ -127,7 +125,7 @@ module Dependabot
|
|
|
127
125
|
raise Dependabot::DependencyFileNotResolvable, e.message
|
|
128
126
|
end
|
|
129
127
|
|
|
130
|
-
def
|
|
128
|
+
def write_temporary_sanitized_dependency_files(prepared: true)
|
|
131
129
|
files = if prepared then prepared_dependency_files
|
|
132
130
|
else original_dependency_files
|
|
133
131
|
end
|
|
@@ -135,12 +133,7 @@ module Dependabot
|
|
|
135
133
|
files.each do |file|
|
|
136
134
|
path = file.name
|
|
137
135
|
FileUtils.mkdir_p(Pathname.new(path).dirname)
|
|
138
|
-
|
|
139
|
-
if file.name.end_with?("mix.exs")
|
|
140
|
-
File.write(path, sanitize_mixfile(file.content))
|
|
141
|
-
else
|
|
142
|
-
File.write(path, file.content)
|
|
143
|
-
end
|
|
136
|
+
File.write(path, sanitize_mixfile(file.content))
|
|
144
137
|
end
|
|
145
138
|
end
|
|
146
139
|
|
|
@@ -24,9 +24,7 @@ module Dependabot
|
|
|
24
24
|
def initialize(version)
|
|
25
25
|
@version_string = version.to_s
|
|
26
26
|
|
|
27
|
-
if version.to_s.include?("+")
|
|
28
|
-
version, @build_info = version.to_s.split("+")
|
|
29
|
-
end
|
|
27
|
+
version, @build_info = version.to_s.split("+") if version.to_s.include?("+")
|
|
30
28
|
|
|
31
29
|
super
|
|
32
30
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-hex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.125.3
|
|
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-16 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.125.3
|
|
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.125.3
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: byebug
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -128,14 +128,14 @@ dependencies:
|
|
|
128
128
|
requirements:
|
|
129
129
|
- - "~>"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 0.
|
|
131
|
+
version: 0.8.0
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
136
|
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 0.
|
|
138
|
+
version: 0.8.0
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: vcr
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|