-
Notifications
You must be signed in to change notification settings - Fork 109
Resolve database pending_updates duplicates bug; refactor database schema & model sharing #2166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve database pending_updates duplicates bug; refactor database schema & model sharing #2166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR resolves a bug where duplicate entries appeared in the pending_updates field of managed database resources and refactors the database-related code by centralizing shared functionality into a new databaseshared package.
- Implements deduplication logic for pending updates using a new
FrameworkDropDuplicatesIterhelper function - Extracts common database models, schema attributes, and utility functions into a shared
linode/helper/databasesharedpackage - Adds comprehensive test coverage with HTTP client modification support to verify the deduplication fix
Reviewed Changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| linode/helper/http.go | Adds HTTPClientModifier type definition for modifying HTTP clients |
| linode/helper/framework_util.go | Adds FrameworkDropDuplicatesIter function for deduplicating iterator values |
| linode/helper/databaseshared/*.go | New package containing shared database models, schemas, and utilities extracted from individual database modules |
| linode/helper/database.go | Removed (functionality moved to databaseshared package) |
| linode/framework_provider_config.go | Adds support for applying HTTP client modifiers during client initialization |
| linode/databases/*.go | Updates to use shared database models from databaseshared package |
| linode/database*/*.go | Refactored to use shared functionality from databaseshared package instead of duplicated code |
| linode/acceptance/*.go | Adds test infrastructure for HTTP response overrides and database-specific test helpers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf00427 to
dbd49c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
…hema & model sharing
35faf37 to
fb585e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ezilber-akamai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much cleaner! Tests passed locally
📝 Description
This pull request resolves an issue that prevents the
pending_updatesfield from being properly populated. This is an extension of the fix from #2162.Additionally, this pull request consolidates shared database schema and model logic into a
database_sharedhelper package, which significantly reduces code redundancy.Depends on #2165
✔️ How to Test
The following test steps assume you have pulled down this PR locally.
Integration Testing
Manual Testing
TODO