-
Notifications
You must be signed in to change notification settings - Fork 803
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
fix: read isLegacyEnv
correctly
#807
Conversation
🦋 Changeset detectedLatest commit: c277a07 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2173999288/npm-package-wrangler-807 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/807/npm-package-wrangler-807 Or you can use npx https://prerelease-registry.developers.workers.dev/runs/2173999288/npm-package-wrangler-807 dev path/to/script.js |
0b55a78
to
41b8b47
Compare
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.
approving pending an answer on why the change u mentioned was made. makes sense otherwise
yeah I'll let @JacobMGEvans have a look before I merge, thank you! |
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.
Can you double check that this is actually broken?
41b8b47
to
c345297
Compare
args["legacy-env"]
correctlyisLgeacyEnv
correctly
isLgeacyEnv
correctlyisLegacyEnv
correctly
0b83e2c
to
b160168
Compare
This function is checking for validation of configuration const isLegacyEnv =
(args as { "legacy-env": boolean | undefined })["legacy-env"] ??
rawConfig.legacy_env ??
true; This function seems to be checking against only the config which I think I missed when moving args to be generically passed to the validation check for the function isLegacyEnv(args: unknown, config: Config): boolean {
return config.legacy_env;
} |
It doesn't check args though, which is confusing. It's just a local helper, let's have it take only what it needs. |
It is being resolved BY the validation and passed into CONFIG so the args is already resolved in the CLI parsing. (I wrote this refactor and forgot how it worked 😅 ) |
b160168
to
1a8c094
Compare
This fixes the signature for `isLegacyEnv()` since it doesn't use args, and we fix reading legacy_env correctly when creating a draft worker when creating a secret.
1a8c094
to
c277a07
Compare
Landing this since it's now a smaller fix, and Pete's on leave and I don't want to bother him more haha. |
The original idea was to drop the |
This fixes the signature for
isLegacyEnv()
since it doesn't use args, and we fix reading legacy_env correctly when creating a draft worker when creating a secret.