Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Generate compatibility_date in wrangler init and warn if it's missing #2070

Merged
merged 4 commits into from
Sep 15, 2021

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Sep 14, 2021

We'd like everyone to specify a compatibility_date in their wrangler.toml going forward. This change both adds the date automatically to newly-generated wrangler.toml files, and warns when parsing old ones that are missing it.

See also the documentation change: cloudflare/cloudflare-docs#2289

@kentonv kentonv requested a review from jyn514 September 14, 2021 18:54
@kentonv kentonv requested a review from a team as a code owner September 14, 2021 18:54
@WalshyDev
Copy link
Member

Ah great! I noticed this a few days ago and had it on my todo to report

I also notice the init does double quotes for the filled out values and single for the empty ones. Not sure if this is an issue, just an odd inconsistency

@kentonv kentonv force-pushed the kentonv/generate-compatibility-date branch from 123dc5c to 58fe605 Compare September 14, 2021 19:17
Copy link
Contributor

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, but @Electroid or @kabirsikand might want to take a look at the wording.

src/settings/toml/manifest.rs Outdated Show resolved Hide resolved
src/settings/toml/manifest.rs Show resolved Hide resolved
@jyn514
Copy link
Contributor

jyn514 commented Sep 14, 2021

I tested this locally - the warning looks like

⚠️  Your configuration file is missing compatibility_date, so a distant past date is assumed. To get the latest possibly-breaking bug fixes, add this line to your wrangler.toml:

    compatibility_date = "2021-09-14"

⚠️  For more information about compatibility dates, see: https://developers.cloudflare.com/workers/platform/compatibility-dates

and is shown whenever you run wrangler (I think being annoying is intentional).

Co-authored-by: Joshua Nelson <jnelson@cloudflare.com>
@Electroid
Copy link
Contributor

Wording is good with me. ✅

@Electroid Electroid self-requested a review September 14, 2021 23:49
@Electroid Electroid merged commit 3529b36 into master Sep 15, 2021
@delete-merged-branch delete-merged-branch bot deleted the kentonv/generate-compatibility-date branch September 15, 2021 00:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants