Skip to content

Use archive_versions.json for 404 redirect and versions menu

Sarah German requested to merge archives-redirect-maj-versions into main

What does this MR do and why?

Utilizes our new archive_versions.json endpoint in places where we need to figure out if a version exists on the archives site.

Previously we've done this by comparing versions.json and the Docs container registry (via another API call). This was a lot of logic, and not as resilient as we needed (see #1647 (closed)).

Since we have an actual index of the archive versions now, we can just fetch that instead. We can use this in two spots, both covered in this MR:

  1. The redirect from the 404 to the Archives site when the visitor has requested a version that has moved to archives.
  2. Links on the versions menu to archived versions. This will fix the broken link for 15.11 that currently exists on docs.gitlab.com.

Closes #1647 (closed)

How to set up and validate locally

nanoc view and the review app won't return the 404 for non-existent pages due to server configuration, so you need to test with Nginx locally. To do this, follow steps here: !3320 (merged)

You can verify we didn't introduce regressions to the page itself here: https://archives-redirect-maj-versions.docs.gitlab-review.app/404.html. But to test the actual redirect, you'll need the local Nginx server.

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