fix(cli): detect Spring Boot request mappings as routes#619
Conversation
Add a Spring-specific framework route extractor so RequestMapping-style annotations produce Route nodes and handler links in both worker and sequential parsing paths. Made-with: Cursor
Add Spring fixture coverage for method-level RequestMapping variants with and without an explicit RequestMethod to lock in route extraction behavior. Made-with: Cursor
|
Someone is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
@ShiningXu Thanks for adding Spring request mapping support — this is very helpful! One important case is missing: the current extractor only handles string literals (e.g. @RequestMapping("/foo")) and does not resolve paths declared via constants/identifiers/field access (for example @RequestMapping(PATHS.USERS), @RequestMapping(path = MyConstants.USERS) or private static final String USERS = "/users"; @RequestMapping(USERS)). Routes declared with constants will be skipped and no Route / HANDLES_ROUTE / CALLS edges will be created. Please implement the fully-correct resolution only (no temporary fallbacks). Requirements for that approach: Resolve identifier and field_access annotation values to their actual string values, not just the expression text. |
|
Thanks, this is a good catch. You're right that the current implementation only resolves string literals, so mappings declared via identifiers / field access / imported constants are still missed. I agree this should be fixed with proper resolution rather than a temporary fallback. I'll update this PR to support:
I'll also add focused fixtures and assertions covering those cases, while keeping @magyargergo @abhigyanpatwari not sure if this fits well with the current ingestion/resolution flow — would appreciate your thoughts before I go
|
Finalize Spring route candidates after import resolution so Java Spring mappings can use local, imported, and fully qualified constants. Skip unresolved explicit mappings and expand route metadata coverage to prevent bad fallback routes. Made-with: Cursor
|
@ThinhKVT Thanks for the detailed review. I pushed a follow-up commit that addresses the requested changes:
I also widened the class walker so Spring controller discovery is not limited to Revalidated with:
|
CI Report❌ Some checks failed Pipeline Status
Test Results
✅ All 4828 tests passed 46 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Remove the unused parsing import and format the updated Spring route files so the quality lint and prettier checks pass cleanly. Made-with: Cursor
|
@claude review this pr, check if what's promised is actually delivered. Fits well into the architecture and language agnostic and doesn't violate DAG. Try to find gaps and potential issues. You must have detailed explanations and proof for each of the findigns. |
|
Claude finished @magyargergo's task in 6m 4s —— View job PR Review: fix(cli): detect Spring Boot request mappings as routesTasks
SummaryThe PR delivers the core goal — Spring Boot What's Delivered vs. Promised
Architectural Issues1. Spring-specific type leaks into the language-agnostic
|
Move deferred route finalization behind language provider hooks so Spring-specific candidate handling no longer leaks into the shared pipeline contract. Also broaden Java controller heuristics and preserve FQCN-backed Spring constant resolution. Made-with: Cursor
|
Pushed a follow-up refactor commit to tighten the deferred Spring route design. Completed in this update:
Revalidated with:
Intentionally not changed in this round:
|
Add an explicit negative regression for unresolved Spring route constants so broken mappings do not emit Route, HANDLES_ROUTE, or framework CALLS links. Made-with: Cursor
|
@magyargergo I’ve pushed fixes for the issues raised in review and updated the tests as well. When you have time, could you take another look at this PR? If you spot anything else that should be changed, just let me know and I’ll update it. |
|
@ShiningXu thank you for your contribution! We put hold on every improvements until we finished with the migration to the Semantic Model. We created some issue ticket regarding this and we established the direction. It would be appreciated if you could contribute to that and unblock all the exciting contributions. |
|
Please submit a new PR if this is still relevant |
Summary
Add Spring-specific route extraction so Spring Boot request mapping annotations produce
Routenodes,HANDLES_ROUTEedges, and framework route call links during ingestion.Motivation / context
Fixes #600.
Spring controller methods annotated with
@RequestMappingand the shortcut mapping annotations were not being converted into graph route data, which meant Spring Boot API endpoints were missing from the knowledge graph.Areas touched
gitnexus/(CLI / core / MCP server)gitnexus-web/(Vite / React UI).github/(workflows, actions)eval/or other toolingAGENTS.md,CLAUDE.md,.cursor/,llms.txt, etc.)Scope & constraints
In scope
@RequestMapping,@GetMapping,@PostMapping,@PutMapping,@DeleteMapping, and@PatchMapping@RequestMappingwith both implicit default method handling and explicitRequestMethod.*Explicitly out of scope / not done here
FETCHESedgesHANDLES_ROUTEgranularity changesImplementation notes
gitnexus/src/core/ingestion/route-extractors/spring-java.tsExtractedRoute[]->framework-routepipeline instead of introducing a new route node pathprocessRoutesFromExtracted()reason text from Laravel-specific wording to framework-generic wording@RequestMappingwith and without explicitRequestMethodTesting & verification
cd gitnexus && npm testcd gitnexus && npm run test:integration(if core/indexing/MCP paths changed)cd gitnexus && npx tsc --noEmitcd gitnexus-web && npm test(if web changed)cd gitnexus-web && npx tsc -b --noEmit(if web changed)gitnexus-web/e2e/)Commands run:
cd gitnexus && npm run buildcd gitnexus && npx vitest run test/integration/resolvers/route-mapping.test.ts test/integration/resolvers/spring-route-mapping.test.tscd gitnexus && npx tsc --noEmitRisk & rollout
Risk is low and localized to route extraction:
No migration is required beyond normal re-indexing on the target repository.
Checklist
AGENTS.md/ overlays changed: headers, scope block, and changelog updated per project conventions