-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add serverless bucket creation support #86
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
==========================================
- Coverage 83.34% 78.16% -5.19%
==========================================
Files 12 13 +1
Lines 1009 1044 +35
==========================================
- Hits 841 816 -25
- Misses 138 199 +61
+ Partials 30 29 -1 ☔ View full report in Codecov by Sentry. |
cfe10ac to
3b837bd
Compare
@bednar - I would prefer to see some sort of namespacing or separation in this API between the different products as the APIs are different. It could be really confusing for users if they have to figure out which function belongs to which product. Thoughts? |
|
@powersj, You’re absolutely right. We need to consider how to incorporate this into our source base to be sure that it’s clear to users which product they are interacting with. |
|
@xorphitus, please feel free to create suggestions for namespacing. We welcome your input! |
|
@xorphitus |
|
@xorphitus, what are your thoughts on using a separate |
Sounds clean, but I think As for function names, I propose the following; // management_serverless.go
type ServerelessClient struct {
client *Client
}
func NewServerlessClient(client *Client) *ServerelessClient {
return &ServerelessClient{client: client}
}
func (c *ServerelessClient) CreateBucket(ctx context.Context, bucket *Bucket) error {
// Delegates some operations to `c.Client`
}
// Caller code
client, err := influxdb3.New(...)
serverlessManager := NewServerlessClient(client)
serverlessManager.CreateBucket(...)
serverlessManager.UpdateBucket(...)
serverlessManager.ListBucket(...)I considered it might be overkill, and prefixing that you suggested might be sufficient, but administration tasks have very different characters from data read/write operations, so it would be okay to make it a separated client struct. The drawback is that users may have to have at most three clients, |
|
Your proposal looks great 👍. Let’s proceed as you suggested. |
3b837bd to
99e3f6a
Compare
99e3f6a to
be381aa
Compare
|
@powersj @bednar I'm looking into why the codecov report shows a reduction in coverage (-5.19%) for @xorphitus. It looks like the code that is indicated as no longer being covered should be handled by Can you fill use in on what are we missing to be able to verify that these lines are in still covered? Or can you see any reason why those lines are no longer covered based on the content of the PR? |
|
Hi @xorphitus, The end-to-end tests do not run for pull requests from third-party repositories to prevent exposing sensitive credentials. This limitation will be addressed once InfluxDB 3 OSS is released. I will begin reviewing your contribution as soon as possible. Best regards |
|
@jamesbalcombe83, please see the comment above for more details: #86 (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.
@xorphitus, thank you for your PR 👍. The API looks great so far. Please add a new example file for your API, similar to this existing example. This will assist users in understanding how to utilize your new API effectively. For detailed information on godoc, refer to this PR.
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.
Thank again for your PR 👍
LGTM 🚀
Proposed Changes
Support bucket creation for InfluxDB Serverless.
NOTE: The API is incompatible with Cloud Dedicated database creation API. Therefore, probably Cloud Dedicated database creation should be implemented as another function, e.g.,
CreateDatabase.Checklist