Backfills AnalyzerProjectStatuses

What does this MR do and why?

Backfills AnalyzerProjectStatuses from ProjectSecuritySettings based on the container_scanning_for_registry_enabled and secret_push_protection_enabled columns

Changelog: other

EE: true

References

Namespace level statuses for DB based settings (#548281 - closed) • rossfuhrman, Gal Katz • 18.2

Query plans

upsert_analyzer_statuses

Raw SQL
INSERT INTO analyzer_project_statuses (project_id, traversal_ids, status, analyzer_type, last_call, created_at, updated_at)
    VALUES (68794259, ARRAY[140, 141]::bigint[], 1, 11, '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000'''),
    (68794259, ARRAY[140, 141]::bigint[], 1, 10, '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000'''),
    (68794259, ARRAY[140, 141]::bigint[], 1, 5, '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000'''),
    (68794259, ARRAY[140, 141]::bigint[], 1, 6, '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000''', '''2025-06-26 21:02:49.985255000''')
ON CONFLICT (project_id, analyzer_type)
    DO UPDATE SET
        status = EXCLUDED.status,
        last_call = EXCLUDED.last_call,
        updated_at = EXCLUDED.updated_at;
Query plan

Full details here

 ModifyTable on public.analyzer_project_statuses  (cost=0.00..0.06 rows=0 width=0) (actual time=3.309..3.309 rows=0 loops=1)
   Buffers: shared hit=127 read=31 dirtied=12
   WAL: records=28 fpi=10 bytes=74104
   I/O Timings: read=2.756 write=0.000
   ->  Values Scan on "*VALUES*"  (cost=0.00..0.06 rows=4 width=85) (actual time=0.273..0.287 rows=4 loops=1)
         Buffers: shared hit=18 read=5 dirtied=2
         WAL: records=3 fpi=1 bytes=8363
         I/O Timings: read=0.155 write=0.000
Settings: effective_cache_size = '338688MB', jit = 'off', seq_page_cost = '4', work_mem = '100MB', random_page_cost = '1.5'

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by rossfuhrman

Merge request reports

Loading