[355137] Migrate pull request assigned reviewers
What does this MR do and why?
Implementation for Migrate pull request assigned reviewers
Screenshots or screen recordings
How to set up and validate locally
Create project via import from GitHub. The project should have pull requests with review requests. Your local GitLab instance should have user that matches one that was requested to review on GitHub. After import make sure that review requests are showed on GitLab side MRs.
Query Plans
Click to expand
Query: Find Batch Start
explain SELECT "merge_requests"."iid" FROM "merge_requests" WHERE "merge_requests"."target_project_id" = 1 AND "merge_requests"."iid" NOT IN (1, 2, 3) ORDER BY "merge_requests"."iid" ASC LIMIT 1;
Plan
Limit (cost=0.57..0.62 rows=1 width=4) (actual time=4.458..4.459 rows=0 loops=1)
Buffers: shared read=4
I/O Timings: read=4.427 write=0.000
-> Index Only Scan using index_merge_requests_on_target_project_id_and_iid on public.merge_requests (cost=0.57..20.21 rows=421 width=4) (actual time=4.456..4.456 rows=0 loops=1)
Index Cond: (merge_requests.target_project_id = 1)
Heap Fetches: 0
Filter: (merge_requests.iid <> ALL ('{1,2,3}'::integer[]))
Rows Removed by Filter: 0
Buffers: shared read=4
I/O Timings: read=4.427 write=0.000
Recommendations:
Statistics:
Time: 9.224 ms
- planning: 4.726 ms
- execution: 4.498 ms
- I/O read: 4.427 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 0 from the buffer pool
- reads: 4 (~32.00 KiB) from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
Query: Find Batch End
explain SELECT "merge_requests"."iid" FROM "merge_requests" WHERE "merge_requests"."target_project_id" = 1 AND "merge_requests"."iid" NOT IN (1, 2, 3) AND "merge_requests"."iid" >= 4 ORDER BY "merge_requests"."iid" ASC LIMIT 1 OFFSET 100;
Plan
Limit (cost=5.36..5.41 rows=1 width=4) (actual time=0.045..0.046 rows=0 loops=1)
Buffers: shared hit=4
I/O Timings: read=0.000 write=0.000
-> Index Only Scan using index_merge_requests_on_target_project_id_and_iid on public.merge_requests (cost=0.57..19.58 rows=397 width=4) (actual time=0.043..0.044 rows=0 loops=1)
Index Cond: ((merge_requests.target_project_id = 1) AND (merge_requests.iid >= 4))
Heap Fetches: 0
Buffers: shared hit=4
I/O Timings: read=0.000 write=0.000
Recommendations
Statistics
Time: 0.964 ms
- planning: 0.892 ms
- execution: 0.072 ms
- I/O read: 0.000 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 4 (~32.00 KiB) from the buffer pool
- reads: 0 from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
Query: Fetch Batch
SELECT "merge_requests"."id", "merge_requests"."iid" FROM "merge_requests" WHERE "merge_requests"."target_project_id" = 1 AND "merge_requests"."iid" NOT IN (1, 2, 3) AND "merge_requests"."iid" >= 4 AND "merge_requests"."iid" < 140;
Plan
Index Scan using index_merge_requests_on_target_project_id_and_iid on public.merge_requests (cost=0.57..226.59 rows=173 width=8) (actual time=0.023..0.023 rows=0 loops=1)
Index Cond: ((merge_requests.target_project_id = 1) AND (merge_requests.iid >= 4) AND (merge_requests.iid < 140))
Buffers: shared hit=4
I/O Timings: read=0.000 write=0.000
Recommendations
Statistics
Time: 0.657 ms
- planning: 0.614 ms
- execution: 0.043 ms
- I/O read: 0.000 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 4 (~32.00 KiB) from the buffer pool
- reads: 0 from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Rostyslav Safonov