Set node column position when creation#995
Conversation
…into set_node_column_position_when_creation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds column position tracking for network modification tree nodes. Repository queries retrieve column positions and child UUIDs. The service now manages column positions during node insertion (CHILD/BEFORE/AFTER modes) and adjusts sibling positions as needed. Tests verify column position behavior across insertion, cut/paste, and duplication operations. ChangesColumn Position Tracking for Network Modification Nodes
Suggested Reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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.
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/study/server/service/NetworkModificationTreeService.java`:
- Around line 151-159: getNextColumnPosition currently computes next sibling
columnPosition in-memory using
networkModificationNodeInfoRepository.findColumnPositionsByUuidIn(nodesRepository.findChildrenUuids(parentNodeId))
and returns max+1, which is race-prone; change it to perform the max calculation
inside a single transactional DB operation (e.g. a repository method that runs
SELECT MAX(column_position) FROM ... WHERE parent_id = :parentNodeId FOR UPDATE
or an equivalent DB-side atomic increment) or add a unique constraint on
(parent_id, column_position) and implement a retry-on-constraint-violation
strategy; ensure the new repository method is used in getNextColumnPosition and
that the surrounding service call is annotated/handled with a transaction to
prevent concurrent duplicates.
🪄 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: 243a4303-d277-4f19-a49a-beb510f44a97
📒 Files selected for processing (6)
src/main/java/org/gridsuite/study/server/repository/networkmodificationtree/NetworkModificationNodeInfoRepository.javasrc/main/java/org/gridsuite/study/server/repository/networkmodificationtree/NodeRepository.javasrc/main/java/org/gridsuite/study/server/service/NetworkModificationTreeService.javasrc/test/java/org/gridsuite/study/server/NetworkModificationTreeTest.javasrc/test/java/org/gridsuite/study/server/studycontroller/NodeControllerTest.javasrc/test/java/org/gridsuite/study/server/studycontroller/StudyTestBase.java
|



PR Summary