Skip to content

[500 by Claude Opus] Support multi-branch indexing for repositories - #501

Merged
integry merged 3 commits into
mainfrom
500/claude-opus-4-5-20251101-support-multi-branch-inde-20260112-0910-puq
Jan 12, 2026
Merged

integry merged 3 commits into
mainfrom
500/claude-opus-4-5-20251101-support-multi-branch-inde-20260112-0910-puq

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #500

Model Used: claude-opus-4-5-20251101
Status: ✅ Implementation Completed
Branch: 500/claude-opus-4-5-20251101-support-multi-branch-inde-20260112-0910-puq
Commits: ✅ Changes committed (092f1fe)


AI Processing Completed

Execution Details:

Summary:
All the changes are in place. Let me provide a summary of the implementation:

Summary of Implementation

I have successfully implemented multi-branch indexing support for GitHub issue #500. Here's what was done:

1. Database Migration (packages/core/src/db/migrations/20260109000000_add_branch_to_indexing.js)

  • Created a new migration that adds a branch column to repositories, file_summaries, and directory_summaries tables
  • Updated primary keys to be composite keys (full_name + branch) for repositories and (path + branch) for summaries
  • Implemented both SQLite and PostgreSQL/MySQL compatible migration logic
  • Default branch value is 'HEAD' to maintain backward compatibility

2. Core Logic Updates (packages/core/src/services/relevance/summaryMiner.ts)

  • Updated IndexingOptions interface to accept an optional branch parameter
  • Updated indexRepo() to pass branch through all phases of indexing
  • Updated updateRepositoryStatus() to use composite key (full_name, branch)
  • Updated identifyStaleFiles() to filter by branch
  • Updated deleteFileSummaries() to filter by branch
  • Updated utility functions (getFileSummary, getDirectorySummary, getRepositorySummaries, clearRepositorySummaries) to accept optional branch parameter

3. Batch Processing Updates (packages/core/src/services/relevance/summaryMinerHelpers.ts)

  • Updated ProcessBatchesOptions to include branch parameter
  • Updated saveBatchSummaries() to insert records with branch and use composite key for upsert

4. Directory Aggregation Updates (packages/core/src/services/relevance/summaryMinerDirectories.ts)

  • Updated aggregateDirectories() to accept and use branch parameter
  • Updated directory summary queries to filter by branch
  • Updated directory summary inserts to use composite key

5. Worker Updates (src/indexing_worker.ts)

  • Changed from loadMonitoredRepos() to loadMonitoredReposRaw() to access full repo config including baseBranch
  • Updated processRepositoryForIndexing() to accept RepoToMonitor config object and use branch
  • Updated cloneRepositoryForIndexing() to pass branch to ensureRepoCloned()
  • Updated queueIndexingJob() to include branch in job data and job ID
  • Updated scanAndQueueRepositories() to iterate over full config objects
  • Updated job failure handler to pass branch to updateRepositoryStatus()

6. Config Manager Updates (packages/core/src/config/configManager.ts)

  • Updated RepositoryIndexingStatus interface to include branch field
  • Updated getRepositoriesIndexingStatus() to return branch information
  • Updated getRepositoryIndexingStatus() to accept optional branch parameter

Acceptance Criteria Met:

  • ✅ repositories table can store 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

Detailed Logs:

Log files stored at:

  • output: /tmp/claude-logs/issue-500-2026-01-12T09-18-53-697Z-output.txt
Latest Conversation Messages

Powered by Claude Code v1.0.0


This PR was created automatically by Claude Code after processing issue #500.

…itories

Implemented by Claude Code using claude-opus-4-5-20251101 model.

Implementation completed successfully.
@github-actions

Copy link
Copy Markdown

❌ Checks Failed

Linting or Build errors were detected.

View Logs
Starting validation process...

--- Core Service: Lint & Build ---
❌ Core Lint FAILED

> [email protected] lint
> eslint src/ --max-warnings 0


/home/runner/work/gitfix/gitfix/src/indexing_worker.ts
  149:1  warning  Async function 'queueIndexingJob' has too many parameters (5). Maximum allowed is 4  max-params

✖ 1 problem (0 errors, 1 warning)

ESLint found too many warnings (maximum: 0).

--- Core Package: Build & Lint ---
✅ Core Package Build passed
❌ Core Package Lint FAILED

> @gitfix/[email protected] lint
> eslint . --max-warnings 0


