Skip to content

Fix resource bundle annotation processing#72

Merged
antoinebhs merged 7 commits intomainfrom
fix-reports
Mar 20, 2026
Merged

Fix resource bundle annotation processing#72
antoinebhs merged 7 commits intomainfrom
fix-reports

Conversation

@antoinebhs
Copy link
Contributor

@antoinebhs antoinebhs commented Mar 20, 2026

PR Summary

When annotationProcessorPaths is configured in the Maven compiler plugin, Maven uses only the explicitly listed processors. It no longer discovers processors from the compile classpath.
This broke @AutoService, which generates the META-INF/services/com.powsybl.commons.report.ReportResourceBundle descriptor at compile time. Without that descriptor, ServiceLoader-based discovery fails at runtime with "Report bundle not found".

The root cause was that MapStruct requires annotationProcessorPaths for correct Lombok ordering, but this was defined in the parent POM (affecting all modules), silently disabling AutoService in monitor-worker-server.
If one need autoservice annotation processing, they need to be added below mapstruct annotations processing as per https://mapstruct.org/documentation/installation/.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Warning

Rate limit exceeded

@antoinebhs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 13 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8209bceb-caec-474a-ae7f-08ec728ee4eb

📥 Commits

Reviewing files that changed from the base of the PR and between 6efc6d4 and 8a1e8b4.

📒 Files selected for processing (3)
  • monitor-server/pom.xml
  • monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/report/MonitorWorkerServerReportResourceBundleTest.java
  • pom.xml
📝 Walkthrough

Walkthrough

Maven build configuration is being reorganized by moving annotation processor management from the parent pom.xml to the monitor-server submodule, including explicit versioning for MapStruct and Lombok processors. Additionally, error handling in SecurityAnalysisRunComputationStep is cleaned up, and new tests validate ReportResourceBundle service registration and resolution.

Changes

Cohort / File(s) Summary
Annotation Processor Configuration
monitor-server/pom.xml, pom.xml
Parent pom.xml removes MapStruct/Lombok annotation processor version properties and maven-compiler-plugin configuration; monitor-server/pom.xml adds equivalent configuration with explicit annotationProcessorPaths for mapstruct-processor, lombok, and lombok-mapstruct-binding.
Error Handling Cleanup
monitor-worker-server/src/main/java/.../SecurityAnalysisRunComputationStep.java
Removed unused MonitorWorkerServerReportResourceBundle.BASE_NAME reference when constructing error ReportNode in exception path.
Report Resource Bundle Tests
monitor-worker-server/src/test/java/.../MonitorWorkerServerReportResourceBundleTest.java
Added new test class with tests for ServiceLoader auto-registration and ResourceBundle.getBundle() resolution of MonitorWorkerServerReportResourceBundle.

Suggested reviewers

  • klesaulnier
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix resource bundle annotation processing' directly describes the main change: restoring resource bundle generation via annotation processing configuration.
Description check ✅ Passed The description clearly explains the root cause, the issue with annotation processing discovery, and how the fix addresses MapStruct-related processor ordering.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@antoinebhs antoinebhs changed the title fix-reports Fix resource bundle annotation processing Mar 20, 2026
@antoinebhs antoinebhs requested a review from khouadrired March 20, 2026 09:51
@sonarqubecloud
Copy link

@antoinebhs antoinebhs merged commit c216da6 into main Mar 20, 2026
4 checks passed
@antoinebhs antoinebhs deleted the fix-reports branch March 20, 2026 10:44
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.

2 participants