GraphQL: Expose filter on GitLab Runner upgrade status

The goal is to be able to determine how many runners are out-of-date. To this end, we will expose an upgradeStatus argument to the query.runners query which takes a Types::Ci::RunnerUpgradeStatusTypeEnum value.

Proposal

  1. Delete background migration BackfillCiRunnerSemver as this will no longer be used.

  2. Stop using Ci::Runner#semver column

  3. Create a ci_runner_versions table.

  4. !91554 (merged) Create a cron job that periodically fills the ci_runner_versions table.

    column notes
    version contains all distinct ci_runners.version values
    status computed value relative to GitLab instance version. Needs to be recalculated whenever GitLab is upgraded, and periodically, as new runner versions get released.

    The logic used will be the following:

    GitLab version CiRunner.version latest available version N latest available version N - 1 latest available version N - 2 CiRunner.upgradeStatus Note
    14.10.1 14.10.1 15.0.0 14.10.1 14.9.2 NOT_AVAILABLE not available since the GitLab instance is still on 14.x and a major version might be incompatible
    14.10.1 14.10.1 14.10.1 14.9.2 14.8.1 NOT_AVAILABLE not available since we're already on latest known version
    14.10.1 14.10.0 14.10.1 14.9.2 14.8.1 RECOMMENDED recommended upgrade since 14.10.1 is available
    14.10.1 14.10.1-rc1 14.10.1 14.9.2 14.8.1 RECOMMENDED recommended upgrade since 14.10.1 is available
    14.10.1 14.9.1 14.10.1 14.9.2 14.8.1 RECOMMENDED recommended upgrade since 14.9.2 is available
    14.10.1 14.9.2 14.10.1 14.9.2 14.8.1 AVAILABLE recommended upgrade since 14.10.1 minor upgrade is available
    14.10.1 14.8.1 14.10.1 14.9.2 14.8.1 AVAILABLE recommended upgrade since 14.10.1 minor upgrade is available
    14.10.1 14.7.3 14.10.1 14.9.2 14.8.1 RECOMMENDED recommended upgrade since backports are no longer released for 14.7
    14.10.0 14.10.0 14.10.1 14.9.2 14.8.1 RECOMMENDED recommended since patch upgrade 14.10.1 is available
    14.8.1 14.10.0 14.10.1 14.9.2 14.8.1 RECOMMENDED recommended since even though the GitLab instance is still on 14.8.x, there is a patch release (14.10.1) available which might contain security fixes
    14.8.0 14.10.0 14.8.1 14.7.2 14.6.1 NOT_AVAILABLE
  5. BONUS: Create logic to recompute values whenever a runner changes version

  6. !91682 (merged) Add a scope to Ci::Runner that takes an upgradeStatus symbol and queries for ci_runner_versions for the respective upgrade status.

  7. !91682 (merged) Expose filter in GraphQL query.

  8. %15.3 Drop semver column

  9. #365250 (closed) Drop index_ci_runners_on_id_and_semver_cidr.

For reference, there are currently 11910 runners in the prod database with an invalid version, which will result in null values in the new columns.

Part of #339523 (closed)

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by Pedro Pombeiro