/home/runner/work/gitfix/gitfix/packages/core/src/services/relevance/summaryMiner.ts
  99:8  warning  Async function 'indexRepo' has a complexity of 21. Maximum allowed is 20  complexity

/home/runner/work/gitfix/gitfix/packages/core/src/services/relevance/summaryMinerDirectories.ts
  30:8  warning  Async function 'aggregateDirectories' has too many parameters (5). Maximum allowed is 4  max-params

/home/runner/work/gitfix/gitfix/packages/core/src/services/relevance/summaryMinerHelpers.ts
  342:1  warning  Async function 'saveBatchSummaries' has too many parameters (5). Maximum allowed is 4  max-params

✖ 3 problems (0 errors, 3 warnings)

ESLint found too many warnings (maximum: 0).
npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /home/runner/work/gitfix/gitfix/packages/core
npm error workspace @gitfix/[email protected]
npm error location /home/runner/work/gitfix/gitfix/packages/core
npm error command failed
npm error command sh -c eslint . --max-warnings 0

View Workflow

@propr-dev

propr-dev Bot commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 5c227eb

Summary of Changes

All ESLint errors have been fixed. Here's a summary of the changes made:

Summary of Fixes

1. src/indexing_worker.ts (line 149) - max-params

Issue: queueIndexingJob had 5 parameters (max 4)

Fix: Created QueueIndexingJobOptions interface and refactored function to accept a single options object.

2. packages/core/src/services/relevance/summaryMinerDirectories.ts (line 30) - max-params

Issue: aggregateDirectories had 5 parameters (max 4)

Fix: Created AggregateDirectoriesOptions interface (exported) and refactored function to accept a single options object. Updated the call site in summaryMiner.ts.

3. packages/core/src/services/relevance/summaryMinerHelpers.ts (line 342) - max-params

Issue: saveBatchSummaries had 5 parameters (max 4)

Fix: Created SaveBatchSummariesOptions interface and refactored function to accept a single options object. Updated the call site.

4. packages/core/src/services/relevance/summaryMiner.ts (line 99) - complexity

Issue: indexRepo had cyclomatic complexity of 21 (max 20)

Fix: Extracted the agent setup logic (registry initialization, alias parsing, agent lookup, model override handling) into a new setupAgent() helper function. This reduced the complexity of indexRepo by moving the conditional logic for parsing agent aliases and handling model overrides into the helper function.

Key changes:
Issue: queueIndexingJob had 5 parameters (max 4)
Fix: Created QueueIndexingJobOptions interface and refactored function to accept a single options object.
Issue: aggregateDirectories had 5 parameters (max 4)
Fix: Created AggregateDirectoriesOptions interface (exported) and refactored function to accept a single options object. Updated the call site in summaryMiner.ts.
Issue: saveBatchSummaries had 5 parameters (max 4)
Fix: Created SaveBatchSummariesOptions interface and refactored function to accept a single options object. Updated the call site.
Issue: indexRepo had cyclomatic complexity of 21 (max 20)
Fix: Extracted the agent setup logic (registry initialization, alias parsing, agent lookup, model override handling) into a new setupAgent() helper function. This reduced the complexity of indexRepo by moving the conditional logic for parsing agent aliases and handling model overrides into the helper function.


🤖 Implementation Details

  • Model: claude-opus-4-5-20251101
  • Requested By: @github-actions[bot]
  • Time: 297s

Undo Changes • View Task Execution


Processing comment ID: 3737583301✓

…changes made:

All ESLint errors have been fixed. Here's a summary of the changes made:

## Summary of Fixes

### 1. `src/indexing_worker.ts` (line 149) - max-params
**Issue:** `queueIndexingJob` had 5 parameters (max 4)

**Fix:** Created `QueueIndexingJobOptions` interface and refactored function to accept a single options object.

### 2. `packages/core/src/services/relevance/summaryMinerDirectories.ts` (line 30) - max-params
**Issue:** `aggregateDirectories` had 5 parameters (max 4)

**Fix:** Created `AggregateDirectoriesOptions` interface (exported) and refactored function to accept a single options object. Updated the call site in `summaryMiner.ts`.

### 3. `packages/core/src/services/relevance/summaryMinerHelpers.ts` (line 342) - max-params
**Issue:** `saveBatchSummaries` had 5 parameters (max 4)

**Fix:** Created `SaveBatchSummariesOptions` interface and refactored function to accept a single options object. Updated the call site.

