Skip to content

Add graphql Api for Snippet Replication

What does this MR do?

Add graphQL endpoints for snippet repository replication

This was added following https://docs.gitlab.com/ee/development/geo/framework.html#graphql-api

Relates to #263792 (closed)

Database

We don't have data on this in production or staging yet, so I'm testing it locally.

Query:

SELECT "snippet_repository_registry".*
FROM "snippet_repository_registry"
WHERE "snippet_repository_registry"."id" IN (6, 4)
ORDER BY "snippet_repository_registry"."id" ASC

I generated 100000 rows in my local development box and ran a query plan:


                                             QUERY PLAN                                              
-----------------------------------------------------------------------------------------------------
 Sort  (cost=16.34..16.34 rows=2 width=78)
   Sort Key: id
   ->  Bitmap Heap Scan on snippet_repository_registry  (cost=8.60..16.33 rows=2 width=78)
         Recheck Cond: (id = ANY ('{6,4}'::bigint[]))
         ->  Bitmap Index Scan on snippet_repository_registry_pkey  (cost=0.00..8.60 rows=2 width=0)
               Index Cond: (id = ANY ('{6,4}'::bigint[]))
(6 rows)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Alex Ives

Merge request reports