fix(core): reject collapsed relationship joins - #2697
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
ChangesRelationship merge validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change rejects conflicting relationship joins instead of silently producing potentially incorrect SQL, while preserving identical-relationship deduplication. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Summary
This is the short-term containment described in #2688. It prevents plausible-but-wrong SQL while full first-class relationship aliases remain a larger architectural change.
What failure does this repair?
The regression test builds bill-to and ship-to edges from orders to addresses with different join conditions, then merges the two graphs.
Before this change:
failed with:
The unit value shows merge_graph returned Ok and silently discarded the incoming ship-to edge. In the role-playing-dimension query from #2688, that causes both calculated cities to use the bill-to join.
After this change, the same graph merge returns a plan error that names both conflicting conditions.
How is it tested?
Duplicate check
Searched open PRs for #2688, relationship handles, and distinct join aliases; the issue still has no linked PR. #976 was also reviewed and is an unrelated, service-only semantics-enrichment alias change that does not touch wren-core or relationship planning.
Addresses #2688.
Summary by CodeRabbit