Add a get smallest version function to use with the archives

What does this MR do and why?

For #434 (closed).

I believe there's a small bug right now, and we're creating an archive for the wrong version.

TL;DR: In the versions dropdown, the 3 latest releases should all point to the production site, not the archives.

How it works currently

  • During the docs release, we create the archives branch.
  • The script creates a branch taking the biggest version of the last minor array in versions.json. For example, if we were to run make create-archive-branch right now, it would parse the following:
    [
      {
        "next": "18.5",
        "current": "18.4",
        "last_minor": [
          "18.3",
          "18.2"
        ],
        "last_major": [
          "17.11",
          "16.11"
        ]
      }
    ]
  • So, the 18.3 archive would be created. However, after the new release when all versions are bumped by one, 18.3 will still be in the dropdown.
  • If you check the dropdown today https://docs.gitlab.com/, the smallest minor release points to the archives, it should not.

How it should work

The 3 most recent supported releases in the dropdown should only point to the production site.

How to set up and validate locally

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

  1. Configure a local GitLab Docs environment.
  2. Check out this branch.
  3. Run:
    make create-archive-branch
  4. It should try to create the 18.2 branch, but it would fail since it already exists.

Merge request 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 Achilleas Pipinellis

Merge request reports

Loading