Geo: Implement GraphQL endpoint for MR diffs
What does this MR do?
Implement the GraphQL endpoint as documented at: https://docs.gitlab.com/ee/development/geo/framework.html#graphql-api
Closes #215138 (closed)
Does this MR meet the acceptance criteria?
Database
We don't have data on this in production or staging yet, so I'm testing it locally.
Query:
SELECT "merge_request_diff_registry".*
FROM "merge_request_diff_registry"
WHERE "merge_request_diff_registry"."id" IN (6, 4)
ORDER BY "merge_request_diff_registry"."id" ASC
I've populated my database with some records:
DO $$
DECLARE
i record;
BEGIN
FOR i IN 1..100000 LOOP
INSERT INTO "merge_request_diff_registry" ("created_at", "merge_request_diff_id") VALUES (now(), i);
END LOOP;
END $$;
Plan:
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------
-------------------------
Index Scan using merge_request_diff_registry_pkey on public.merge_request_diff_registry (cost=0.42..17.31 rows=3 width=76) (actual time=0.04
2..0.070 rows=3 loops=1)
Output: id, created_at, retry_at, last_synced_at, merge_request_diff_id, state, retry_count, last_sync_failure
Index Cond: (merge_request_diff_registry.id = ANY ('{100449,148934,182901}'::bigint[]))
Buffers: shared hit=12
Planning Time: 0.232 ms
Execution Time: 0.109 ms
(6 rows)
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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 Toon Claes