Trigger Orbit auto-index on settings update

What does this MR do and why?

Follow-up to !253942 (merged), based on the agreement in !253942 (comment 3815706910).

This MR enqueues Analytics::KnowledgeGraph::AutoIndexWorker when orbit_auto_index_root_namespace changes to true, so enrollment starts right after an admin saves the setting instead of waiting for the next cron tick. The cron is relaxed from every 5 minutes to hourly and becomes a safety net (direct table edits, missed triggers) and the enrollment path for newly created top-level groups. deduplicate :until_executed, if_deduplicated: :reschedule_once keeps the cron and the trigger to a single pending job.

References

Database

No database changes.

Screenshots or screen recordings

No UI changes.

How to set up and validate locally

  1. Enable Orbit (knowledge_graph.enabled in gitlab.yml, the orbit licensed feature, and the knowledge_graph_infra feature flag).
  2. In the Rails console, flip the setting:
    ApplicationSetting.current.update!(orbit_auto_index_root_namespace: true)
  3. Confirm Analytics::KnowledgeGraph::AutoIndexWorker was enqueued. Updating another setting, or changing this one back to false, should not enqueue it.

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 Dmitry Gruzd

Merge request reports

Loading
Loading