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
- Case 1 - less than 900 redirects
https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/jobs/8524266789
- Case 2 - over 900 redirects
- Case 3 - over threshold of 1000
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Closes #152 (closed)
Edited by Hiru Fernando