-
Notifications
You must be signed in to change notification settings - Fork 6
[NAE-2204] Plugin EntryPoint class cannot resolve annotation when proxyed by Spring #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…xyed by Spring - Moved `resolveClass` and `indexOfClass` methods to a new `ReflectionUtils` utility class for reuse and better code organization. - Replaced old implementations with calls to `ReflectionUtils` in affected classes. - Removed redundant code from `ApplicationRunnerOrderResolver` to streamline functionality.
WalkthroughRefactors class-resolution logic to a new shared utility NaeReflectionUtils, updates ApplicationRunner sorting and module service grouping to use it, and adds the new adapter module as a Maven dependency. Removes duplicate resolveClass and indexOfClass implementations from ApplicationRunnerOrderResolver. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as Application
participant Exec as ApplicationRunnerExecutor
participant Resolver as ApplicationRunnerOrderResolver
participant Util as NaeReflectionUtils
App->>Exec: run()
Exec->>Resolver: sort(runners)
loop For each runner
Resolver->>Util: resolveClass(runner)
Util-->>Resolver: Class
end
Resolver->>Util: indexOfClass(runners, targetClass)
Util-->>Resolver: index
Resolver-->>Exec: sorted runners
Exec-->>App: execute in order
sequenceDiagram
autonumber
participant Injector as ModuleServiceInjector
participant Util as NaeReflectionUtils
loop For each service bean
Injector->>Util: resolveClass(bean)
Util-->>Injector: Class
Injector->>Injector: read @ModuleService annotations from Class
Injector-->>Injector: group by module
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
application-engine/src/main/groovy/com/netgrif/application/engine/integration/modules/ModuleServiceInjector.groovy
(2 hunks)application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerExecutor.java
(1 hunks)application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java
(1 hunks)nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/utils/ReflectionUtils.java
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerExecutor.java (1)
nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/utils/ReflectionUtils.java (1)
ReflectionUtils
(7-50)
application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java (1)
nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/utils/ReflectionUtils.java (1)
ReflectionUtils
(7-50)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Test
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
🔇 Additional comments (1)
application-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerOrderResolver.java (1)
17-19
: Good centralization of proxy-unwrapping logic.Static-importing shared utils reduces duplication and keeps behavior consistent across components.
.../main/groovy/com/netgrif/application/engine/integration/modules/ModuleServiceInjector.groovy
Outdated
Show resolved
Hide resolved
...n-engine/src/main/java/com/netgrif/application/engine/startup/ApplicationRunnerExecutor.java
Outdated
Show resolved
Hide resolved
...apter/src/main/java/com/netgrif/application/engine/adapter/spring/utils/ReflectionUtils.java
Outdated
Show resolved
Hide resolved
...apter/src/main/java/com/netgrif/application/engine/adapter/spring/utils/ReflectionUtils.java
Outdated
Show resolved
Hide resolved
...apter/src/main/java/com/netgrif/application/engine/adapter/spring/utils/ReflectionUtils.java
Outdated
Show resolved
Hide resolved
…xyed by Spring - Renamed `ReflectionUtils` to `NaeReflectionUtils` and adjusted related imports for accuracy and consistency. - Enhanced `resolveClass` with null checks and proxy target class handling for better reliability. - Updated impacted classes to utilize the refactored utility methods, ensuring improved readability and maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
application-engine/pom.xml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Test
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
🔇 Additional comments (1)
application-engine/pom.xml (1)
138-142
: New dependency added — reconcile with PR description and ensure availabilityapplication-engine/pom.xml (lines 138–142) adds com.netgrif:nae-spring-core-adapter at ${project.version}, contradicting the PR note "No new dependencies were introduced." Verification attempt failed (search returned "No files were searched"), so I could not confirm if this is an internal reactor module or an external artifact.
- If internal: add the module to the top-level or include it in this PR so the reactor builds.
- If external: ensure com.netgrif:nae-spring-core-adapter at the resolved version (POM uses ${project.version}; confirm that version is published and resolvable from your repositories).
- Update the PR description to accurately state that a new dependency was added.
Description
Move the method for resolving a class of Spring bean as a utility method for broader usage. Use this method in a module service bean injection.
Fixes NAE-2204
Dependencies
No new dependencies were introduced.
How Has Been This Tested?
Tested by manually launching the engine.
Test Configuration
Checklist:
Summary by CodeRabbit
Refactor
Chores