Skip to content

Load workspace config when indexing tracked repos#17

Merged
zzet merged 1 commit intozzet:mainfrom
alex4o:fix/track-config-tsgo-lsp
May 6, 2026
Merged

Load workspace config when indexing tracked repos#17
zzet merged 1 commit intozzet:mainfrom
alex4o:fix/track-config-tsgo-lsp

Conversation

@alex4o
Copy link
Copy Markdown
Contributor

@alex4o alex4o commented May 5, 2026

Summary

  • load each tracked repo's .gortex.yaml before IndexAll creates its per-repo indexer
  • make server --track honor repo-local excludes and workspace config from the tracked destination repo
  • add regression coverage for single-repo and multi-repo IndexAll respecting workspace excludes

Test plan

  • go test ./cmd/gortex ./internal/config ./internal/indexer ./internal/excludes
  • go build -o gortex ./cmd/gortex

@alex4o alex4o force-pushed the fix/track-config-tsgo-lsp branch 2 times, most recently from bdba63c to 61e095d Compare May 5, 2026 22:49
@alex4o alex4o changed the title Respect server config for tracked repos Load workspace config when indexing tracked repos May 5, 2026
@zzet
Copy link
Copy Markdown
Owner

zzet commented May 6, 2026

Hey @alex4o!

Thank you for catching this nasty bug and contribution.

I followed further for the change and found MultiIndexer.IndexRepo at

cfg := mi.configMgr.GetRepoConfig(repoPrefix)
has the same bug - calls GetRepoConfig without LoadWorkspaceConfig.
It's reached from the MCP index_repository tool
result, err := s.multiIndexer.IndexRepo(prefix)
On a fresh-start daemon where immediately calls index_repository against a repo with a .gortex.yaml, you'd still get the bug. I believe it make sense to patch it the same way for completeness.
Also, tests only cover the exclude symptom and they don't lock down the workspace-slug propagation, which is the other (and arguably more impactful) thing your fix unblocks. Adding a workspace-slug assertion would harden against regressions.

Can you please take a look to those cases? If you don't have time for it - I can accept the PR and apply those patches in the follow up commit later.

Load each tracked repo's .gortex.yaml before IndexAll builds its per-repo Indexer. This makes server --track honor repo-local excludes and other workspace config without treating the workspace config as global state.\n\nCo-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
@alex4o alex4o force-pushed the fix/track-config-tsgo-lsp branch from 61e095d to ab037cb Compare May 6, 2026 16:23
@alex4o
Copy link
Copy Markdown
Contributor Author

alex4o commented May 6, 2026

Thanks, good catch. I patched both cases:

  • MultiIndexer.IndexRepo now calls LoadWorkspaceConfig before GetRepoConfig, so index_repository after daemon start sees the repo .gortex.yaml.
  • The IndexAll paths now also stamp workspace/project slugs from .gortex.yaml onto emitted nodes, not just exercise the exclude behavior.
  • Tests now cover single-repo IndexAll, multi-repo IndexAll, and IndexRepo for both excludes and workspace/project slug propagation.

Verified locally:

go test ./internal/indexer ./cmd/gortex ./internal/config ./internal/excludes

@zzet zzet merged commit 1d51fdb into zzet:main May 6, 2026
8 checks passed
@zzet
Copy link
Copy Markdown
Owner

zzet commented May 6, 2026

The fix is available since v0.20.1 version

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants