-
Notifications
You must be signed in to change notification settings - Fork 123
feat(cdn): add KV_BASE_URL for CDN worker + add compatibility layer #7202
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
feat(cdn): add KV_BASE_URL for CDN worker + add compatibility layer #7202
Conversation
Summary of ChangesHello @noghartt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the CDN worker and server configurations by introducing a new Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a KV_BASE_URL environment variable for the CDN worker to allow custom KV storage endpoints, which is particularly useful for self-hosted setups. The changes span across the CDN worker and the server packages, adding the necessary configuration, type definitions, and logic to use the new variable while maintaining backward compatibility with a default URL.
My review has identified a critical syntax error that needs to be fixed, along with some medium-severity issues related to documentation accuracy, code maintainability (magic strings), and typos in comments. Overall, the changes are well-structured and address the intended feature.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
As a general question: what are the implications if you deploy this to your own cloudflare, with |
From the tests I did in my self-hosted solution, it didn't work. So what I did was changing it in a similar way I did on this PR (without the conditional). But not sure if you guys are using this URL for the caching yet or there's something new, I left it as the fallback, just in case to avoid any breaking change (even because there's a usage of it on the |
Did you receive errors or did the caching just not work? |
The caching just didn't work, from what I tested. Since I deployed my own CF Worker + KV Namespace, it worked fine. |
|
@noghartt Can you also add a changeset using Also there are some formatting issues: https://github.com/graphql-hive/console/actions/runs/19064830441/job/54452786353 |
Hey @n1ru4l, pushed both commits with the lint fixes + the changeset. Can you just doublecheck the changeset, not sure if is all good on that. BTW, do you think that a |
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.
See #7202 (comment)
|
@noghartt having a |
Pushed a commit rollback the changes! |
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.
Looking good!
Background
Fix #7036
Closes #7213
This PR adds a new env for
KV_BASE_URLwhich will let both CF CDN worker + API custom providers work on self-hosted setup for CDN.Also, it adds a guarantee that it won't create any breaking change considering the old value.
Description
We changed these services:
package/services/cdn-worker: add a new envKV_BASE_URL+ expose a new field on functioncreateIsKeyValidto let the user pass any string value to be used by artifact handler.packages/services/serverto, when using API provider for CDN, it let the user insert any KV, for compatibility with their setup (if on self-hosted).Checklist