Class: Gitlab::QA::Support::GitlabUpgradePath

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/qa/support/gitlab_upgrade_path.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_version, semver_component, edition) ⇒ GitlabUpgradePath

Get upgrade path between N - 1 and current version not including current release

Parameters:

  • current_version (String)
  • semver_component (String)

    version number component for previous version detection - major|minor|patch

  • edition (String)

    GitLab edition - ee or ce



15
16
17
18
19
20
21
# File 'lib/gitlab/qa/support/gitlab_upgrade_path.rb', line 15

def initialize(current_version, semver_component, edition)
  @version_info = GitlabVersionInfo.new(current_version, edition)
  @current_version = Gem::Version.new(current_version)
  @semver_component = semver_component
  @edition = edition
  @logger = Runtime::Logger.logger
end

Instance Method Details

#fetchArray<QA::Release>

Get upgrade path between releases

Return array with only previous version for updates from previous minor, patch versions

Returns:



28
29
30
31
32
33
34
35
# File 'lib/gitlab/qa/support/gitlab_upgrade_path.rb', line 28

def fetch
  return minor_upgrade_path unless major_upgrade?

  major_upgrade_path
rescue GitlabVersionInfo::VersionNotFoundError
  logger.error("Failed to construct gitlab upgrade path")
  raise
end