### 4. `packages/core/src/services/relevance/summaryMiner.ts` (line 99) - complexity
**Issue:** `indexRepo` had cyclomatic complexity of 21 (max 20)

**Fix:** Extracted the agent setup logic (registry initialization, alias parsing, agent lookup, model override handling) into a new `setupAgent()` helper function. This reduced the complexity of `indexRepo` by moving the conditional logic for parsing agent aliases and handling model overrides into the helper function.

Key changes:
**Issue:** `queueIndexingJob` had 5 parameters (max 4)
**Fix:** Created `QueueIndexingJobOptions` interface and refactored function to accept a single options object.
**Issue:** `aggregateDirectories` had 5 parameters (max 4)
**Fix:** Created `AggregateDirectoriesOptions` interface (exported) and refactored function to accept a single options object. Updated the call site in `summaryMiner.ts`.
**Issue:** `saveBatchSummaries` had 5 parameters (max 4)
**Fix:** Created `SaveBatchSummariesOptions` interface and refactored function to accept a single options object. Updated the call site.
**Issue:** `indexRepo` had cyclomatic complexity of 21 (max 20)
**Fix:** Extracted the agent setup logic (registry initialization, alias parsing, agent lookup, model override handling) into a new `setupAgent()` helper function. This reduced the complexity of `indexRepo` by moving the conditional logic for parsing agent aliases and handling model overrides into the helper function.

PR: #501
Comment by: @github-actions[bot] (ID: 3737583301)
Model: claude-opus-4-5-20251101
@integry

integry commented Jan 12, 2026

Copy link
Copy Markdown
Owner

UI still shows the same progress for 2 projects with the same repo:

