Skip to content

Add check for identical duplicate entries in global navigation

Evan Read requested to merge eread/add-duplicate-nav-entry-check into main

What does this MR do and why?

Because duplicate navigation items don't behave correctly, this MR:

  • Fixes instances of identical duplicate identical navigation items.
  • Adds a shell script to check for future identical duplicate navigation items.
  • Adds shell script to:
    • Lefthook configuration so that folks that have identical duplicated navigation items can catch them before kicking off a pipeline.
    • Adds shells script to Makefile, so it can be run with make test.
    • Run make target in pipelines, to eliminate regressions.

This check doesn't find instances of duplicate navigation items that are differentiated using a trailing anchor tag.

How to set up and validate locally

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Check out this branch.
  3. Run make check-global-navigation. Test passes.
  4. Duplicate a navigation item in content/_data/navigation.yaml.
  5. Run make check-global-navigation. Test fails.

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 Sarah German

Merge request reports

Loading