Skip to content

[18052] GitHub importer - Scrape images to GitLab and update markdown (Notes)

What does this MR do and why?

Implementation for a part of GitHub importer - Scrape images to GitLab and update markdown

This particular MR provides ability to import Note text attachments.

feature flag

Screenshots or screen recordings

Local test

How to set up and validate locally

Enable github_importer_attachments_import feature flag. Create project via import from Github. The project should have notes (comments) with attachments. After import make sure that notes have attachment links that belongs to gitlab server.

Database review

Query 1

SELECT "notes"."id" FROM "notes" WHERE "notes"."project_id" = 278964 AND "notes"."system" = FALSE ORDER BY "notes"."id" ASC LIMIT 1;
SELECT "notes"."id" FROM "notes" WHERE "notes"."project_id" = 278964 AND "notes"."system" = FALSE AND "notes"."id" >= 1266148 ORDER BY "notes"."id" ASC LIMIT 1 OFFSET 100;
SELECT "notes"."id", "notes"."system" FROM "notes" WHERE "notes"."project_id" = 278964 AND "notes"."system" = FALSE AND "notes"."id" >= 1266148 AND "notes"."id" < 1919690;
QUERY PLAN                                                                                   
-----------------------------------------------------------------------------------------
 Limit  (cost=0.57..0.68 rows=1 width=4) (actual time=0.047..0.048 rows=1 loops=1)
   Buffers: shared hit=5
   ->  Index Only Scan using index_notes_on_project_id_and_id_and_system_false on notes  (cost=0.57..148121.43 rows=1384250 width=4) (actual time=0.045..0.046 rows=1 loops=1)
         Index Cond: (project_id = 278964)
         Heap Fetches: 0
         Buffers: shared hit=5
 Planning Time: 0.232 ms
 Execution Time: 0.069 ms
(8 rows)
------------------------------------------------------------------------------------------
QUERY PLAN                                                                                   
------------------------------------------------------------------------------------------
 Limit  (cost=0.57..0.68 rows=1 width=4) (actual time=0.035..0.036 rows=1 loops=1)
   Buffers: shared hit=5
   ->  Index Only Scan using index_notes_on_project_id_and_id_and_system_false on notes  (cost=0.57..148121.43 rows=1384250 width=4) (actual time=0.033..0.034 rows=1 loops=1)
         Index Cond: (project_id = 278964)
         Heap Fetches: 0
         Buffers: shared hit=5
 Planning Time: 0.276 ms
 Execution Time: 0.062 ms
(8 rows)
------------------------------------------------------------------------------------------
Edited by Rostyslav Safonov

Merge request reports