<main class="flex-1 p-4 sm:p-8 overflow-y-auto"><div><h2 class="text-gray-900 text-2xl font-semibold mb-4">Manage Monitored Repositories</h2><p class="text-gray-600 mb-4">Add repositories to monitor, enable/disable them, or remove them from the list. Changes are applied immediately.</p><div class="bg-gray-50 border border-gray-200 rounded-lg p-4 mb-6"><h3 class="text-sm font-medium text-gray-700 mb-3">Add New Repository</h3><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3"><div class="lg:col-span-1"><label class="block text-xs font-medium text-gray-600 mb-1">Repository *</label><input list="available-repos" placeholder="owner/repo" class="w-full px-3 py-2 bg-white text-gray-900 border border-gray-300 rounded-md font-mono text-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500" value=""><datalist id="available-repos"><option value="integry/anchor-wnz"></option><option value="integry/api-nestjs"></option><option value="integry/bootstrap-3-copy"></option><option value="integry/bootstrap-datetimepicker"></option><option value="integry/building-contracts"></option><option value="integry/content-backend"></option><option value="integry/creole"></option><option value="integry/editarea-mirror"></option><option value="integry/fire-and-ice"></option><option value="integry/forex"></option><option value="integry/framework-hello-world"></option><option value="integry/future-icx"></option><option value="integry/fxdata"></option><option value="integry/fxdata-volume"></option><option value="integry/gitfix"></option><option value="integry/gitfix-config"></option><option value="integry/gitfix-deploy-webhook"></option><option value="integry/gitfix-example-snake"></option><option value="integry/group-income-simple"></option><option value="integry/heysuccess"></option><option value="integry/integry-activerecord"></option><option value="integry/integry-framework"></option><option value="integry/integry-framework-locale"></option><option value="integry/integry-image"></option><option value="integry/integry-payments"></option><option value="integry/integry-shipping"></option><option value="integry/livecart"></option><option value="integry/livecart-ads"></option><option value="integry/livecart-captcha"></option><option value="integry/livecart-city-select"></option><option value="integry/livecart-link-sections"></option><option value="integry/livecart-pdf-invoices"></option><option value="integry/livecart-record-order-ip"></option><option value="integry/livecart-sales-channels"></option><option value="integry/livecart-update-service"></option><option value="integry/mcp-chatbot"></option><option value="integry/mcptest"></option><option value="integry/mirror-ajaxfilemanager"></option><option value="integry/pitch-gitfix"></option><option value="integry/planner-tasks"></option><option value="integry/r-h"></option><option value="integry/res-man"></option><option value="integry/review-responder"></option><option value="integry/rh-proto"></option><option value="integry/scriptaculous"></option><option value="integry/slate"></option><option value="integry/solana-wallets-vue"></option><option value="integry/surfpilot"></option><option value="integry/swiftmailer"></option><option value="integry/tg-ai-chatbot"></option><option value="integry/tg-mcp-server"></option><option value="integry/tg-services"></option><option value="integry/tgweb"></option><option value="integry/tiim-backend-old"></option><option value="integry/tiim-common"></option><option value="integry/tinymce-build-mirror"></option><option value="integry/token-list"></option><option value="integry/trading-common"></option><option value="integry/trading-game-lambda-function-js"></option><option value="integry/trvl"></option><option value="integry/winerz"></option><option value="integry/wnz-keys"></option><option value="integry/wnz-staking-frontend"></option></datalist></div><div class="lg:col-span-1"><label class="block text-xs font-medium text-gray-600 mb-1">Alias (optional)</label><input placeholder="e.g., Production" class="w-full px-3 py-2 bg-white text-gray-900 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500" value=""></div><div class="lg:col-span-1"><label class="block text-xs font-medium text-gray-600 mb-1">Base Branch (optional)</label><div class="relative"><button type="button" disabled="" class="w-full px-3 py-2 text-left bg-white border border-gray-300 rounded-md font-mono text-sm transition-colors flex items-center justify-between opacity-50 cursor-not-allowed bg-gray-100"><span class="text-gray-500">Select branch...</span><div class="flex items-center gap-1"><svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button></div></div><div class="lg:col-span-1"><label class="block text-xs font-medium text-gray-600 mb-1">&nbsp;</label><button disabled="" class="w-full px-4 py-2 font-medium rounded-md transition-colors bg-gray-300 text-gray-600 cursor-not-allowed">Add Repository</button><p class="text-xs text-gray-500 mt-1">Select a repository first</p></div></div><p class="text-xs text-gray-500 mt-2">You can add the same repository multiple times with different base branches to monitor multiple branches.</p></div><div class="flex flex-col gap-2 mb-6"><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/mcptest</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Index up to date. Last indexed: 1/11/2026, 4:41:25 PM"><svg class="h-4 w-4 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="text-xs text-gray-500">1/11/2026, 4:41:25 PM</span></div><button class="p-1 hover:bg-blue-100 rounded text-blue-600 transition-colors" title="Reindex Repository"><svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/mcptest" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/gitfix</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Index up to date. Last indexed: 1/11/2026, 4:41:26 PM"><svg class="h-4 w-4 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="text-xs text-gray-500">1/11/2026, 4:41:26 PM</span></div><button class="p-1 hover:bg-blue-100 rounded text-blue-600 transition-colors" title="Reindex Repository"><svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/gitfix" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/fire-and-ice</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Index up to date. Last indexed: 1/11/2026, 4:41:28 PM"><svg class="h-4 w-4 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="text-xs text-gray-500">1/11/2026, 4:41:28 PM</span></div><button class="p-1 hover:bg-blue-100 rounded text-blue-600 transition-colors" title="Reindex Repository"><svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/fire-and-ice" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/forex</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Indexing: 111/179 files
Tokens: 613,190 input, 13,320 output"><svg class="animate-spin h-4 w-4 text-blue-500" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg><span class="text-xs text-blue-600">62% (111/179 files)</span><span class="text-xs text-gray-400 ml-1">(613.2K in / 13.3K out)</span></div><button class="p-1 hover:bg-red-100 rounded text-red-600 transition-colors" title="Stop Indexing"><svg class="h-4 w-4" fill="currentColor" viewBox="0 0 20 20"><path d="M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/forex" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/res-man</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Index up to date. Last indexed: 1/11/2026, 3:31:25 PM"><svg class="h-4 w-4 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="text-xs text-gray-500">1/11/2026, 3:31:25 PM</span></div><button class="p-1 hover:bg-blue-100 rounded text-blue-600 transition-colors" title="Reindex Repository"><svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/res-man" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/pitch-gitfix</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Index up to date. Last indexed: 1/11/2026, 4:41:29 PM"><svg class="h-4 w-4 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="text-xs text-gray-500">1/11/2026, 4:41:29 PM</span></div><button class="p-1 hover:bg-blue-100 rounded text-blue-600 transition-colors" title="Reindex Repository"><svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/pitch-gitfix" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="font-mono text-gray-900">integry/child-first-steps-75858</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Index up to date. Last indexed: 1/11/2026, 4:41:30 PM"><svg class="h-4 w-4 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="text-xs text-gray-500">1/11/2026, 4:41:30 PM</span></div><button class="p-1 hover:bg-blue-100 rounded text-blue-600 transition-colors" title="Reindex Repository"><svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/child-first-steps-75858" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div><div class="flex items-center justify-between px-4 py-3 bg-gray-50 border border-gray-200 rounded-md"><div class="flex items-center gap-3"><div class="opacity-100"><span class="text-gray-900 font-medium">GoForex<span class="font-mono text-gray-500 text-sm ml-2">(integry/forex)</span></span><span class="ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800">Branch: goforex-code-dedup</span></div><div class="flex items-center gap-3"><div class="flex items-center gap-1.5" title="Indexing: 111/179 files
Tokens: 613,190 input, 13,320 output"><svg class="animate-spin h-4 w-4 text-blue-500" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg><span class="text-xs text-blue-600">62% (111/179 files)</span><span class="text-xs text-gray-400 ml-1">(613.2K in / 13.3K out)</span></div><button class="p-1 hover:bg-red-100 rounded text-red-600 transition-colors" title="Stop Indexing"><svg class="h-4 w-4" fill="currentColor" viewBox="0 0 20 20"><path d="M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z"></path></svg></button></div><a class="text-xs px-2 py-0.5 text-primary-600 hover:text-primary-700 hover:underline font-medium transition-colors" href="/summaries/integry/forex" data-discover="true">Browse</a></div><div class="flex items-center gap-4"><label class="flex items-center cursor-pointer text-gray-700"><input class="mr-2 h-4 w-4 cursor-pointer rounded border-gray-300 text-primary-600 focus:ring-primary-500" type="checkbox" checked="">Enabled</label><button class="bg-red-600 hover:bg-red-700 text-xs px-3 py-1 text-white rounded-md font-medium transition-colors">Remove</button></div></div></div><button class="px-6 py-3 font-medium rounded-md transition-colors bg-primary-600 text-white hover:bg-primary-700 cursor-pointer">Save Changes</button></div></main>

