Skip to content
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

🐛 BUG: Legacy Env name computed on publish #672

Closed
JacobMGEvans opened this issue Mar 22, 2022 · 5 comments · Fixed by #680 or #679
Closed

🐛 BUG: Legacy Env name computed on publish #672

JacobMGEvans opened this issue Mar 22, 2022 · 5 comments · Fixed by #680 or #679
Assignees

Comments

@JacobMGEvans
Copy link
Contributor

What version of Wrangler are you using?

0.0.22

What operating system are you using?

Mac

Describe the Bug

Legacy environment mode should not compute name fields in environments.
result: name = my-worker-staging => publishes as my-worker-staging-staging

@JacobMGEvans JacobMGEvans self-assigned this Mar 22, 2022
@threepointone
Copy link
Contributor

Not sure I understand exactly. Could you show what wrangler.toml looks like, and what command you run?

@JacobMGEvans
Copy link
Contributor Author

JacobMGEvans commented Mar 22, 2022

Not sure I understand exactly. Could you show what wrangler.toml looks like, and what command you run?

command: Publish
TOML:

name = "my-worker"
[[ env.staging ]]
name = "my-worker-staging"

The published Worker for staging will be called my-worker-staging-staging to parity Wrangler1 in legacy environment mode it should not compute the name fields in environments

@threepointone
Copy link
Contributor

Ah ok I see. Yeah, if an environment has an explicit name, then we shouldn't add an environment identifier to it.

@petebacondarwin
Copy link
Contributor

Capturing from offline discussion:

There is a weird case if the user provides the --name command line argument along with --env when dealing with legacy environments.

It is not 100% clear what should be the correct behaviour. Note that Wrangler 1 does not support the --name option.

We have decided, initially, to disallow this combination - --name + --env + legacy_env - for publishing. Providing a suitable error message that describes how to set the name in the environment section of the wrangler.toml if they wish to specify a name for a particular environment.

@threepointone
Copy link
Contributor

We have decided, initially, to disallow this combination - --name + --env + legacy_env - for publishing.

+1. I assume this would be an extremely rare combo anyway.

JacobMGEvans added a commit that referenced this issue Mar 23, 2022
…related CLI flags

1. When in Legacy environment mode we should not compute name field if specified in an environment.
2. Throw an Error when `--env` and `--name` are used together in Legacy Environment, except for Secrets & Tail which are using a special case `getLegacyScriptName` for parity with Wrangler1
3. Started the refactor for args being utilized at the Config level, currently checking for Legacy Environment only.

Fixes #672
JacobMGEvans added a commit that referenced this issue Mar 23, 2022
…related CLI flags

1. When in Legacy environment mode we should not compute name field if specified in an environment.
2. Throw an Error when `--env` and `--name` are used together in Legacy Environment, except for Secrets & Tail which are using a special case `getLegacyScriptName` for parity with Wrangler1
3. Started the refactor for args being utilized at the Config level, currently checking for Legacy Environment only.

Fixes #672
JacobMGEvans added a commit that referenced this issue Mar 23, 2022
…related CLI flags

1. When in Legacy environment mode we should not compute name field if specified in an environment.
2. Throw an Error when `--env` and `--name` are used together in Legacy Environment, except for Secrets & Tail which are using a special case `getLegacyScriptName` for parity with Wrangler1
3. Started the refactor for args being utilized at the Config level, currently checking for Legacy Environment only.

Fixes #672
petebacondarwin pushed a commit that referenced this issue Mar 23, 2022
…related CLI flags (#680)

1. When in Legacy environment mode we should not compute name field if specified in an environment.
2. Throw an Error when `--env` and `--name` are used together in Legacy Environment, except for Secrets & Tail which are using a special case `getLegacyScriptName` for parity with Wrangler1
3. Started the refactor for args being utilized at the Config level, currently checking for Legacy Environment only.

Fixes #672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants