Skip to content

Improve interface of RunnerUpgradeCheck

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR addresses #367848 (closed) by doing the following:

  • Improve the internal implementation of Gitlab::Ci::RunnerUpgradeCheck to generate multiple suggestions keyed by version instead of status. This makes it so there can't be 2 distinct status for the same version, e.g. 14.0.1 can't be suggested both as :recommended and :available

  • Return the top suggestion as an array of two elements, making for easier consumption by users of the class:

    _, new_status = upgrade_check.check_runner_upgrade_suggestion(runner_version.version)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

No functional changes are expected from this refactor. There are integration tests both for Ci::Runners::ReconcileExistingRunnerVersionsService and EE::Types::Ci::RunnerType#upgrade_status that ensure that the usage is not broken.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Pedro Pombeiro

Merge request reports

Loading