Remove deprecated eval_env references#292
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves all remaining support and documentation for the deprecated Sequence diagram for dynamic env evaluation using env.shsequenceDiagram
actor User
participant LetsCLI
participant ConfigLoader
participant EnvExecutor
participant Shell
User->>LetsCLI: run command
LetsCLI->>ConfigLoader: parse lets.yaml
ConfigLoader-->>LetsCLI: Config with Env entries (some with Sh)
LetsCLI->>EnvExecutor: resolve Env for command
EnvExecutor->>EnvExecutor: detect Env entries with Sh
EnvExecutor->>Shell: executeScript(shell, script)
Shell-->>EnvExecutor: stdout
EnvExecutor-->>LetsCLI: resolved environment map
LetsCLI->>LetsCLI: run command with resolved env
EnvExecutor-->>LetsCLI: error fmt("can not get output from env.sh script: %s", err)
Updated class diagram for config and command models without eval_envclassDiagram
class ConfigBefore {
+map~string, CommandBefore~ Commands
+string Version
+string Shell
+Envs Env
+Envs EvalEnv
+string Before
+string Init
+UnmarshalYAML(unmarshal func_interface_error_) error
}
class ConfigAfter {
+map~string, CommandAfter~ Commands
+string Version
+string Shell
+Envs Env
+string Before
+string Init
+UnmarshalYAML(unmarshal func_interface_error_) error
}
class CommandBefore {
+string Name
+string Description
+string Shell
+Envs Env
+Envs EvalEnv
+string Options
+Deps Depends
+string WorkDir
+string After
+Checksum Checksum
+bool PersistChecksum
+string Ref
+Args Args
+UnmarshalYAML(unmarshal func_interface_error_) error
}
class CommandAfter {
+string Name
+string Description
+string Shell
+Envs Env
+string Options
+Deps Depends
+string WorkDir
+string After
+Checksum Checksum
+bool PersistChecksum
+string Ref
+Args Args
+UnmarshalYAML(unmarshal func_interface_error_) error
}
class Envs {
+bool Empty() bool
+Range(fn func_string_Env_error_) error
+Set(name string, value Env) void
}
class Env {
+string Name
+string Value
+string Sh
}
ConfigBefore "1" --> "*" CommandBefore : commands
ConfigAfter "1" --> "*" CommandAfter : commands
CommandBefore "1" --> "1" Envs : env
CommandAfter "1" --> "1" Envs : env
ConfigBefore "1" --> "1" Envs : eval_env
CommandBefore "1" --> "1" Envs : eval_env
%% Highlighting the removal conceptually
classDef removed fill:#ffe6e6,stroke:#cc0000,stroke-width:1px;
class ConfigBefore removed
class CommandBefore removed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Greptile SummaryThis PR completes the removal of the long-deprecated Key changes:
Notable inconsistency: Global Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Parse lets.yaml] --> B{Top-level keyword check}
B -- "eval_env found" --> C["Error: keyword 'eval_env' not supported"]
B -- "known keyword" --> D[Unmarshal Config struct]
D --> E[Unmarshal Commands]
E --> F{Command has eval_env?}
F -- "yes (yaml.v3 silent ignore)" --> G["eval_env silently dropped\nNo error raised"]
F -- "no" --> H[Unmarshal env with sh / value / checksum]
H --> I[Execute sh scripts & checksums]
I --> J[Run command with resolved env]
G --> J
|
Summary
eval_envis gone and show how to useenvwithshTesting
Summary by Sourcery
Remove support for the deprecated
eval_envdirective and update configuration handling, documentation, and examples to rely solely onenvwithshexecution mode for dynamic environment variables.Enhancements:
eval_envas a recognized config keyword and simplify command/config unmarshalling by removing legacyeval_envhandling and logging.env.shrather thaneval_env.envwithshinstead ofeval_env.Documentation:
eval_envfrom the config reference and advanced usage docs, replacing it with guidance and examples for usingenvwithshfor dynamic environment values.eval_envdirective and the recommended replacement.Tests:
eval_envnow fails with an appropriate error, and remove legacy per-command eval_env test cases.Chores:
eval_envsupport.