Repository navigation
Closed
Labels
Description
Support Multi-Branch Indexing for Repositories
Context
The current indexing system identifies repositories solely by their 'full_name' (e.g., 'owner/repo'). This limitation prevents us from monitoring and indexing multiple branches of the same repository (e.g., 'main' and 'develop') simultaneously, as they would share the same database record and overwrite each other's summaries.
Objective
Update the database schema and indexing logic to support a composite key of 'full_name' + 'branch'. This will allow separate indexing status and summaries for different branches.
Implementation Steps
1. Database Schema Migration
Create a new migration file 'packages/core/src/db/migrations/20260109000000_add_branch_to_indexing.js' to:
- Add a 'branch' column to 'repositories', 'file_summaries', and 'directory_summaries' tables (default to 'HEAD').
- Update the Primary Key of 'repositories' to '('full_name', 'branch')'.
- Update the Primary Key of 'file_summaries' to '('path', 'branch')'.
- Update the Primary Key of 'directory_summaries' to '('path', 'branch')'.
2. Core Logic Updates ('@gitfix/core')
- 'packages/core/src/services/relevance/summaryMiner.ts':
- Update 'IndexRepo' to accept a 'branch' option.
- Update 'updateRepositoryStatus' to query and insert using both 'full_name' and 'branch'.
- Update 'identifyStaleFiles', 'deleteFileSummaries', 'getFileSummary', etc., to filter by the specific 'branch'.
- 'packages/core/src/services/relevance/summaryMinerHelpers.ts':
- Ensure 'processBatches' and 'aggregateDirectories' inject the 'branch' field when creating new summary records.
- 'packages/core/src/queue/taskQueue.ts':
- Update 'IndexingJobData' interface to include 'branch?: string'.
3. Worker Updates ('src/indexing_worker.ts')
- Update 'scanAndQueueRepositories' to use 'loadMonitoredReposRaw()' instead of 'loadMonitoredRepos()'.
- Iterate through the full config objects to access 'baseBranch'.
- Pass 'baseBranch' (defaulting to 'HEAD') to 'processRepositoryForIndexing'.
- Update 'processRepositoryForIndexing' and 'queueIndexingJob' to propagate the branch information.
- Update 'cloneRepositoryForIndexing' to utilize the specific branch during the checkout/clone process.
Acceptance Criteria
- 'repositories' table stores separate rows for the same repo with different branches.
- 'file_summaries' are isolated by branch.
- The indexing worker correctly picks up the configured 'baseBranch' from 'repos_to_monitor' config.
Activity
integry commentedon Jan 9, 2026
Here is the migration script to update the schema.
Create 'packages/core/src/db/migrations/20260109000000_add_branch_to_indexing.js':
integry commentedon Jan 9, 2026
Updates for 'packages/core/src/services/relevance/summaryMiner.ts':
integry commentedon Jan 9, 2026
Updates for 'src/indexing_worker.ts':
propr-dev commentedon Jan 9, 2026
🤖 AI processing has started for this issue using gemini agent with gemini-3-pro-preview model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
geminigemini-3-pro-preview500/gemini-3-pro-preview-support-multi-branch-inde-20260109-1445-y2gmainissue-500-20260109-1445-gemini-3-pro-preview-y2g🔍 Track Task Execution
propr-dev commentedon Jan 9, 2026
AI Processing Failed
Execution Details:
Powered by Claude Code v1.0.0
propr-dev commentedon Jan 12, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-4-5-20251101 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-4-5-20251101500/claude-opus-4-5-20251101-support-multi-branch-inde-20260112-0910-puqmainissue-500-20260112-0910-claude-opus-4-5-20251101-puq🔍 Track Task Execution
fix(ai): Resolve issue #500 - Support multi-branch indexing for repos…
feat(ai): Addressed F2 only. Retry obligations now remain separate fo…