Add repository_storage to Knowledge Graph code indexing tasks

What does this MR do and why?

Knowledge Graph push tasks now carry the project's repository_storage, so the indexer can take its per-storage lease without an extra /info lookup. The column is nullable, so old rows and older consumers keep working.

References

Screenshots or screen recordings

N/A, backend only.

How to set up and validate locally

  1. Run the migration and enable Knowledge Graph indexing for a namespace.
  2. Call Analytics::KnowledgeGraph::CodeIndexingTask.create_for_project(project.id, 'refs/heads/master', sha).
  3. The returned task has repository_storage equal to project.repository_storage.

Siphon needs no config change: it builds event columns from the PostgreSQL relation message, and this table has no ClickHouse target to update first.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Agent context
  • Migration adds repository_storage text and a 255-char check constraint (same limit as projects.repository_storage) via add_column plus add_text_limit, following the existing pattern for partitioned tables.
  • create_for_project reads project.repository_storage from the already-loaded project, so there is no extra query. Model validates length 255.
  • Siphon check (verified from source, not run end to end): the replication manager loops relation.Columns, the publication has no column list, and the table mapping has no column allowlist.
  • Tests: ee/spec/models/analytics/knowledge_graph passes. spec/db/schema_spec.rb has one failure in the jsonb validator example for Ai::ActiveContext::Connection, unrelated to this table.
  • Schema regenerated with scripts/regenerate-schema against current master.

Merge request reports

Loading
Loading