Skip to content

Geo - Create design repos if absent when verifying on primary

Aakriti Gupta requested to merge ag-create-design-repos-when-missing into master

What does this MR do and why?

Related issues: #414049 (closed) and #414279 (closed)

Right now a lot of DesignManagement::Repository records exist without a corresponding git repo. This cause verification failures. This change prevents them from happening by creating an empty repo on primary before verification if the repo is missing.

There is a follow-up issue for a re-factor/clean-up #415551

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create a project without adding a design (e.g. in an issue) or use an already existing one
  2. Make sure the design repo is missing
project.design_repository # this creates project.design_management_repository if it doesn't already exist
dmr = project.design_management_repository
dmr.repository.exists? # should be false
  1. Verify this model record, verification should pass
# on primary
dmr.replicator.verify
=> #<Geo::Event:0x000000017658c740
 id: 379,
 replicable_name: "design_management_repository",
 event_name: "checksum_succeeded",
 payload: {"model_record_id"=>21},
 created_at: Fri, 16 Jun 2023 18:00:49.963537000 UTC +00:00>

dmr.reload
dmr.design_management_repository_state.verification_succeeded? # should be true
dmr.repository.exists? # should be true

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Aakriti Gupta

Merge request reports