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

CLI triggers own deprecation warning #4896

Open
sambostock opened this issue Nov 20, 2024 · 3 comments
Open

CLI triggers own deprecation warning #4896

sambostock opened this issue Nov 20, 2024 · 3 comments
Labels
Type: Bug Something isn't working

Comments

@sambostock
Copy link

sambostock commented Nov 20, 2024

Problem

We are triggering our own deprecation warning.

  • --api-key has been renamed to --client-id
  • If --api-key is not provided, we check for $SHOPIFY_API_KEY, and set it as --api-key
  • If --api-key is set, we emit a deprecation warning

if (!flags['api-key']) {
if (process.env.SHOPIFY_API_KEY) {
flags['api-key'] = process.env.SHOPIFY_API_KEY
}
}
if (flags['api-key']) {
await showApiKeyDeprecationWarning()
}

Solution

  • 🅰 : We continue to support $SHOPIFY_API_KEY, but stop logging a deprecation warning when we get the key from there rather than --api-key directly.
  • 🅱 : We also deprecate $SHOPIFY_API_KEY in favour of $SHOPIFY_CLIENT_ID and clarify deprecation warning.

Tip

The flags config implies it will automatically check $SHOPIFY_FLAG_APP_API_KEY/$SHOPIFY_FLAG_CLIENT_ID environment variables, if --api-key/--client-id are omitted. Maybe we should use those? Although for some reason, we have both those flags as hidden.

@sambostock sambostock added the Type: Bug Something isn't working label Nov 21, 2024
@isaacroldan
Copy link
Contributor

Hi @sambostock! We want to show the warning for any usage of api-key or the equivalent env vars: SHOPIFY_API_KEY, SHOPIFY_FLAG_API_KEY and SHOPIFY_FLAG_APP_API_KEY

Specifically, SHOPIFY_API_KEY is only used for dev and deploy commands.

The only valid client-id flag for any app command is SHOPIFY_FLAG_CLIENT_ID. (this one is not hidden)

@sambostock
Copy link
Author

@isaacroldan consolidating on the single flag (or corresponding environment variable) makes sense, but the deprecation warning is confusing as it specifically mentions the flags when the user might not be using them. Should we clarify that?

@isaacroldan
Copy link
Contributor

Definitely, that makes sense. Do you want to open a PR to fix this? We always welcome contributions from other teams! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants