Skip to content

Fix check for current stable version

Sarah German requested to merge 1330-version-banner into main

What does this MR do and why?

Closes #1330 (closed)

Fixes visibility of the "Archived version" banner for the current stable release. This banner should not show for the current stable version.

The issue here was that we were using a copy of versions.json from the released branch to check if it was the current stable release. We need to check for this against the up-to-date docs.gitlab.com/versions.json endpoint in order to know the status of an older version.

Screenshots, screen recordings, or links to review app

Before After
image image

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. Run a production compile: CI_COMMIT_REF_NAME="main" CI_DEFAULT_BRANCH="main" NANOC_ENV="production" bundle exec nanoc compile
  3. View the site (make view). The banner should not appear. Note: The banner only renders on interior pages.
  4. Run a compile for the latest stable version: CI_COMMIT_REF_NAME="15.7" CI_DEFAULT_BRANCH="main" NANOC_ENV="production" bundle exec nanoc compile
  5. View the site (make view). The banner should not appear. Note: The banner only renders on interior pages.
  6. Run a compile for an older version: CI_COMMIT_REF_NAME="15.5" CI_DEFAULT_BRANCH="main" NANOC_ENV="production" bundle exec nanoc compile
  7. View the site (make view). The banner should appear. Note: The banner only renders on interior pages.

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 Sarah German

Merge request reports