Fix invalidated multiroot studies blocked nodes#1007
Conversation
|
Warning Review limit reached
More reviews will be available in 47 minutes and 24 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR refactors error handling for node tree unblocking across two service methods. ChangesError handling refactor for node tree unblocking
Test expansion for multi-root-network invalidation
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/java/org/gridsuite/study/server/service/StudyService.java (1)
3706-3710: Unblock contract is enforced by the only in-repo caller
StudyService.invalidateStudyRootNetwork(...)is called only fromSupervisionService.invalidateStudy(...), andinvalidateStudy(...)unblocks the tree in afinallyblock viastudyService.unblockNodeTree(...). The tree won’t remain blocked on exceptions frominvalidateStudyRootNetwork(...)when used this way.Since
invalidateStudyRootNetwork(...)is stillpublic, consider reducing visibility or documenting that callers must always unblock (unblockNodeTree(...)) on failure.🤖 Prompt for 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. In `@src/main/java/org/gridsuite/study/server/service/StudyService.java` around lines 3706 - 3710, The method StudyService.invalidateStudyRootNetwork(...) is public but its unblock contract is enforced only by the in-repo caller SupervisionService.invalidateStudy(...), which calls studyService.unblockNodeTree(...) in a finally; to avoid accidental blocking leaks either reduce the visibility of invalidateStudyRootNetwork(...) (make it package-private or private) so it cannot be called externally without the unblock guarantee, or explicitly document the requirement in the method javadoc that callers MUST call unblockNodeTree(...) on failure; update the method signature visibility and/or add a clear javadoc comment referencing unblockNodeTree(...) and SupervisionService.invalidateStudy(...) so callers know to unblock the tree on exceptions.
🤖 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.
Nitpick comments:
In `@src/main/java/org/gridsuite/study/server/service/StudyService.java`:
- Around line 3706-3710: The method StudyService.invalidateStudyRootNetwork(...)
is public but its unblock contract is enforced only by the in-repo caller
SupervisionService.invalidateStudy(...), which calls
studyService.unblockNodeTree(...) in a finally; to avoid accidental blocking
leaks either reduce the visibility of invalidateStudyRootNetwork(...) (make it
package-private or private) so it cannot be called externally without the
unblock guarantee, or explicitly document the requirement in the method javadoc
that callers MUST call unblockNodeTree(...) on failure; update the method
signature visibility and/or add a clear javadoc comment referencing
unblockNodeTree(...) and SupervisionService.invalidateStudy(...) so callers know
to unblock the tree on exceptions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b2ff5abb-4493-4c48-9126-ce22d22877d5
📒 Files selected for processing (2)
src/main/java/org/gridsuite/study/server/service/StudyService.javasrc/main/java/org/gridsuite/study/server/service/SupervisionService.java
etiennehomer
left a comment
There was a problem hiding this comment.
We should execute testInvalidateStudy() with 2 root networks and check that all nodes are unblocked
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/test/java/org/gridsuite/study/server/SupervisionControllerTest.java (1)
80-81: ⚡ Quick winUnused constant
SECOND_CASE_UUID.The constant
SECOND_CASE_UUIDis declared but never referenced. Consider either using it in theaddSecondRootNetworkhelper (lines 173, 181) or removing it if not needed.🤖 Prompt for 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. In `@src/test/java/org/gridsuite/study/server/SupervisionControllerTest.java` around lines 80 - 81, SECOND_CASE_UUID is declared but unused; update addSecondRootNetwork to use this constant for the second case's UUID (e.g., when constructing or setting up the Case/CaseEntity in addSecondRootNetwork) so the test references the declared constant, or remove the SECOND_CASE_UUID declaration if you prefer not to reference a specific UUID; ensure the symbol SECOND_CASE_UUID is either consumed by addSecondRootNetwork or deleted to eliminate the unused constant.
🤖 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/test/java/org/gridsuite/study/server/SupervisionControllerTest.java`:
- Around line 167-183: In addSecondRootNetwork, the two RootNetworkInfos
builders use UUID.randomUUID() separately for CaseInfos causing inconsistent
case IDs; replace both UUID.randomUUID() calls with the shared SECOND_CASE_UUID
constant so the CaseInfos passed to
rootNetworkService.insertCreationRequest(...) and
studyService.createRootNetwork(...) use the same UUID (update the CaseInfos(...)
constructors in both builder invocations).
---
Nitpick comments:
In `@src/test/java/org/gridsuite/study/server/SupervisionControllerTest.java`:
- Around line 80-81: SECOND_CASE_UUID is declared but unused; update
addSecondRootNetwork to use this constant for the second case's UUID (e.g., when
constructing or setting up the Case/CaseEntity in addSecondRootNetwork) so the
test references the declared constant, or remove the SECOND_CASE_UUID
declaration if you prefer not to reference a specific UUID; ensure the symbol
SECOND_CASE_UUID is either consumed by addSecondRootNetwork or deleted to
eliminate the unused constant.
🪄 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: b184152a-e491-44ed-875a-5fbff4084a09
📒 Files selected for processing (1)
src/test/java/org/gridsuite/study/server/SupervisionControllerTest.java
|



PR Summary
Unblock node tree only after all root networks have been invalidated. The previous approach oversaw that doUnbuildNodeTree locks all root networks so after unlocking the first root network it was getting locked again one the second pass