Sync AI governance sessions when ClickHouse is enabled
What does this MR do and why?
The worker that writes ai_governance_sessions was only queued when ClickHouse analytics is off. So on GitLab.com, no Duo sessions reached the table (or ClickHouse through Siphon).
Now the worker is queued when ClickHouse is off, or when sync_ai_governance_sessions is enabled for the top-level group. SessionArtifact still syncs only when ClickHouse is off, because ClickHouse instances read the session list from siphon_duo_workflows_workflows.
This matters because the ClickHouse sessions finder (!258121 (merged)) and the rollout (https://gitlab.com/gitlab-org/gitlab/-/work_items/630766) depend on these sessions existing on GitLab.com.
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/630096
- Follow-up to !256733 (merged)
Screenshots or screen recordings
Not applicable, backend only.
How to set up and validate locally
- Run the specs:
bundle exec rspec ee/spec/workers/ai/duo_workflows/sync_session_artifact_worker_spec.rb - Optionally, with
Feature.enable(:sync_ai_governance_sessions, group), create or update a Duo workflow in a project undergroupon a ClickHouse-enabled instance. A row appears inai_governance_sessionsand no row is added toduo_workflow_session_artifacts.
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.