Add line segment infos line modification#175
Add line segment infos line modification#175basseche wants to merge 1 commit intoadd_LineSegmentInfos_LineCreationfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR introduces a new Changes
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Signed-off-by: basseche <bassel.el-cheikh_externe@rte-france.com>
4d4295f to
4fb2cf6
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/org/gridsuite/modification/dto/LineCreationInfos.java`:
- Around line 50-51: LineCreationInfos exposes the new field lineSegments but
the LineCreation class (methods check() and apply()) ignores it; either wire
lineSegments into the creation flow by validating and converting
LineCreationInfos.getLineSegments() in LineCreation.check()/apply() and using
those segments instead of the current generated segments (e.g., map
LineSegmentInfos -> domain segment objects and enforce limits/constraints), or
explicitly reject/handle the field by adding validation in LineCreation.check()
to throw a clear client error when lineSegments is non-empty (or
populate/normalize it back into the response) so clients are not silently
ignored.
In `@src/main/java/org/gridsuite/modification/dto/LineModificationInfos.java`:
- Around line 50-51: The new DTO field LineModificationInfos.lineSegments is
never consumed by the modification logic; update LineModification.apply() and/or
modifyLine() to read and use lineSegments from the provided
LineModificationInfos when computing segment-based limits (e.g., pass the list
into the existing limit-generation or segment-matching code paths) so the API
field takes effect, or alternatively add explicit validation in
LineModification.apply() that rejects requests containing non-empty lineSegments
with a clear error (throwing an exception or returning a validation failure) to
avoid silently ignored input; locate usages by the class/method names
LineModification, apply(), modifyLine(), and the DTO class LineModificationInfos
and incorporate the field into the limit calculation or validation flow
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7144ece6-2787-450a-9c6d-6872e1bb61ef
📒 Files selected for processing (3)
src/main/java/org/gridsuite/modification/dto/LineCreationInfos.javasrc/main/java/org/gridsuite/modification/dto/LineModificationInfos.javasrc/main/java/org/gridsuite/modification/dto/LineSegmentInfos.java
| @Schema(description = "Segments used from catalogue") | ||
| private List<LineSegmentInfos> lineSegments; |
There was a problem hiding this comment.
lineSegments is currently a silent no-op in line creation flow.
LineCreationInfos now exposes lineSegments, but the execution path in src/main/java/org/gridsuite/modification/modifications/LineCreation.java (Line 33-75 snippet) does not consume it in check()/apply(). So clients can send segment data that is silently ignored.
Please either wire this field into creation logic (limit generation path) or reject/populate it explicitly until supported.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/org/gridsuite/modification/dto/LineCreationInfos.java` around
lines 50 - 51, LineCreationInfos exposes the new field lineSegments but the
LineCreation class (methods check() and apply()) ignores it; either wire
lineSegments into the creation flow by validating and converting
LineCreationInfos.getLineSegments() in LineCreation.check()/apply() and using
those segments instead of the current generated segments (e.g., map
LineSegmentInfos -> domain segment objects and enforce limits/constraints), or
explicitly reject/handle the field by adding validation in LineCreation.check()
to throw a clear client error when lineSegments is non-empty (or
populate/normalize it back into the response) so clients are not silently
ignored.
| @Schema(description = "segments used from catalog to generate limits") | ||
| private List<LineSegmentInfos> lineSegments; |
There was a problem hiding this comment.
lineSegments is not applied in line modification execution.
The added DTO field is not used by src/main/java/org/gridsuite/modification/modifications/LineModification.java (Line 28-77 snippet): apply() and modifyLine() never read lineSegments. This makes the new API field ineffective at runtime.
Please connect this field to the modification logic (or block unsupported input) to avoid false feature signaling.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/org/gridsuite/modification/dto/LineModificationInfos.java`
around lines 50 - 51, The new DTO field LineModificationInfos.lineSegments is
never consumed by the modification logic; update LineModification.apply() and/or
modifyLine() to read and use lineSegments from the provided
LineModificationInfos when computing segment-based limits (e.g., pass the list
into the existing limit-generation or segment-matching code paths) so the API
field takes effect, or alternatively add explicit validation in
LineModification.apply() that rejects requests containing non-empty lineSegments
with a clear error (throwing an exception or returning a validation failure) to
avoid silently ignored input; locate usages by the class/method names
LineModification, apply(), modifyLine(), and the DTO class LineModificationInfos
and incorporate the field into the limit calculation or validation flow
accordingly.
|



PR Summary
Add line segment infos into LineModificationInfos