Skip to content

Geo - Support filtering secure files by keyword via GraphQL

What does this MR do and why?

Currently, for self-service replicables, we are unable to do any filtering on the Geo Replicable views.

This MR supports filtering CI secure files registries by keyword (fuzzy_search) via GraphQL:

Registry. Searchable attributes
CI Secure Files name

Database

Raw SQL and query plans

Using:

Ci::SecureFile.search('GitLab')

Then:

https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/14969/commands/52116

SELECT
    ci_secure_files.id
FROM
    ci_secure_files
WHERE
    ci_secure_files.name ILIKE '%Gitlab%'
LIMIT 1000;

Query plan (without index):

 Limit  (cost=0.00..709.67 rows=86 width=8) (actual time=0.079..5.010 rows=82 loops=1)
   Buffers: shared hit=165
   I/O Timings: read=0.000 write=0.000
   ->  Seq Scan on public.ci_secure_files  (cost=0.00..709.67 rows=86 width=8) (actual time=0.077..4.998 rows=82 loops=1)
         Filter: (ci_secure_files.name ~~* '%Gitlab%'::text)
         Rows Removed by Filter: 3895
         Buffers: shared hit=165
         I/O Timings: read=0.000 write=0.000

Statistics (without index):

Time: 7.352 ms  
  - planning: 2.303 ms  
  - execution: 5.049 ms  
    - I/O read: 0.000 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 165 (~1.30 MiB) from the buffer pool  
  - reads: 0 from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #364722 (closed) and #411770

Edited by Javiera Tapia

Merge request reports