-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add Cloudflare KV Storage #1298
Conversation
WalkthroughThe recent project updates focus on expanding the testing capabilities for Cloudflare KV storage. Test functions now cover essential operations like setting, getting, deleting, resetting, and closing. Moreover, benchmark tests have been integrated to gauge performance metrics effectively. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
kv/go.mod
is excluded by:!**/*.mod
kv/go.sum
is excluded by:!**/*.sum
Files selected for processing (8)
- .github/dependabot.yml (1 hunks)
- .github/release-drafter-kv.yml (1 hunks)
- .github/workflows/release-drafter-kv.yml (1 hunks)
- .github/workflows/test-kv.yml (1 hunks)
- kv/README.md (1 hunks)
- kv/config.go (1 hunks)
- kv/kv.go (1 hunks)
- kv/kv_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/release-drafter-kv.yml
Additional comments: 6
.github/workflows/release-drafter-kv.yml (1)
- 1-19: The workflow configuration for the Release Drafter KV looks correct and well-structured. It's specifically tailored to handle changes in the
kv/
directory, which aligns with the PR's objectives. Ensure that therelease-drafter-kv.yml
configuration file exists and is correctly set up to match this workflow's expectations..github/workflows/test-kv.yml (1)
- 1-29: The automated testing workflow for the KV storage feature is well-defined, covering the latest three Go versions. This ensures compatibility and reliability across different environments. It's a good practice to keep the Go versions updated to the latest stable releases to catch any potential issues early.
kv/config.go (1)
- 3-52: The
Config
struct and the default configuration for the Cloudflare KV storage are well-defined, covering essential parameters like authentication details and namespace identifiers. The helper functionconfigDefault
ensures that default values are used when no custom configuration is provided. Consider documenting the behavior of theReset
flag more clearly, explaining its impact on existing data.kv/README.md (2)
- 6-6: The use of badges in the README provides quick insights into the project's status. However, ensure that the links for the badges are correctly set up and pointing to the relevant workflows and metrics for the KV storage feature.
- 12-12: The description of the KV storage driver as "a kv storage driver" might be improved for clarity. Consider specifying that it's a "Cloudflare KV storage driver for Go applications" to provide immediate context to the reader.
.github/dependabot.yml (1)
- 59-64: The addition of a Dependabot configuration for the
gomod
package ecosystem in the/kv/
directory is a proactive step towards maintaining up-to-date dependencies. Setting the update interval to weekly strikes a good balance between staying current and minimizing disruption. Ensure that the/kv/
directory contains Go module files (go.mod
) for Dependabot to operate correctly.
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.
Review Status
Actionable comments generated: 4
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
cloudflarekv/go.mod
is excluded by:!**/*.mod
cloudflarekv/go.sum
is excluded by:!**/*.sum
Files selected for processing (8)
- .github/dependabot.yml (1 hunks)
- .github/release-drafter-cloudflarekv.yml (1 hunks)
- .github/workflows/release-drafter-cloudflarekv.yml (1 hunks)
- .github/workflows/test-cloudflarekv.yml (1 hunks)
- cloudflarekv/README.md (1 hunks)
- cloudflarekv/cloudflarekv.go (1 hunks)
- cloudflarekv/cloudflarekv_test.go (1 hunks)
- cloudflarekv/config.go (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/release-drafter-cloudflarekv.yml
Files skipped from review as they are similar to previous changes (1)
- .github/dependabot.yml
Additional comments: 2
.github/workflows/test-cloudflarekv.yml (1)
- 1-29: This workflow configuration for testing Cloudflare KV is well-structured and follows best practices, including testing across multiple Go versions. Good job!
cloudflarekv/cloudflarekv_test.go (1)
- 16-17: Consider handling the
.env
file loading failure more gracefully. Instead of immediately terminating the test execution withlog.Fatal
, you could skip the tests that require environment variables witht.Skip("Environment variables not set. Skipping tests.")
. This approach allows other tests to run even if the.env
file is missing or environment variables are not set.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@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.
Actionable comments posted: 1
@gaby Thanks for your reviews. I checked and made tests with local initialization of storages. |
I've got an issue with dev cloudflare worker server...it returns success often with GET http call because of caching. So testing fails sometimes. I'll fix it and call you guys :) It might occur because of If anyone has an idea with it. Please let me know! |
I made test clear. GET works well. |
Hello. If there's anything else I need to proceed with, please let me know. |
Ping @gofiber/maintainers |
Hello guys. This PR is for the new Storage implementation of Cloudflare KV.
Thanks for the reviews.
Summary by CodeRabbit
cloudflarekv/
directory.