feat(parser): extract Java microservice config from annotations and YAML#577
Open
JoseJacin wants to merge 2 commits into
Open
feat(parser): extract Java microservice config from annotations and YAML#577JoseJacin wants to merge 2 commits into
JoseJacin wants to merge 2 commits into
Conversation
added 2 commits
June 24, 2026 15:36
New constants: - _REST_CLIENT_ANNOTATIONS: detects @RegisterRestClient - _HTTP_METHOD_ANNOTATIONS: @get, @post, @put, @delete, @patch, @Head, @options - _REDIS_CHANNEL_ANNOTATIONS: @ConfigProperty New static method _get_annotation_arg(): extracts named or positional annotation argument values from the Tree-sitter AST. _extract_classes() enhancements (Java): - @RegisterRestClient(configKey="...") → extra["rest_client_config_key"] - Class-level @path("...") → extra["http_path"] _extract_functions() enhancements (Java): - @GET/@POST/... → extra["http_method"] - Method-level @path("...") → extra["http_path"] - @ConfigProperty(name="...") → extra["config_properties"] New language "quarkus-config" for application*.yml/yaml files. New language "properties" for .properties files. New method _parse_quarkus_config(): parses application.yml with PyYAML. Emits Config nodes for: - quarkus.rest-client.<key>.url (MicroProfile REST clients) - redis.channels list (Redis pub/sub) - kafka.bootstrap.servers - mp.messaging.outgoing/incoming.<channel>.topic (SmallRye Kafka) - spring.kafka.bootstrap-servers (Spring Boot) - spring.redis.host / app.redis.host - kafka.consumer.topic.<name>.name (Spring Boot Kafka consumers) - *-base-url / *-url patterns in custom config blocks New method _parse_properties(): same extractions for .properties format. New edge kinds: CONFIGURES, SUBSCRIBES, PRODUCES, CONSUMES. New node kind: Config.
Tests for TestJavaMicroserviceAnnotations: - @RegisterRestClient(configKey) stored in extra["rest_client_config_key"] - Class-level @path stored in extra["http_path"] - @GET/@POST/@delete stored in extra["http_method"] - Method-level @path stored in extra["http_path"] - Non-REST-client classes not marked - Methods without HTTP annotations have no http_method Tests for TestQuarkusConfigParser: - application.yml / application.yaml / application-local.yml → quarkus-config - .properties → properties language - Non-application .yml → None (not picked up) - quarkus.rest-client.<key>.url → Config node with correct name and extra - Multiple REST clients → one Config node each - redis.channels list → Config node with channels list - kafka.bootstrap.servers → kafka:bootstrap Config node - mp.messaging.outgoing.<channel>.topic → Config node (kafka_outgoing) - mp.messaging.incoming.<channel>.topic → Config node (kafka_incoming) - spring.kafka.bootstrap-servers → kafka:bootstrap Config node - Empty application.yml → only File node emitted
c467094 to
ba0880c
Compare
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.
Linked issue:
No related issue — new feature contribution.
What & why:
Adds two capabilities to the knowledge graph:
@RegisterRestClient,@Path,@GET/@POST/@PUT/@DELETE/@PATCH, and@ConfigPropertyfrom.javafilesapplication*.yml,application*.yaml, and.propertiesfiles as new languagesquarkus-config/propertiesBoth emit a new node kind
Configwith edgesCONFIGURES,SUBSCRIBES,PRODUCES,CONSUMES.Why: enables cross-repo queries like "which services call this endpoint?" or "what topics does this service produce?" without reading any source file manually.
Example — REST Client interface
Graph emits: Class node with rest_client_config_key = "inventory-api", Function nodes with http_method = "GET"/"POST"/"DELETE".
Example — application.yml
Graph emits: Config nodes rest-client:inventory-api, kafka:orders (outgoing), redis:channels.
Example — cross-repo query
How it was tested:
20 new tests in two classes:
Checklist:
123 passed)uv run ruff check code_review_graph/uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optional