Conversation
WalkthroughReplaced a strict lookup that threw on missing root resolution data with optional safe access in the resolvability graph; cross-linking between entity and root resolution data now only happens when the root path exists. Added a new test scenario and three subgraph fixtures exercising field resolvability and unreachable/inaccessible key fields. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Reasoning: Small, focused logic change in core graph code plus new multi-subgraph test fixtures. Review requires checking conditional linking semantics and verifying test coverage and expectations. Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
Comment |
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
composition/src/resolvability-graph/graph.ts(1 hunks)composition/tests/v1/resolvability.test.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
composition/tests/v1/resolvability.test.ts (4)
composition/tests/utils/utils.ts (1)
federateSubgraphsFailure(49-57)composition/src/router-compatibility-version/router-compatibility-version.ts (1)
ROUTER_COMPATIBILITY_VERSION_ONE(3-3)composition/src/subgraph/types.ts (1)
Subgraph(11-15)composition/src/ast/utils.ts (1)
parse(272-274)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: build_push_image (nonroot)
- GitHub Check: build_push_image
- GitHub Check: image_scan (nonroot)
- GitHub Check: image_scan
- GitHub Check: build_test
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: build_test
🔇 Additional comments (2)
composition/src/resolvability-graph/graph.ts (1)
301-306: LGTM! Defensive change appropriately handles missing root resolution data.The change from
getOrThrowErrorto optional.get()access with existence gating prevents crashes when root path data is unavailable due to misconfigured @key fields across subgraphs. Cross-linking now only occurs when both entity and root resolution data exist.composition/tests/v1/resolvability.test.ts (1)
3391-3461: LGTM! Subgraph definitions correctly model the error scenario.The three subgraphs properly test resolvability errors arising from:
- Inaccessible key fields (
idB: ScalarID! @inaccessible) in haaa and haab- Mismatched key fields between subgraphs (haaa/haab use
idB, haac usesidA)- Complex nested relationships through Connection/Edge types
This setup validates that the graph handles cases where entities cannot jump between subgraphs due to incorrect @key configurations.
Summary by CodeRabbit
Bug Fixes
Tests
Checklist