Class: Dependabot::Maven::UpdateChecker
- Inherits:
-
UpdateCheckers::Base
- Object
- UpdateCheckers::Base
- Dependabot::Maven::UpdateChecker
show all
- Defined in:
- lib/dependabot/maven/update_checker.rb,
lib/dependabot/maven/update_checker/version_finder.rb,
lib/dependabot/maven/update_checker/property_updater.rb,
lib/dependabot/maven/update_checker/requirements_updater.rb
Defined Under Namespace
Classes: PropertyUpdater, RequirementsUpdater, VersionFinder
Instance Method Summary
collapse
Instance Method Details
#latest_resolvable_version ⇒ Object
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/dependabot/maven/update_checker.rb', line 19
def latest_resolvable_version
return nil if version_comes_from_multi_dependency_property?
latest_version
end
|
#latest_resolvable_version_with_no_unlock ⇒ Object
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/dependabot/maven/update_checker.rb', line 38
def latest_resolvable_version_with_no_unlock
nil
end
|
#latest_version ⇒ Object
15
16
17
|
# File 'lib/dependabot/maven/update_checker.rb', line 15
def latest_version
latest_version_details&.fetch(:version)
end
|
#lowest_resolvable_security_fix_version ⇒ Object
34
35
36
|
# File 'lib/dependabot/maven/update_checker.rb', line 34
def lowest_resolvable_security_fix_version
lowest_security_fix_version
end
|
#lowest_security_fix_version ⇒ Object
30
31
32
|
# File 'lib/dependabot/maven/update_checker.rb', line 30
def lowest_security_fix_version
lowest_security_fix_version_details&.fetch(:version)
end
|
#requirements_unlocked_or_can_be? ⇒ Boolean
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/dependabot/maven/update_checker.rb', line 62
def requirements_unlocked_or_can_be?
declarations_using_a_property.none? do |requirement|
prop_name = requirement.dig(:metadata, :property_name)
pom = dependency_files.find { |f| f.name == requirement[:file] }
declaration_pom_name =
property_value_finder
.property_details(property_name: prop_name, callsite_pom: pom)
&.fetch(:file)
declaration_pom_name == "remote_pom.xml"
end
end
|
#updated_requirements ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/dependabot/maven/update_checker.rb', line 49
def updated_requirements
property_names =
declarations_using_a_property
.map { |req| req.dig(:metadata, :property_name) }
RequirementsUpdater.new(
requirements: dependency.requirements,
latest_version: preferred_resolvable_version&.to_s,
source_url: preferred_version_details&.fetch(:source_url),
properties_to_update: property_names
).updated_requirements
end
|