Class: Dependabot::GoModules::UpdateChecker::LatestVersionFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/go_modules/update_checker/latest_version_finder.rb

Constant Summary collapse

RESOLVABILITY_ERROR_REGEXES =
[
  # Package url/proxy doesn't include any redirect meta tags
  /no go-import meta tags/,
  # Package url 404s
  /404 Not Found/,
  /Repository not found/,
  /unrecognized import path/,
  # (Private) module could not be fetched
  /module .*: git ls-remote .*: exit status 128/m.freeze
].freeze
PSEUDO_VERSION_REGEX =
/\b\d{14}-[0-9a-f]{12}$/.freeze

Instance Method Summary collapse

Constructor Details

#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, raise_on_ignored: false) ⇒ LatestVersionFinder

Returns a new instance of LatestVersionFinder.


28
29
30
31
32
33
34
35
36
# File 'lib/dependabot/go_modules/update_checker/latest_version_finder.rb', line 28

def initialize(dependency:, dependency_files:, credentials:,
               ignored_versions:, security_advisories:, raise_on_ignored: false)
  @dependency          = dependency
  @dependency_files    = dependency_files
  @credentials         = credentials
  @ignored_versions    = ignored_versions
  @security_advisories = security_advisories
  @raise_on_ignored    = raise_on_ignored
end

Instance Method Details

#latest_versionObject


38
39
40
# File 'lib/dependabot/go_modules/update_checker/latest_version_finder.rb', line 38

def latest_version
  @latest_version ||= fetch_latest_version
end

#lowest_security_fix_versionObject


42
43
44
# File 'lib/dependabot/go_modules/update_checker/latest_version_finder.rb', line 42

def lowest_security_fix_version
  @lowest_security_fix_version ||= fetch_lowest_security_fix_version
end