dependabot-bundler 0.379.0 → 0.380.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/bundler/file_updater/lockfile_updater.rb +31 -0
- 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: 7c28d7f789c7e18806f0c0141599adc1c277f932587d2331f77bf54200333df9
|
|
4
|
+
data.tar.gz: bb053e4ca2a32b6cd63abd04443327f74a12df2fd6dc472a6646cde5a57e2411
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4d4fd80b03f35f2110e390984ec3b6d7111860e996f005f05abb5fdf90a6c3c4e4babc0891e15a8bda3a1b1bc563483c6389df6ca82f6eb9e9f83941a31e6c0
|
|
7
|
+
data.tar.gz: 833760e2485382ce9e0ebda893341d098bdced4c4de9c682637063c225564b528f7afb3e91688528f30ceace54fa8f6caa71ea0d9ca6364b84aa62e954c5509c
|
|
@@ -26,6 +26,10 @@ module Dependabot
|
|
|
26
26
|
LOCKFILE_ENDING = /(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m
|
|
27
27
|
GIT_DEPENDENCIES_SECTION = /GIT\n.*?\n\n(?!GIT)/m
|
|
28
28
|
GIT_DEPENDENCY_DETAILS = /GIT\n.*?\n\n/m
|
|
29
|
+
CHECKSUMS_SECTION = /(^CHECKSUMS\n)(?<entries>(?:^ .*\n)+)/m
|
|
30
|
+
BUNDLED_WITH_VERSION_REGEX = /BUNDLED WITH\s+(?<version>\d+\.\d+\.\d+)/m
|
|
31
|
+
BUNDLER_CHECKSUM_ENTRY_REGEX = /^ bundler \([^)]+\).*\n?$/
|
|
32
|
+
MIN_BUNDLER_CHECKSUM_VERSION = Gem::Version.new("4.0.11")
|
|
29
33
|
|
|
30
34
|
sig do
|
|
31
35
|
params(
|
|
@@ -221,9 +225,36 @@ module Dependabot
|
|
|
221
225
|
sig { params(lockfile_body: String).returns(String) }
|
|
222
226
|
def post_process_lockfile(lockfile_body)
|
|
223
227
|
lockfile_body = reorder_git_dependencies(lockfile_body)
|
|
228
|
+
lockfile_body = strip_new_bundler_checksum(lockfile_body)
|
|
224
229
|
replace_lockfile_ending(lockfile_body)
|
|
225
230
|
end
|
|
226
231
|
|
|
232
|
+
sig { params(lockfile_body: String).returns(String) }
|
|
233
|
+
def strip_new_bundler_checksum(lockfile_body)
|
|
234
|
+
return lockfile_body unless should_strip_bundler_checksum?
|
|
235
|
+
|
|
236
|
+
checksums_section = lockfile_body.match(CHECKSUMS_SECTION)
|
|
237
|
+
return lockfile_body unless checksums_section
|
|
238
|
+
|
|
239
|
+
entries = T.must(checksums_section[:entries])
|
|
240
|
+
stripped_entries = entries.lines.reject { |line| line.match?(BUNDLER_CHECKSUM_ENTRY_REGEX) }.join
|
|
241
|
+
|
|
242
|
+
lockfile_body.sub(CHECKSUMS_SECTION, "\\1#{stripped_entries}")
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
sig { returns(T::Boolean) }
|
|
246
|
+
def should_strip_bundler_checksum?
|
|
247
|
+
lockfile_content = T.must(lockfile).content
|
|
248
|
+
return false unless lockfile_content&.include?("CHECKSUMS\n")
|
|
249
|
+
return false if lockfile_content.match?(BUNDLER_CHECKSUM_ENTRY_REGEX)
|
|
250
|
+
|
|
251
|
+
bundled_with = lockfile_content.match(BUNDLED_WITH_VERSION_REGEX)&.[](:version)
|
|
252
|
+
return false unless bundled_with
|
|
253
|
+
|
|
254
|
+
bundled_with_version = Gem::Version.new(bundled_with)
|
|
255
|
+
bundled_with_version >= Gem::Version.new("4.0.0") && bundled_with_version < MIN_BUNDLER_CHECKSUM_VERSION
|
|
256
|
+
end
|
|
257
|
+
|
|
227
258
|
sig { params(lockfile_body: String).returns(String) }
|
|
228
259
|
def reorder_git_dependencies(lockfile_body)
|
|
229
260
|
new_section = lockfile_body.match(GIT_DEPENDENCIES_SECTION)&.to_s
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-bundler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.380.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.380.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.380.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: parallel
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -324,7 +324,7 @@ licenses:
|
|
|
324
324
|
- MIT
|
|
325
325
|
metadata:
|
|
326
326
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
327
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
327
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.380.0
|
|
328
328
|
rdoc_options: []
|
|
329
329
|
require_paths:
|
|
330
330
|
- lib
|