fix: fix merging fetches and add dependencies update#1232
Conversation
WalkthroughThe changes add a new method to update fetch dependencies when duplicate single fetches are merged, ensuring dependency references are correctly replaced. The Fetch interface was updated to return pointers and expose coordinate dependencies. The fetch tree initialization was encapsulated in a new method called before deduplication. A test was added to verify dependency updates after deduplication. Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ 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). (2)
✨ Finishing Touches
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 (
|
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 (3)
v2/pkg/engine/postprocess/deduplicate_single_fetches.go(1 hunks)v2/pkg/engine/postprocess/deduplicate_single_fetches_test.go(1 hunks)v2/pkg/engine/resolve/fetch.go(6 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
v2/pkg/engine/resolve/fetch.go (1)
v2/pkg/engine/resolve/loader.go (1)
DataSourceInfo(46-49)
🔇 Additional comments (4)
v2/pkg/engine/postprocess/deduplicate_single_fetches_test.go (1)
74-268: Well-structured test case for dependency updates during fetch deduplication.The test comprehensively validates that when duplicate fetches are merged, all dependency references are correctly updated throughout the fetch tree. The test setup with multiple interdependent fetches effectively demonstrates the cascading dependency updates.
v2/pkg/engine/postprocess/deduplicate_single_fetches.go (1)
47-49: Good optimization with the early continue.The flag-based optimization to skip coordinate dependency updates when no replacements were made is a nice performance improvement.
v2/pkg/engine/resolve/fetch.go (2)
22-24: Clean interface evolution to support dependency updates.The changes to return
*FetchDependenciesand expose coordinate dependencies through a dedicated method enable the deduplication logic to update dependencies in-place. All implementations are consistently updated.Also applies to: 97-103, 172-178, 219-225, 254-260
339-339: Correct removal of CoordinateDependencies from equality comparison.Excluding coordinate dependencies from the equality check is the right approach, as it allows fetches with identical operations but different dependency relationships to be deduplicated.
0501cb2 to
23815d4
Compare
🤖 I have created a release *beep* *boop* --- ## [2.0.0-rc.207](v2.0.0-rc.206...v2.0.0-rc.207) (2025-07-15) ### Bug Fixes * fix merging fetches and add dependencies update ([#1232](#1232)) ([c91d59e](c91d59e)) --- 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 related to merging fetches. * **Chores** * Updated dependencies. * **Documentation** * Added a changelog entry for version 2.0.0-rc.207. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Tests
Refactor
Checklist