Skip to content

Geo: Add replication and verification for Design repos with SSF

Aakriti Gupta requested to merge ag-design-repo-migration-to-ssf into master

What does this MR do and why?

This MR introduces replication and verification through Geo's self-service framework for Design repos.

This work is based on the documented template instructions in the issue #355660 (closed)

We want to maintain two code paths for replication of design repos - the legacy code and the one introduced here through the SSF behind an FF.

Later the plan is to remove the legacy code and enable the FF to use SSF based replication/verification in #391189 (closed)

Current status of this MR

This MR is a draft right now but I am asking for early reviews because this is a huge MR.

database The database work is complete. Only some backend work is remaining.

This the work in progress right now and not completely reflected in the MR:

  • Adding a conditional in the post receive worker and the projects destroy service, along with the code this MR adds, so that the new code is only applicable when the feature flag is on and replication is happening through the SSF. This is a way to make sure the code paths for legacy replication and that through SSF is completely separate. You will find some # TODO items in the code.

  • Change milestone in code to 16.1 if this MR is not merged in 16.0

  • Manual testing

    • Does legacy replication work when the FF is disabled?

    • Does legacy replication work when the FF is enabled? It should not.

    • Does replication and verification work through the SSF when the FF is enabled?

    • with the FF: Make sure a Geo secondary site can request and download Design Management Repositories on the Geo primary site.

    • with the FF: Make sure a Geo secondary site can replicate Design Management Repositories where repository does not exist on the Geo primary site.

    • test project deletion with and without the FF

    • test route redirection for admin/geo/replication/designs with FF enabled

Database queries in Geo::DesignManagementRepositoryRegistryFinder

Query called from:

Geo::DesignManagementRepositoryRegistryFinder
  .new(User.first, { 
    ids: [2], replication_state: :synced, verification_state: :succeeded
  }
).execute
 SELECT "design_management_repository_registry".*
FROM   "design_management_repository_registry"
WHERE  "design_management_repository_registry"."id" = 2
       AND ( "design_management_repository_registry"."state" IN ( 2 ) )
       AND ( "design_management_repository_registry"."state" IN ( 2 ) )
       AND ( "design_management_repository_registry"."verification_state" IN ( 2
             ) )
ORDER  BY "design_management_repository_registry"."id" ASC 

How to set up and validate locally

  • Setup Geo locally or with GET
  • Test out design replication with FF disabled. 'Designs' should show up in /admin/geo/replication/designs on secondary.
  • Feature.enable(:geo_design_management_repository_replication) and test if replication works and 'Design management repositories' shows up in /admin/geo/sites on the secondary.

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

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 Michael Kozono

Merge request reports

Loading