Skip to content

Only treat 'bin'/'obj' as build artifact path segments and add related test#27

Merged
sharpninja merged 1 commit intomainfrom
codex/perform-code-review
Mar 10, 2026
Merged

Only treat 'bin'/'obj' as build artifact path segments and add related test#27
sharpninja merged 1 commit intomainfrom
codex/perform-code-review

Conversation

@sharpninja
Copy link
Owner

Motivation

  • Prevent skipping files when directory names merely contain the substrings "bin" or "obj" rather than being build artifact directories.
  • Make file enumeration robust across platforms by checking path segments instead of performing substring matches on full paths.

Description

  • Replace substring checks for bin/obj with a new helper IsBuildArtifactPath(string relativePath) that splits the relative path into segments and matches segments case-insensitively.
  • Compute relativePath via Path.GetRelativePath(dir, path) and use it to decide whether a file is in a bin/obj segment; retain existing exclusions for hidden files and mcp.db.
  • Apply the same change in both src/McpServer.Services/Ingestion/RepoIngestor.cs and src/McpServer.Support.Mcp/Ingestion/RepoIngestor.cs and add a unit test in tests/McpServer.Support.Mcp.Tests/Ingestion/RepoIngestorTests.cs.

Testing

  • Added unit test IngestAsync_DoesNotSkipPathsThatContainBinOrObjAsSubstring and adjusted IngestAsync_SkipsLargeFiles to run under the test harness.
  • Ran the test suite with dotnet test for the McpServer.Support.Mcp.Tests project and the tests completed successfully.
  • Existing ingestion tests including IngestAsync_ContentHash_DeterministicForSameContent also passed.

Codex Task

@sharpninja sharpninja merged commit d085058 into main Mar 10, 2026
9 checks passed
@sharpninja sharpninja deleted the codex/perform-code-review branch March 10, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant