Make pages_not_in_nav script handle errors more gracefully
What does this MR do and why?
While doing the June chores, I had a problem running a script to check for files not in the global nav. MR gitlab!155663 (merged) fixes the problem that caused the error in the script.
The error wasn't handled gracefully and the script aborted. This MR updates the script so that it can continue if there's a problem reading in data and produce a result. It can print the problem to STDERR so that the caller can fix it.
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/gitlab-docs/-/blob/main/doc/setup.md. -
Check to see if gitlab!155663 (merged) is merged. If merged, you'll have to recreate the before-state to trigger the error. -
Run make check-pages-not-in-nav | jq '.[] | .url' > pages_not_in_nav.txt
. Get error andpages_not_in_nav.txt
is empty. -
Check out this branch. -
Run make check-pages-not-in-nav | jq '.[] | .url' > pages_not_in_nav.txt
. Get better error andpages_not_in_nav.txt
has content.
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.
Edited by Evan Read