Add docs-i18n-lint links CI job for anchor link validation
What does this MR do?
- Expanded
scripts/docs_i18n_verify_paths.sh
to include the lychee check, renaming itdocs_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
-
- Updates existing new
docs-i18n-lint paths
CI jobs:- To use
docs_i18n_verify.sh --verify-paths
- To use
- 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
- Enables markdownlint's MD051 (link-fragments) rule for
/doc-locale
to validate that internal anchor links point to existing headings.
To Test:
- Check what locale directories exist
ls -la doc-locale
- Test path verification: ./scripts/docs_i18n_verify.sh --verify-paths
- Test link checking:
./scripts/docs_i18n_verify.sh --check-links
- See what symlinks get created by comment out the trap cleanup line:
ls -la lychee_test_$timestamp
- 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.
-
Merge Request Title and Description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
MR has a green pipeline. -
Documentation created/updated - TBA at https://docs.gitlab.com/development/documentation/testing/#language-specific-translation-linting once CI is added across projects -
Tests added/updated, and test plan for scenarios not covered by automated tests. -
Equivalent MR/issue for omnibus-gitlab opened. gitlab-org/omnibus-gitlab!8802
Reviewers checklist
-
MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab. -
Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.
Edited by Lauren Barker