while the API response looks correct:

{
    "repositories": [
        {
            "full_name": "integry/mcptest",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T14:41:25.000Z"
        },
        {
            "full_name": "integry/gitfix",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T14:41:26.000Z"
        },
        {
            "full_name": "integry/fire-and-ice",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T14:41:28.000Z"
        },
        {
            "full_name": "integry/forex",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T14:11:25.000Z"
        },
        {
            "full_name": "integry/res-man",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T13:31:25.000Z"
        },
        {
            "full_name": "integry/pitch-gitfix",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T14:41:29.000Z"
        },
        {
            "full_name": "integry/child-first-steps-75858",
            "branch": "HEAD",
            "indexing_status": "completed",
            "last_indexed_at": "2026-01-11T14:41:30.000Z"
        },
        {
            "full_name": "integry/forex",
            "branch": "goforex-code-dedup",
            "indexing_status": "indexing",
            "last_indexed_at": null,
            "progress": {
                "totalFiles": 179,
                "processedFiles": 111,
                "percentComplete": 62,
                "inputTokens": 613190,
                "outputTokens": 13320,
                "phase": "files",
                "totalDirectories": 0,
                "processedDirectories": 0
            }
        }
    ]
}

@propr-dev

propr-dev Bot commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 008b1d5

Summary of Changes

All changes have been implemented. Here's a summary of the fixes made:

Summary of Changes

The issue was that the UI was showing the same indexing progress for two projects with the same repository but different branches (integry/forex with branch HEAD and integry/forex with branch goforex-code-dedup). The root cause was that the frontend was using only full_name as the key for storing and looking up repository indexing statuses.

Files Modified:

  1. gitfix-ui/src/api/repoIndexingApi.ts:

    • Added branch: string field to RepositoryIndexingStatus interface
    • Added getRepoStatusKey() helper function that generates a composite key (full_name:branch for non-HEAD branches, full_name for HEAD)
    • Updated stopRepositoryIndexing() to accept optional branch parameter
    • Updated triggerRepositoryIndexing() to accept optional baseBranch parameter
  2. gitfix-ui/src/pages/RepositoriesPage.tsx:

    • Imported getRepoStatusKey helper
    • Updated loadIndexingStatuses() to store status using composite key
    • Updated handleStopIndexing() to accept and pass baseBranch parameter
    • Updated handleReindexRepo() to accept and pass baseBranch parameter
    • Updated IndexingStatusIndicator component usage to lookup status with composite key and pass branch to handlers
  3. packages/dashboard/routes/configRoutes.ts:

    • Updated stopIndexing endpoint to extract branch from request body
    • Updated to pass branch to stopIndexingJob helper
    • Enhanced activity log message to include branch info
  4. packages/dashboard/routes/configHelpers.ts:

    • Updated stopIndexingJob() to accept optional branch parameter
    • Updated job filtering logic to match both repository AND baseBranch
    • Updated updateRepositoryStatus() call to pass branch parameter

