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

Introduce Env Variable Retention strategies (toggle between shell- and docs-mode) #761

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

sourishkrout
Copy link
Member

@sourishkrout sourishkrout commented Mar 12, 2025

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 VarRetentionStrategy with values VarRetentionStrategyFirst and VarRetentionStrategyLast. If VarRetentionStrategyUnspecified it defaults to VarRetentionStrategyFirst which is up for reconsideration in a future major release.

Related to #731.
Related to #653 (comment).

Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
@sourishkrout sourishkrout linked an issue Mar 12, 2025 that may be closed by this pull request
@sourishkrout sourishkrout marked this pull request as draft March 12, 2025 00:11
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
@sourishkrout sourishkrout marked this pull request as ready for review March 12, 2025 17:48
@sourishkrout sourishkrout changed the title Introduce Env Variable Retention strategies to allow overwriting of variables "shell-style" Introduce Env Variable Retention strategies (toggle between shell- and docs-mode) Mar 12, 2025
Signed-off-by: Sebastian (Tiedtke) Huckleberry <sebastiantiedtke@gmail.com>
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.

Can environment variables be reset within a session?
1 participant