Skip to content

Add docs-i18n-lint links CI job for anchor link validation

What does this MR do?

  1. Expanded scripts/docs_i18n_verify_paths.sh to include the lychee check, renaming it docs_i18n_verify.sh, with two modes:
    • --verify-paths: Checks that all localized files have corresponding English originals
    • --check-links: Creates a temporary directory, generates symlinks, and runs lychee
  2. Updates existing new docs-i18n-lint paths CI jobs:
    • To use docs_i18n_verify.sh --verify-paths
  3. Adds a new docs-i18n-lint links CI job to validate anchor links in internationalized documentation by:
    • Creating a temporary test directory (/lychee_test_$timestamp) at the project root
    • Generating fallback symlinks for missing locale files to the original English docs
    • Running lychee with offline mode and fragment checking
    • Automatically cleaning up the temporary directory after testing
  4. Enables markdownlint's MD051 (link-fragments) rule for /doc-locale to validate that internal anchor links point to existing headings.

To Test:

  1. Check what locale directories exist ls -la doc-locale
  2. Test path verification: ./scripts/docs_i18n_verify.sh --verify-paths
  3. Test link checking: ./scripts/docs_i18n_verify.sh --check-links
  4. See what symlinks get created by comment out the trap cleanup line: ls -la lychee_test_$timestamp
  5. Add a bad internal link to any translated file in /doc-locale, and run ./scripts/docs_i18n.sh --check-links to see lychee fail

Test the markdownlint changes

cd doc-locale && markdownlint-cli2 --config .markdownlint/.markdownlint-cli2.yaml '**/*.md

Related issues

Related https://gitlab.com/gitlab-com/localization/docs-site-localization/-/issues/333

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Reviewers checklist

Edited by Lauren Barker

Merge request reports

Loading