-
Notifications
You must be signed in to change notification settings - Fork 0
Add report mode handling in report service and related classes #728
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
base: main
Are you sure you want to change the base?
Add report mode handling in report service and related classes #728
Conversation
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
…cation-report-when-building-variant # Conflicts: # src/test/java/org/gridsuite/modification/server/service/BuildTest.java
|
dbraquart
left a 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.
code: 1 remark
tests: in progress
| String endpoint = reportMode == ReportMode.REPLACE ? "replace" : ""; | ||
| var path = UriComponentsBuilder.fromPath("{reportUuid}" + (endpoint.isEmpty() ? "" : "/" + endpoint)) |
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.
| String endpoint = reportMode == ReportMode.REPLACE ? "replace" : ""; | |
| var path = UriComponentsBuilder.fromPath("{reportUuid}" + (endpoint.isEmpty() ? "" : "/" + endpoint)) | |
| var path = UriComponentsBuilder.fromPath("{reportUuid}{endpoint}") |
| public void sendReport(UUID reportUuid, ReportNode reportNode, ReportMode reportMode) { | ||
| String endpoint = reportMode == ReportMode.REPLACE ? "replace" : ""; | ||
| var path = UriComponentsBuilder.fromPath("{reportUuid}" + (endpoint.isEmpty() ? "" : "/" + endpoint)) | ||
| .buildAndExpand(reportUuid) |
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.
| .buildAndExpand(reportUuid) | |
| .buildAndExpand(reportUuid, reportMode == ReportMode.REPLACE ? "/replace" : "") |
simplier ? and maybe will remove the Sonar issue ?
TheMaskedTurtle
left a 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.
Same remark as David otherwise it is fine for me



PR Summary
This pull request introduces support for a new
ReportModeoption in the reporting workflow, allowing reports to be either appended to or replaced. The changes involve updating the DTOs, service methods, and relevant tests to handle this new mode, while maintaining backward compatibility by defaulting to the append behavior.Feature: Report mode support
ReportModeenum (APPEND,REPLACE) inorg.gridsuite.modification.server.dtoto specify how reports are handled.ReportInfosDTO to include areportModefield, a no-argument constructor, and a constructor that defaultsreportModetoAPPEND.Service changes
ReportService.sendReportmethod to accept aReportModeparameter, determining the endpoint used for report submission (replaceforREPLACE, default forAPPEND). Overloaded the method to maintain backward compatibility.NetworkModificationApplicatorto pass thereportModefromReportInfoswhen sending reports.