fix: make propagated operation names unique#1256
Conversation
WalkthroughThis change introduces operation name propagation for downstream subgraph fetches in a GraphQL federation engine. It adds new fields and logic to carry, modify, and append operation names through the planning, fetch configuration, and post-processing stages. Associated tests and documentation are updated to reflect these enhancements, and a new post-processing component is introduced to append fetch IDs to operation names. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
c72a339 to
41771c5
Compare
41771c5 to
12336f8
Compare
12336f8 to
154cbb5
Compare
When operation names are sent to downstream subgraphs, send
them in the following format:
$operationName__$subgraphName__$sequenceID
Also some comments were updated.
154cbb5 to
181e48a
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go(5 hunks)v2/pkg/engine/datasource/graphql_datasource/graphql_datasource_federation_test.go(10 hunks)v2/pkg/engine/plan/planner.go(1 hunks)v2/pkg/engine/plan/visitor.go(2 hunks)v2/pkg/engine/postprocess/fetch_id_appender.go(1 hunks)v2/pkg/engine/postprocess/postprocess.go(4 hunks)v2/pkg/engine/resolve/fetch.go(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- v2/pkg/engine/plan/planner.go
🚧 Files skipped from review as they are similar to previous changes (5)
- v2/pkg/engine/plan/visitor.go
- v2/pkg/engine/datasource/graphql_datasource/graphql_datasource_federation_test.go
- v2/pkg/engine/resolve/fetch.go
- v2/pkg/engine/postprocess/postprocess.go
- v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
v2/pkg/engine/postprocess/fetch_id_appender.go (2)
v2/pkg/engine/resolve/fetchtree.go (4)
FetchTreeNode(8-15)FetchTreeNodeKindSingle(20-20)FetchTreeNodeKindParallel(22-22)FetchTreeNodeKindSequence(21-21)v2/pkg/engine/resolve/fetch.go (2)
Fetch(20-25)SingleFetch(89-96)
🔇 Additional comments (2)
v2/pkg/engine/postprocess/fetch_id_appender.go (2)
9-12: LGTM! Clean struct definition.The
fetchIDAppenderstruct is well-defined with a clear purpose and minimal state. Thedisableflag provides good control over the processor behavior.
14-19: LGTM! Proper entry point design.The method correctly implements the disable check and proper delegation pattern. The early return when disabled is efficient.
🤖 I have created a release *beep* *boop* --- ## [2.0.0-rc.215](v2.0.0-rc.214...v2.0.0-rc.215) (2025-07-31) ### Bug Fixes * make propagated operation names unique ([#1256](#1256)) ([c2be87e](c2be87e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Resolved an issue to ensure propagated operation names are unique. * **Documentation** * Added a changelog entry for version 2.0.0-rc.215. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
When operation names are sent to downstream subgraphs, send them in the following format:
Also some comments were updated.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
Checklist