Skip to content

Draft: Automate the update of versions.json

Achilleas Pipinellis requested to merge axil-automate-dropdown-version-bump into main

What does this MR do and why?

This is a second attempt for !3706 (merged). We had to revert because of !3805 (merged).

Automate the update of the dropdown version. Basically step 4 of https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/releases.md#create-release-merge-request.

There's one thing missing: it doesn't check for the last major versions, so you need to check and change it manually. We need to figure out how to not include a version in major_versions if it's already in one of the other hashes. However, we might not need to implement this at all because of gitlab-docs-archives#20 (closed)!

Related issues

#1586 (closed)

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: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.

  2. Check out this branch.

  3. Run the make target to update versions.json, you should see no change:

    make update-versions-dropdown
  4. Edit content/versions.json and change the values of next, current, and last_minor. They can be any string.

  5. Run the make target again, it should change back to what it was:

    make update-versions-dropdown
  6. Optional. You can also try with the dry run mode:

    DRY_RUN=true make update-versions-dropdown

Merge request reports