Conversation
… a field too deep
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: gopherium/gophenberg/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughField creation and movement now pass a nesting-depth limit to storage operations. The PostgreSQL store checks that limit when it creates or moves fields. New tests cover over-limit operations and concurrent requests. ChangesField depth enforcement
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to No outstanding issue identified here blocks merging after the prescribed tests and lint checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Closes #244
What
The store now checks the field depth limit again inside its lock, on every field move and every new sub field, where it already checks that a field cannot move inside itself. The registry hands it the limit
GOPHENBERG_FIELD_DEPTHsets. Two moves, or a move and a new sub field, that each pass on their own but together would nest a field too deep now leave the second one refused withfield_too_deep.Why
The limit was only checked before the store took its lock, so two writes arriving at the same moment were each judged on the tree as it stood before the other landed. Both could pass and leave a field deeper than the site allows.
Testing Instructions
docker compose up -dand runmake cover.TestTwoMovesAtTheSameMomentLeaveNoFieldPastTheLimitholds the store's lock, queues two moves that each pass alone, releases them together and expects the second one refused with no field past the limit.make lint.Summary by CodeRabbit