Add applicability per root network tag on network modifications - #219
Add applicability per root network tag on network modifications#219flomillot wants to merge 7 commits into
Conversation
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
|
Warning Review limit reached
Next review available in: 46 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesRoot-network applicability
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/org/gridsuite/modification/dto/ModificationInfos.java`:
- Around line 165-167: Update the applicability check in ModificationInfos so a
null value for the rootNetworkTag entry is treated as applicable, with only an
explicit Boolean false disabling it; avoid returning a nullable Boolean that can
be unboxed. Add a regression test covering an applicabilityByRootNetworkTag
entry whose value is null.
🪄 Autofix
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 Plus
Run ID: 9a164320-11d9-46ea-8088-e0310a976005
📒 Files selected for processing (1)
src/main/java/org/gridsuite/modification/dto/ModificationInfos.java
…fication-applicability
The method combines the global activation flag and the per root network tag applicability, while being applicable refers to the tag alone. Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
A stashed modification is not activated on any root network: the stash is now part of the activation rule instead of being checked separately by every caller. An undefined stash flag keeps the default of the field, not stashed. Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
….java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
A tag mapped to a null value reaches the DTO through deserialization. The map lookup now tells it apart from an explicit false, and the test locks that in. Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…string The test compares a hardcoded toString, which lombok now renders with applicabilityByRootNetworkTag between activated and description. Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
|
| assertEquals( | ||
| "TwoWindingsTransformerCreationInfos(super=BranchCreationInfos(super=EquipmentCreationInfos(super=EquipmentModificationInfos(super=ModificationInfos(uuid=null, " | ||
| + "type=TWO_WINDINGS_TRANSFORMER_CREATION, date=null, stashed=false, messageType=null, messageValues=null, activated=true, description=a dummy description), " | ||
| + "type=TWO_WINDINGS_TRANSFORMER_CREATION, date=null, stashed=false, messageType=null, messageValues=null, activated=true, applicabilityByRootNetworkTag=null, " |
There was a problem hiding this comment.
can applicabilityByRootNetworkTag be null ? for a modification stored in gridexplore for example ?
There was a problem hiding this comment.



A network modification now carries its applicability per root network tag, next to its global
activatedflag:Map<String, Boolean> applicabilityByRootNetworkTag, where a tag without an entry is applicable.isActivatedOn(rootNetworkTag)gathers the rule used by the servers when applying modifications:!stashed && activated && applicability.getOrDefault(tag, true). The stash is part of the rule so that every caller shares a single predicate; a stashed modification can no longer be applied to a network.