-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[wrangler] Add enabled and previews_enabled options for custom domains #13222
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
Open
maxwellpeterson
wants to merge
3
commits into
cloudflare:main
Choose a base branch
from
maxwellpeterson:mpeterson/custom-domain-preview-production-settings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
b44d762
[wrangler] Add production_enabled and previews_enabled support for cu…
maxwellpeterson 5abac79
fix: reject routes with both zone_id and zone_name in validation
maxwellpeterson 55ea49b
rename production_enabled to enabled across config and API types
maxwellpeterson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@cloudflare/workers-utils": minor | ||
| "wrangler": minor | ||
| --- | ||
|
|
||
| Add production_enabled and previews_enabled support for custom domain routes | ||
|
|
||
| Custom domain routes can now include optional production_enabled and previews_enabled boolean fields to control whether a domain serves production and/or preview traffic. When omitted, the API defaults apply (production enabled, previews disabled). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is putting this in the custom domain route type set in stone? Long term I think something like the following would be clearer and would get away from locking us in to these config shapes just because we've previously had them:
In the meantime, what about:
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.
Previews are only supported for custom domains. I don't really see us adding them to regular routes in the future, since routes can already contain wildcards and there isn't a clear domain hierarchy to differentiate previews.
It's a little confusing to me to have separate "types" for
custom_domainandpreviews, when they are actually the exact same thing at the API level. @1000hz has proposed a simplified domains API that would lend itself to this config shape:{ "domains": ["app.example.com", "my-app.cloudflare.app"], "preview_domains": ["previews.example.com", "my-app.cloudflare.app"] {which feels a lot simpler since users don't need to be aware of the different underlying route types. Regardless, do we want to make this config shape change now?
As-is adopting previews for existing users is as simple as adding
"previews_enabled": trueto their domain config. The wildcard syntax would be a Wrangler-only construct and isn't something users would be familiar with from any other touchpoint (dash, API, Terraform, etc.). The only place you would see it is in the actual DNS record that is created, which we're trying to abstract over here.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.
@penalosa I definitely think we should change the domains config when we release the new config shape, but could we wait until then?
And yes I think just an array of domains like what @1000hz suggests is ideal