Add agent_identity_id to siphon_ai_governance_sessions
What does this MR do and why?
Adds a nullable agent_identity_id column to the ClickHouse siphon_ai_governance_sessions table, so Siphon can replicate the new Postgres column of the same name.
The AI Governance dashboard (https://gitlab.com/gitlab-org/gitlab/-/work_items/630712) counts connected agents by identity. On GitLab.com that count reads from ClickHouse, so the column has to exist there too.
Merge order: this MR must merge before !257557 (merged). Otherwise spec/db/clickhouse_siphon_tables_spec.rb fails on that MR, because the spec expects every replicated Postgres column to have a ClickHouse column. Merging this one first is harmless: the column stays empty until the Postgres column exists.
The type Nullable(Int64) is what Gitlab::ClickHouse::SiphonGenerator produces for a nullable bigint. It also matches the table's other nullable ID columns (project_id, workflow_id).
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/630711
- Postgres MR: !257557 (merged)
- Dashboard: https://gitlab.com/gitlab-org/gitlab/-/work_items/630712
Screenshots or screen recordings
Not applicable, no UI change.
How to set up and validate locally
- Run
bundle exec rake gitlab:clickhouse:migrate:main. - In ClickHouse, run
SHOW CREATE TABLE siphon_ai_governance_sessionsand check thatagent_identity_id Nullable(Int64)comes after_siphon_watermark. - Run
bundle exec rspec spec/db/clickhouse_siphon_tables_spec.rb.
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.