Skip to content

www-gitlab-com/data syncs break main (missing YAML schema validation)

Summary

The script in scripts/sync-data.sh downloads YAML files from the data/ directory in www-gitlab-com. This is required for

  1. Rendering tables and overviews in the handbook
  2. Local Codeowner checks

Whenever a change in www-gitlab-com is merged, the latest data is pulled

Relevant logs and/or screenshots and/or links to examples

!5495 (merged) caused by gitlab-com/www-gitlab-com@0960b7c9

Error: error building site: render: failed to render pages: render of "section" failed: "/builds/gitlab-com/content-sites/handbook/layouts/all-content/list.html:36:7": execute of template failed: template: all-content/list.html:36:7: executing "all-content/list.html" at <.Content>: error calling Content: failed to render shortcode: "/builds/gitlab-com/content-sites/handbook/content/handbook/engineering/infrastructure/performance-indicators.md:5:1": failed to render shortcode "performance-indicators": failed to process shortcode: "/builds/gitlab-com/content-sites/handbook/layouts/shortcodes/performance-indicators.md:41:16": execute of template failed: template: shortcodes/performance-indicators.md:41:16: executing "shortcodes/performance-indicators.md" at <partial "performance-indicators/health-reasons" .>: error calling partial: "/builds/gitlab-com/content-sites/handbook/layouts/partials/performance-indicators/health-reasons.html:3:16": execute of template failed: template: partials/performance-indicators/health-reasons.html:3:16: executing "partials/performance-indicators/health-reasons.html" at <plainify>: error calling plainify: unable to cast map[string]interface {}{"Cause for broken `master` for April 2024":"flaky tests (45%), infrastructure/runner issues (42%), job timing out (17%), various infrastructure issues (11%), failed to pull job image (9%), runner disk full (5%), merge train missing (3%), test gap (3%), dependency upgrade (3%), broken ci config (2%), GitLab.com overloaded (2%)"} of type map[string]interface {} to string

Possible solutions

  1. Add basic YAML schema validation into handbook sync script, and bail out early with helpful error messages.
  2. Add YAML validation early in www-gitlab-com and prevent MRs from being merged.
  3. Move everything into a dedicated repository, and implement guardrails and schema validation, proposed in #171 (closed)

Notes

  1. The data sync script lives in public, internal, and docsy theme Git repository, and needs updates eventually. Validation in www-gitlab-com should be preferred therefore.
  2. Migration from www-gitlab-com to another repository needs stakeholder review, dependency updates, etc. and can block the boring solution of stopping in case of errors. Prefer a solution that does not allow to merge broken YAML code.
Edited by Michael Friedrich
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information