Class: Dependabot::GithubActions::UpdateChecker::LatestVersionFinder
- Inherits:
-
Package::PackageLatestVersionFinder
- Object
- Package::PackageLatestVersionFinder
- Dependabot::GithubActions::UpdateChecker::LatestVersionFinder
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/github_actions/update_checker/latest_version_finder.rb
Instance Attribute Summary collapse
-
#cooldown_options ⇒ Object
readonly
Returns the value of attribute cooldown_options.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#ignored_versions ⇒ Object
readonly
Returns the value of attribute ignored_versions.
-
#raise_on_ignored ⇒ Object
readonly
Returns the value of attribute raise_on_ignored.
-
#security_advisories ⇒ Object
readonly
Returns the value of attribute security_advisories.
Instance Method Summary collapse
-
#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, raise_on_ignored:, options: {}, cooldown_options: nil) ⇒ LatestVersionFinder
constructor
A new instance of LatestVersionFinder.
- #latest_release_version ⇒ Object
- #latest_version_tag ⇒ Object
- #latest_version_tag_respecting_cooldown ⇒ Object
- #lowest_security_fix_release ⇒ Object
- #package_details ⇒ Object
Constructor Details
#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, raise_on_ignored:, options: {}, cooldown_options: nil) ⇒ LatestVersionFinder
Returns a new instance of LatestVersionFinder.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 35 def initialize( dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, raise_on_ignored:, options: {}, cooldown_options: nil ) @dependency = dependency @dependency_files = dependency_files @credentials = credentials @ignored_versions = ignored_versions @security_advisories = security_advisories @raise_on_ignored = raise_on_ignored @options = @cooldown_options = @git_helper = T.let(git_helper, Dependabot::GithubActions::Helpers::Githelper) super end |
Instance Attribute Details
#cooldown_options ⇒ Object (readonly)
Returns the value of attribute cooldown_options.
65 66 67 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 65 def @cooldown_options end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
62 63 64 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 62 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
59 60 61 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 59 def dependency @dependency end |
#ignored_versions ⇒ Object (readonly)
Returns the value of attribute ignored_versions.
68 69 70 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 68 def ignored_versions @ignored_versions end |
#raise_on_ignored ⇒ Object (readonly)
Returns the value of attribute raise_on_ignored.
74 75 76 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 74 def raise_on_ignored @raise_on_ignored end |
#security_advisories ⇒ Object (readonly)
Returns the value of attribute security_advisories.
71 72 73 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 71 def security_advisories @security_advisories end |
Instance Method Details
#latest_release_version ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 80 def latest_release_version release = available_release return nil unless release Dependabot.logger.info("Available release version/ref is #{release}") release = cooldown_filter(release) if release.nil? Dependabot.logger.info("Returning current version/ref (no viable filtered release) #{current_version}") return current_version end release end |
#latest_version_tag ⇒ Object
101 102 103 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 101 def latest_version_tag available_latest_version_tag end |
#latest_version_tag_respecting_cooldown ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 106 def latest_version_tag_respecting_cooldown return @latest_version_tag_respecting_cooldown if defined?(@latest_version_tag_respecting_cooldown) @latest_version_tag_respecting_cooldown = T.let( begin selected_release = latest_release_version if selected_release.nil? || selected_release.is_a?(String) nil else latest_tag = available_latest_version_tag if latest_tag&.fetch(:version) == selected_release latest_tag else T.must(package_details_fetcher) . .find { |tag_hash| tag_hash.fetch(:version) == selected_release } end end end, T.nilable(T::Hash[Symbol, T.untyped]) ) end |
#lowest_security_fix_release ⇒ Object
96 97 98 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 96 def lowest_security_fix_release available_security_fix_releases end |
#package_details ⇒ Object
77 |
# File 'lib/dependabot/github_actions/update_checker/latest_version_finder.rb', line 77 def package_details; end |