feat: add Micronaut framework route extraction#973
Open
lw-yang wants to merge 1 commit into
Open
Conversation
Add a new framework resolver that extracts HTTP route nodes from Micronaut annotations (@controller, @get, @post, @put, @delete, @patch, @Head, @options, @HttpMethodMapping), enabling codegraph_explore to resolve URL paths to their handler methods in Micronaut-based projects like Kestra. Closes colbymchenry#971 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
micronautResolverframework resolver that extracts HTTP route nodes from Micronaut annotations, enablingcodegraph_exploreto resolve URL paths (e.g./api/v1/executions/search) directly to their handler methods.Supported annotations:
@Controller("/prefix"),@Client("/prefix")@Get,@Post,@Put,@Delete,@Patch,@Head,@Options,@Trace,@HttpMethodMapping@Get("/path"),@Get(uri = "/path"),@Get(value = "/path"), bare@GetWhat it does:
pom.xml/build.gradle/ annotation scanningkind: 'route'nodes with full resolved paths (class prefix + method path)referencesedges linking route nodes to handler method names@Clientdeclarative HTTP clients) without access modifiersFiles changed
src/resolution/frameworks/micronaut.ts— New resolver (extract + detect + resolve)src/resolution/frameworks/index.ts— RegistermicronautResolverin the framework list__tests__/micronaut.test.ts— 16 test cases covering all annotation patternsTest plan
Verification on Kestra (real-world Micronaut project)
Ran
codegraph initon Kestra (2,877 files) with this branch:Sample indexed routes:
Before this change, querying
/executions/searchvia CodeGraph returned irrelevant FTS5 matches on the word "search" across unrelated symbols. After this change, the route resolves directly to the handler method with full call-chain traversal.Closes #971