Skip to content

Allow configurable ref for data sync

Darby Frey requested to merge configure-ref-for-data-sync into main

Why is this change being made?

In scripts/sync-data.sh the source ref can be configured via the PUBLIC_HANDBOOK_REF environment variable https://gitlab.com/gitlab-com/content-sites/handbook/-/blob/main/scripts/sync-data.sh?ref_type=heads#L6. This change adds that same ability to other templates that are loading data dynamically.

How to test locally

  1. Run hugo server locally and ensure that the build completes successfully
  2. Stop the server and run it again with a ref that causes a failure, for example PUBLIC_HANDBOOK_REF=0960b7c95f867a89a22773cf17fd5ac5444e2652 hugo server. This example ref will produce a render error, which indicates that the environment variable was used during the build.

Author and Reviewer Checklist

Please verify the check list and ensure to tick them off before the MR is merged.

  • Provided a concise title for this Merge Request (MR)
  • Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
    • Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
  • Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI)
    • If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the Maintained by section on the page being edited
    • If your manager does not have merge rights, please ask someone to merge it AFTER it has been approved by your manager in #mr-buddies
    • The when to get approval handbook section explains the workflow in more detail
  • For transparency, share this MR with the audience that will be impacted.
    • Team: For changes that affect your direct team, share in your group Slack channel
    • Department: If the update affects your department, share the MR in your department Slack channel
    • Division: If the update affects your division, share the MR in your division Slack channel
    • Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR

Commits

  • Allow configurable ref for data sync

Merge request reports