Skip to content

Refactor versions fetching

Sarah German requested to merge sarahg/versions-lite-refactor into main

What does this MR do and why?

Gentle refactor of code that fetches info about Docs site versions.

Changes:

  • Put getVersions and getArchiveImages in the same file. Turns out they're more frequently used together than not
  • Apply code review suggestions from @oregand on very similar code from the Archives site (MR)

We'll be utilizing these functions again soon in #1293 (closed), so I wanted to make sure they're consistent with the Archives site and easier to combine.

Screenshots, screen recordings, or links to review app

n/a

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. Verify JS tests still pass: yarn test

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.

Merge request reports