-
Notifications
You must be signed in to change notification settings - Fork 51
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
Cannot change existing environment variable #731
Comments
@mischajonker Is this the same issue as #653 ? That issue has a long discussion on environment variable behavior. |
Thank you @jlewi . Yes, it seems to be the same issue indeed. It looks like the proposed The current behavior with |
Please find the response/discussion here: #653 (comment) |
…d docs-mode) (#761) In a nutshell, this PR introduces different strategies to retain environment variables. This option will allow to make available a user setting that sets it's value according to the use case. The problem is that Runme's user base has different use cases that roughly break down into these two: ### 1. "Docs Mode" Existing runbooks/notebooks/markdown with placeholder values, e.g., export OPEN_API_KEY=[insert super secret key]. Once a value is set/confirmed by a user prompt, don't ask/evaluate again (unless overwritten promptEnv requires it in cell/document config). Essentially, the **first** value resolved for a variable is retained, and subsequent reassignments are ignored. ### 2. "Shell Mode" Take exported environment variables as is, aka "shell script" style. e.g. export MY_VAR=foo followed by export MY_VAR=bar, the last ran/evaluated value wins. When reassigned, subsequently the **last** value assigned is retained. ### Protobuf Changes This PR introduces `Retention` with values `RetentionFirstRun` and `RetentionLastRun`. If `RetentionUnspecified` it defaults to `RetentionFirstRun` which is up for reconsideration in a future major release. Related to #731. Related to #653 (comment). --------- Signed-off-by: Sebastian (Tiedtke) Huckleberry <[email protected]>
Once an environment variable already exists, we cannot override it anymore.
.env file:
Script executed in runme.dev:
Expected result:
Actual result:
A similar situation happens when sourcing another script that sets environment variables. These environment variables can also not be overridden.
The text was updated successfully, but these errors were encountered: