-
Notifications
You must be signed in to change notification settings - Fork 99
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
Simplify database interface #8126
Simplify database interface #8126
Conversation
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8126 +/- ##
==========================================
- Coverage 59.66% 59.46% -0.20%
==========================================
Files 577 577
Lines 38573 38644 +71
==========================================
- Hits 23013 22981 -32
- Misses 13914 13996 +82
- Partials 1646 1667 +21 ☔ View full report in Codecov by Sentry. |
will there be separate PR for name updates proposed here: https://gist.github.com/rynowak/0e625521404326eb194adc98155a736b |
Functional test failure is due to applications rp crashing at startup. I'll dig into it. |
a72530b
to
afc96c6
Compare
afc96c6
to
e23467b
Compare
This change simplifes our database provider interface by removing the 'name' parameter. Prior to this change, each database client was used to store and retrieve a single resource type's data. Every piece of code had to be aware of the resource type associated with the client, and make sure to get a different client for each resource type it interacted with. This was complicated further by the fact that not all of our database providers implemented this restriction. --- After removing this restriction, our code can be simplified all over the place. A lot of code that used to need the `dataprovider.DataStoreProvider` now just needs the `store.StorageClient`. This change pushes the simplification as far as possible. I also added validation to places where we initialize controllers, because it was too easy to initialize a controller with missing data. Signed-off-by: Ryan Nowak <[email protected]>
e23467b
to
3d1f9f6
Compare
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
return &DataStorageProvider{result: result{client: client}} | ||
} | ||
|
||
// GetStorageClient returns a storage client for the given resource type. |
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.
Comment needs update since resource type is not an input for client generated
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.
👍
Description
This change simplifes our database provider interface by removing the 'name' parameter.
Prior to this change, each database client was used to store and retrieve a single resource type's data. Every piece of code had to be aware of the resource type associated with the client, and make sure to get a different client for each resource type it interacted with.
This was complicated further by the fact that not all of our database providers implemented this restriction.
After removing this restriction, our code can be simplified all over the place. A lot of code that used to need the
dataprovider.DataStoreProvider
now just needs thestore.StorageClient
.This change pushes the simplification as far as possible. I also added validation to places where we initialize controllers, because it was too easy to initialize a controller with missing data.
Type of change
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: