DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
214 stars 43 forks source link

'doppler flags disable' Command Not Disabling. [BUG] #452

Open Terry-BrooksJr opened 3 months ago

Terry-BrooksJr commented 3 months ago

Describe the bug I am using the doppler CLI provided via container.dev feature. Disabled the env-warning flag, and the output panel in VSCODE is still overrun with the message. I have enabled, autocompletion and hoover enrichment.

To Reproduce Steps to reproduce the behavior. Please include output from running the command with --debug.

  1. Open Terminal with Doppler CLI
  2. Execute doppler flags disable env-warning
  3. See confirmation of the updated settings that that setting has been updated
  4. Hoover over os.getenv or process.env code
  5. Observe the output panel still produces the warning message.

Expected behavior As a User Who Has explicitly disabled a flag's messaging, I should not see related messaging in the Output panel.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

CLI Version: Version 2.1.3 - Per Containers.dev

Additional context Personal opinion but I think the messaging needs to be more robust to include how to disable that flag, as well, or make it somehow above the fold when configuring or setting up the vs-code integration. Something like Using DOPPLER_CONFIG_DIR from the environment. To disable this warning, use \'doppler flag disable env-warning\'. To set configs from stdin. Use --no-read-env.

watsonian commented 3 months ago

@Terry-BrooksJr I'm able to reproduce this behavior with a configuration variable set in the shell that VSCode was launched from (e.g., DOPPLER_ENABLE_VERSION_CHECK=false code .) when the flag is enabled. When hovering over a secret, the terminal gets spammed like this:

CleanShot 2024-03-18 at 10 09 16

However, when I disable the flag, that stops occurring on my end.

The doppler flags command sets a global value in your ~/.doppler/.doppler.yaml file, which is where the CLI reads that from. Is it possible the context that you're launching VSCode from won't have the same file that this was saved in initially? It looks like you're using development containers – is that flag being set inside the container? Even if VSCode is executing from outside the container, the CLI is running inside the container. If you ran doppler flags disable env-warning outside the container, opened up the project, and were using devcontainers – then everything inside the terminal will be executing inside the container, not on your local machine. It's very possible this is what's happening for you.