Skip to content

Resolve "Test that the project has not hit GitLab Pages redirect quota"

What does this MR do and why?

This MR implements a script that checks static/_redirects file to make sure we are within the redirect threshold GitLab pages support https://docs.gitlab.com/ee/user/project/pages/redirects.html#create-redirects.

This script runs after static/_redirects is created in the build process.

The conditions are,

  • Info on pipeline if there are < 900 redirects
  • Warn on pipeline if there are >= 900 but <= 1000 redirects
  • Fail pipeline if there are > 1000 redirects

Screenshots, screen recordings, or links to review app

  1. Case 1 - less than 900 redirects

https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/jobs/8524266789 image

  1. Case 2 - over 900 redirects

image

  1. Case 3 - over threshold of 1000

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/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. Run make check-redirect-threshold. You can change _redirect file to add on additional redirects to check other cases (or refer to my screenshots above :) )

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.

Closes #152 (closed)

Edited by Hiru Fernando

Merge request reports

Loading