Class: Dependabot::Vcpkg::UpdateChecker

Inherits:
UpdateCheckers::Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/vcpkg/update_checker.rb,
lib/dependabot/vcpkg/update_checker/latest_version_finder.rb,
lib/dependabot/vcpkg/update_checker/security_fix_resolver.rb

Defined Under Namespace

Classes: LatestVersionFinder, SecurityFixResolver

Instance Method Summary collapse

Instance Method Details

#latest_resolvable_previous_version(_updated_version) ⇒ Object



56
57
58
59
60
61
# File 'lib/dependabot/vcpkg/update_checker.rb', line 56

def latest_resolvable_previous_version(_updated_version)
  current_version = dependency.version
  return current_version unless registry_dependency? && current_version&.match?(/\A[0-9a-f]{40}\z/)

  latest_version_finder.tag_for_commit_sha(current_version) || current_version
end

#latest_resolvable_versionObject



41
# File 'lib/dependabot/vcpkg/update_checker.rb', line 41

def latest_resolvable_version = latest_version

#latest_resolvable_version_with_no_unlockObject



44
# File 'lib/dependabot/vcpkg/update_checker.rb', line 44

def latest_resolvable_version_with_no_unlock = latest_version

#latest_versionObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dependabot/vcpkg/update_checker.rb', line 21

def latest_version
  # A security fix may pin a version the baseline would never select, so it decides where
  # this dependency is heading.
  fix = security_fix
  return fix.version if fix

  # A port with no `version>=` constraint takes its version from the registry baseline, so
  # the way to move it forwards is to move the baseline. Reporting it as already current
  # keeps routine runs from pinning a constraint the manifest never had.
  return dependency.numeric_version if baseline_governed?

  @latest_version ||= T.let(
    latest_version_finder.latest_version,
    T.nilable(T.any(String, Dependabot::Version))
  )
end

#lowest_resolvable_security_fix_versionObject



51
# File 'lib/dependabot/vcpkg/update_checker.rb', line 51

def lowest_resolvable_security_fix_version = lowest_security_fix_version

#lowest_security_fix_versionObject



47
# File 'lib/dependabot/vcpkg/update_checker.rb', line 47

def lowest_security_fix_version = security_fix&.version

#updated_requirementsObject



64
65
66
67
68
69
70
# File 'lib/dependabot/vcpkg/update_checker.rb', line 64

def updated_requirements
  fix = security_fix
  return wrap_requirements(security_updated_requirements(fix)) if fix
  return dependency.requirements unless latest_version

  wrap_requirements(dependency.requirements.map { |requirement| updated_requirement(requirement) })
end