Skip to content

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.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Check to see if gitlab!155663 (merged) is merged. If merged, you'll have to recreate the before-state to trigger the error.
  3. Run make check-pages-not-in-nav | jq '.[] | .url' > pages_not_in_nav.txt. Get error and pages_not_in_nav.txt is empty.
  4. Check out this branch.
  5. Run make check-pages-not-in-nav | jq '.[] | .url' > pages_not_in_nav.txt. Get better error and pages_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.

Edited by Evan Read

Merge request reports