dependabot-maven 0.387.0 → 0.388.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/maven/shared/shared_version_finder.rb +57 -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: 951a20d7fac5dc6beedafd9b643fe65bb72871db3acfa313b2d3e60feb3a9f21
|
|
4
|
+
data.tar.gz: cdaa999ecefd1c4d258fffe994e693ed6e513517d9cf8a19c2636d836efc92ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 848e06c949c709f137dcc6dfea9846c3e70e92459cb55630e1d8e299d78c24f7a2c85cc4db37d6e6968a2e09e34f97d8a4a94c09b473196813f67768ba80898e
|
|
7
|
+
data.tar.gz: 673d58a9c21b555e0ee4161bea4a8bfe05d1dea29c3c8b7be907067b781e85ccc6ec2c2432b8063a876aaa4394fb4fb227c8f14397ef9d7fc54348aca1d6f808
|
|
@@ -5,7 +5,7 @@ require "sorbet-runtime"
|
|
|
5
5
|
require "dependabot/file_fetchers"
|
|
6
6
|
require "dependabot/file_fetchers/base"
|
|
7
7
|
require "dependabot/package/package_latest_version_finder"
|
|
8
|
-
|
|
8
|
+
require "date"
|
|
9
9
|
module Dependabot
|
|
10
10
|
module Maven
|
|
11
11
|
module Shared
|
|
@@ -68,6 +68,9 @@ module Dependabot
|
|
|
68
68
|
|
|
69
69
|
return true if upgrade_to_stable?(current, candidate)
|
|
70
70
|
|
|
71
|
+
# If either version contains a date, consider them compatible
|
|
72
|
+
return true if contains_date?(current) || contains_date?(candidate)
|
|
73
|
+
|
|
71
74
|
suffix_compatible?(current, candidate)
|
|
72
75
|
end
|
|
73
76
|
|
|
@@ -178,6 +181,8 @@ module Dependabot
|
|
|
178
181
|
|
|
179
182
|
return true if contains_git_sha?(current_suffix) || contains_git_sha?(candidate_suffix)
|
|
180
183
|
|
|
184
|
+
return true if contains_date?(current_suffix) || contains_date?(candidate_suffix)
|
|
185
|
+
|
|
181
186
|
# If both versions share the exact suffix or no suffix, they are compatible
|
|
182
187
|
current_suffix == candidate_suffix
|
|
183
188
|
end
|
|
@@ -236,6 +241,57 @@ module Dependabot
|
|
|
236
241
|
git_sha?(version.gsub(/[-._]/, ""))
|
|
237
242
|
end
|
|
238
243
|
|
|
244
|
+
# Determines whether a version string contains a date.
|
|
245
|
+
#
|
|
246
|
+
# This method checks if any part of a version string (when split by common
|
|
247
|
+
# delimiters like '-', '.', or '_') is a valid date.
|
|
248
|
+
#
|
|
249
|
+
# @example Standard delimiter-separated dates
|
|
250
|
+
# contains_date?("2025-12-16-05-04") # => true
|
|
251
|
+
# contains_date?("2025_12_16_05_04") # => true
|
|
252
|
+
# contains_date?("1.0-2025_12_16_05_04") # => true
|
|
253
|
+
# @example Compact date formats
|
|
254
|
+
# contains_date?("20251216") # => true
|
|
255
|
+
#
|
|
256
|
+
# contains_date?("1.2.3-alpha") # => false
|
|
257
|
+
# contains_date?("abcdef123") # => false
|
|
258
|
+
sig { params(version: T.nilable(String)).returns(T::Boolean) }
|
|
259
|
+
def contains_date?(version)
|
|
260
|
+
return false unless version
|
|
261
|
+
|
|
262
|
+
parts = T.let(T.cast(version.scan(/\d+/), T::Array[String]).map(&:to_i), T::Array[Integer])
|
|
263
|
+
|
|
264
|
+
case parts.length
|
|
265
|
+
when 2
|
|
266
|
+
# Example: "2024.1"
|
|
267
|
+
year, month = parts
|
|
268
|
+
valid_date_parts?(year, month, 1)
|
|
269
|
+
when 3
|
|
270
|
+
# Example: https://github.com/relizaio/versioning/releases/tag/versioning-2026.01.7
|
|
271
|
+
year, month, day = parts
|
|
272
|
+
valid_date_parts?(year, month, day)
|
|
273
|
+
when 4, 5
|
|
274
|
+
# Examples:
|
|
275
|
+
# https://github.com/relizaio/versioning/releases/tag/2019.05.Stable.3
|
|
276
|
+
# 2025_12_16_05_04 used in https://github.com/dependabot/dependabot-core/issues/14084
|
|
277
|
+
year, month, day, = parts
|
|
278
|
+
# Just validate the date part ignoring the build number
|
|
279
|
+
valid_date_parts?(year, month, day)
|
|
280
|
+
else
|
|
281
|
+
false
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
sig { params(year: T.nilable(Integer), month: T.nilable(Integer), day: T.nilable(Integer)).returns(T::Boolean) }
|
|
286
|
+
def valid_date_parts?(year, month, day)
|
|
287
|
+
# Require 4-digit year to avoid matching short version numbers like "1.2.3"
|
|
288
|
+
return false unless year && year > 999
|
|
289
|
+
return false unless month&.between?(1, 12)
|
|
290
|
+
return false unless day&.between?(1, 31)
|
|
291
|
+
|
|
292
|
+
Date.valid_date?(year, month, day)
|
|
293
|
+
end
|
|
294
|
+
|
|
239
295
|
# Determines whether two versions are compatible based on pre-release status.
|
|
240
296
|
#
|
|
241
297
|
# Two versions are considered compatible if both are pre-release versions.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-maven
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.388.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.388.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.388.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rexml
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -292,7 +292,7 @@ licenses:
|
|
|
292
292
|
- MIT
|
|
293
293
|
metadata:
|
|
294
294
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
295
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
295
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.388.0
|
|
296
296
|
rdoc_options: []
|
|
297
297
|
require_paths:
|
|
298
298
|
- lib
|