Skip to content

chore(cli): use option source name for deprecation warnings #15581

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

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Nov 19, 2024

Closes #15568.

This improves the deprecation warnings, so that they use the config name for however they were supplied for both the deprecated option, and the recommended options.

(I'm assuming it's relatively obvious for users this is an env variable)

$ set -x CODER_ADDRESS 127.0.0.1:3003
$ coder server
WARN: `CODER_ADDRESS` is deprecated, please use `CODER_HTTP_ADDRESS` and `CODER_TLS_ADDRESS` instead.
$ coder server --address 127.0.0.1:3003
WARN: `--address` is deprecated, please use `--http-address` and `--tls-address` instead.

YAML names are fully qualified, to make it clear they're set via YAML

$ coder server --config config.yaml
WARN: `introspection.logging.verbose` is deprecated, please use `introspection.logging.filter` instead.

This PR also applies the middleware to all commands.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson marked this pull request as ready for review November 19, 2024 03:17
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up @ethanndickson!

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Great work!

@ethanndickson ethanndickson force-pushed the ethan/cli-deprecation-warnings branch from 74836c8 to 3f74426 Compare November 19, 2024 10:04
@ethanndickson ethanndickson enabled auto-merge (squash) November 19, 2024 10:05
@ethanndickson ethanndickson merged commit 1c08580 into main Nov 19, 2024
27 checks passed
@ethanndickson ethanndickson deleted the ethan/cli-deprecation-warnings branch November 19, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhelpful warning is displayed when using deprecated configs
2 participants