Loading
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
- Follow-up to gitlab-org/orbit/knowledge-graph!2847 (merged)
- Consumer side lands separately in gitlab-org/orbit/knowledge-graph
Screenshots or screen recordings
N/A, backend only.
How to set up and validate locally
- Run the migration and enable Knowledge Graph indexing for a namespace.
- Call
Analytics::KnowledgeGraph::CodeIndexingTask.create_for_project(project.id, 'refs/heads/master', sha). - The returned task has
repository_storageequal toproject.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 textand a 255-char check constraint (same limit asprojects.repository_storage) viaadd_columnplusadd_text_limit, following the existing pattern for partitioned tables. create_for_projectreadsproject.repository_storagefrom 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_graphpasses.spec/db/schema_spec.rbhas one failure in the jsonb validator example forAi::ActiveContext::Connection, unrelated to this table. - Schema regenerated with
scripts/regenerate-schemaagainst currentmaster.