Class: Dependabot::Terraform::UpdateChecker

Inherits:
UpdateCheckers::Base
  • Object
show all
Defined in:
lib/dependabot/terraform/update_checker.rb

Constant Summary collapse

ELIGIBLE_SOURCE_TYPES =
%w(git provider registry).freeze

Instance Method Summary collapse

Instance Method Details

#latest_resolvable_versionObject


23
24
25
26
27
# File 'lib/dependabot/terraform/update_checker.rb', line 23

def latest_resolvable_version
  # No concept of resolvability for terraform modules (that we're aware
  # of - there may be in future).
  latest_version
end

#latest_resolvable_version_with_no_unlockObject


29
30
31
32
# File 'lib/dependabot/terraform/update_checker.rb', line 29

def latest_resolvable_version_with_no_unlock
  # Irrelevant, since Terraform doesn't have a lockfile
  nil
end

#latest_versionObject


16
17
18
19
20
21
# File 'lib/dependabot/terraform/update_checker.rb', line 16

def latest_version
  return latest_version_for_git_dependency if git_dependency?
  return latest_version_for_registry_dependency if registry_dependency?
  return latest_version_for_provider_dependency if provider_dependency?
  # Other sources (mercurial, path dependencies) just return `nil`
end

#requirement_classObject


48
49
50
# File 'lib/dependabot/terraform/update_checker.rb', line 48

def requirement_class
  Requirement
end

#requirements_unlocked_or_can_be?Boolean

Returns:

  • (Boolean)

42
43
44
45
46
# File 'lib/dependabot/terraform/update_checker.rb', line 42

def requirements_unlocked_or_can_be?
  # If the requirement comes from a proxy URL then there's no way for
  # us to update it
  !proxy_requirement?
end

#updated_requirementsObject


34
35
36
37
38
39
40
# File 'lib/dependabot/terraform/update_checker.rb', line 34

def updated_requirements
  RequirementsUpdater.new(
    requirements: dependency.requirements,
    latest_version: latest_version&.to_s,
    tag_for_latest_version: tag_for_latest_version
  ).updated_requirements
end

#version_classObject


52
53
54
# File 'lib/dependabot/terraform/update_checker.rb', line 52

def version_class
  Version
end