Key changes:

  1. gitfix-ui/src/api/repoIndexingApi.ts:
    • Added branch: string field to RepositoryIndexingStatus interface
    • Added getRepoStatusKey() helper function that generates a composite key (full_name:branch for non-HEAD branches, full_name for HEAD)
    • Updated stopRepositoryIndexing() to accept optional branch parameter
    • Updated triggerRepositoryIndexing() to accept optional baseBranch parameter
  2. gitfix-ui/src/pages/RepositoriesPage.tsx:
    • Imported getRepoStatusKey helper
    • Updated loadIndexingStatuses() to store status using composite key
    • Updated handleStopIndexing() to accept and pass baseBranch parameter
    • Updated handleReindexRepo() to accept and pass baseBranch parameter

🤖 Implementation Details

  • Model: claude-opus-4-5-20251101
  • Requested By: @integry
  • Time: 319s

Undo Changes • View Task Execution


Processing comment ID: 3737639165✓

…fixes made:

All changes have been implemented. Here's a summary of the fixes made:

## Summary of Changes

The issue was that the UI was showing the same indexing progress for two projects with the same repository but different branches (`integry/forex` with branch `HEAD` and `integry/forex` with branch `goforex-code-dedup`). The root cause was that the frontend was using only `full_name` as the key for storing and looking up repository indexing statuses.

### Files Modified:

1. **`gitfix-ui/src/api/repoIndexingApi.ts`**:
   - Added `branch: string` field to `RepositoryIndexingStatus` interface
   - Added `getRepoStatusKey()` helper function that generates a composite key (`full_name:branch` for non-HEAD branches, `full_name` for HEAD)
   - Updated `stopRepositoryIndexing()` to accept optional `branch` parameter
   - Updated `triggerRepositoryIndexing()` to accept optional `baseBranch` parameter

2. **`gitfix-ui/src/pages/RepositoriesPage.tsx`**:
   - Imported `getRepoStatusKey` helper
   - Updated `loadIndexingStatuses()` to store status using composite key
   - Updated `handleStopIndexing()` to accept and pass `baseBranch` parameter
   - Updated `handleReindexRepo()` to accept and pass `baseBranch` parameter
   - Updated `IndexingStatusIndicator` component usage to lookup status with composite key and pass branch to handlers

3. **`packages/dashboard/routes/configRoutes.ts`**:
   - Updated `stopIndexing` endpoint to extract `branch` from request body
   - Updated to pass `branch` to `stopIndexingJob` helper
   - Enhanced activity log message to include branch info

4. **`packages/dashboard/routes/configHelpers.ts`**:
   - Updated `stopIndexingJob()` to accept optional `branch` parameter
   - Updated job filtering logic to match both `repository` AND `baseBranch`
   - Updated `updateRepositoryStatus()` call to pass branch parameter

Key changes:
1. **`gitfix-ui/src/api/repoIndexingApi.ts`**:
   - Added `branch: string` field to `RepositoryIndexingStatus` interface
   - Added `getRepoStatusKey()` helper function that generates a composite key (`full_name:branch` for non-HEAD branches, `full_name` for HEAD)
   - Updated `stopRepositoryIndexing()` to accept optional `branch` parameter
   - Updated `triggerRepositoryIndexing()` to accept optional `baseBranch` parameter
2. **`gitfix-ui/src/pages/RepositoriesPage.tsx`**:
   - Imported `getRepoStatusKey` helper
   - Updated `loadIndexingStatuses()` to store status using composite key
   - Updated `handleStopIndexing()` to accept and pass `baseBranch` parameter
   - Updated `handleReindexRepo()` to accept and pass `baseBranch` parameter

PR: #501
Comment by: @integry (ID: 3737639165)
Model: claude-opus-4-5-20251101
@propr-dev

propr-dev Bot commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

🚀 Preview Environment Deployed

Your PR preview environment is now available:

UI: https://pr-501.gitfix.dev


This comment is automatically updated on each deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multi-branch indexing for repositories

2 participants