Skip to content

fix: EnrichCommand passes project root to ServiceDetector for filesystem walk#9

Merged
aksOps merged 1 commit into
mainfrom
fix/enrich-service-detector-filesystem-walk
Apr 1, 2026
Merged

fix: EnrichCommand passes project root to ServiceDetector for filesystem walk#9
aksOps merged 1 commit into
mainfrom
fix/enrich-service-detector-filesystem-walk

Conversation

@aksOps

@aksOps aksOps commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Root cause: EnrichCommand.java:148 called the 3-arg overload of ServiceDetector.detect(), passing projectRoot=null and skipping the filesystem walk entirely.
  • Impact: Multi-module projects where build files (.csproj, pom.xml, build.gradle, etc.) are not parsed into CodeNodes got only 1 SERVICE node (root fallback). Confirmed broken on eShop (.NET) with 20+ .csproj files.
  • Fix: Pass root as the 4th argument so the filesystem walk runs and all modules are discovered regardless of detector coverage.
  • New test: filesystemWalkFindsModulesNotPresentAsNodes — simulates a .NET monorepo with 3 .csproj files and no matching CodeNodes; asserts all 3 services are detected.

Test plan

  • ServiceDetectorTest — 29 tests, 0 failures
  • Full suite — 1441 tests, 0 failures, 0 errors
  • Principal Engineer review required before merge

Closes RAN-49

🤖 Generated with Claude Code

…ing enrich

EnrichCommand called the 3-arg overload of ServiceDetector.detect(), which
set projectRoot=null and skipped the filesystem walk entirely.  Multi-module
projects (e.g. .NET eShop with 20+ .csproj files) only received the single
root-fallback SERVICE node because their build files were never parsed into
CodeNodes by any detector.

Passing `root` as the 4th argument enables the filesystem scan, so all
modules are discovered regardless of whether a detector created a node for
their build file.

Added ServiceDetectorTest#filesystemWalkFindsModulesNotPresentAsNodes to
verify this path with a simulated .NET monorepo (3 .csproj files, no
matching CodeNodes).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@sonarqubecloud

sonarqubecloud Bot commented Apr 1, 2026

Copy link
Copy Markdown

@aksOps aksOps merged commit 8f80799 into main Apr 1, 2026
10 checks passed
@aksOps aksOps deleted the fix/enrich-service-detector-filesystem-walk branch April 3, 2026 15:58
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.

1 participant