Add path verifications for localized files - Runner

What does this MR do?

Implements path verification for all of the localized files to make sure there's no orphaned localized files.

Currently GitLab and GitLab Omnibus has basic path verification through docs-i18n-lint paths. In this MR, we'd like to implement a similar verification here for GitLab Runner.

Why was this MR needed?

The goal of this Merge Request is to fail the pipeline when orphaned translation files are detected, providing clear guidance for localization engineering team on cleanup actions needed. To know more about all the other project implementations, individual merge requests for each project and for further information please checkout this issue.

What's the best way to test this MR?

The following would be a great way to test out his MR:

  1. Checkout this branch in your local,
  2. Introduce a new japanese translation file in your docs-locale directory. It can be under a sub-directory or at the root of docs-locale.
  3. Make sure you give execution rights to the docs_i18n_verify_paths: chmod +x scripts/docs_i18n_verify_paths
  4. Run the docs_i18n_verify_paths using the following command: ./scripts/docs_i18n_verify_paths
  5. You will get an error on the terminal indicating the new orphaned localized file you just added: ❌ Path verification failed: Found 34 localized files without matching English originals.
  6. Remove the orphaned file and run the command again.
  7. You will see the error disappear and it will tell you: ✅ Verification successful! All localized files have matching English originals.

Test jobs on the pipeline

What are the relevant issue numbers?

Related: gitlab-com/localization/docs-site-localization#334 (closed)

Edited by Sarah German

Merge request reports

Loading