Skip to content

Write a script to sync service maturity model

For #827 (closed). Prerequisite MR in the runbook: gitlab-com/runbooks!3779 (merged)

This MR is to implement the flow to sync the service maturity model generated in the handbook and the manifest file (data/service_maturity.yml) in the handbook. The flow involves this scalability repo (for syncing) and the runbook repo (for manifest generation)

graph TD;
    check-service-maturity-->generate_service_maturity_manifest[generate_service_maturity_manifest in Runbook];
    generate_service_maturity_manifest-.Upload artifacts.->sync-service-maturity;
    check-service-maturity-->sync-service-maturity;
    sync-service-maturity--Create commit-->handbook[Handbook Repo];
    sync-service-maturity--Create MR-->handbook[Handbook Repo];

In details:

  • Add a bridge job named check-service-maturity to trigger the downstream job in the runbook (named generate_service_maturity_manifest, implemented in gitlab-com/runbooks!3779 (merged)).
  • In downstream job, we implement a script to generate the service maturity manifest, and expose as an artifact
  • Add a job named sync-service-maturity. This job runs after check-service-maturity job and generate_service_maturity_manifest job are done.
  • This job downloads the artifact, pulls the latest version from https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/data/service_maturity.yml. If there is a difference, push the file to a new branch in handbook repo and draft a MR to update

Result

This is a sample sync MR in the handbook repo, drafted by the script: gitlab-com/www-gitlab-com!87863 (closed).

After the two MRs are done, we would need a personal token of a bot having enough permissions. Afterward, we can setup a schedule to run the sync job once per month.

Edited by Quang-Minh Nguyen

Merge request reports