-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore: thread venv throughout CLI #6089
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import ( | |
|
|
||
| "github.com/gruntwork-io/terragrunt/internal/cli/commands/catalog/tui/components/buttonbar" | ||
| "github.com/gruntwork-io/terragrunt/internal/cli/commands/scaffold" | ||
| "github.com/gruntwork-io/terragrunt/internal/venv" | ||
| "github.com/gruntwork-io/terragrunt/internal/vfs" | ||
| "github.com/gruntwork-io/terragrunt/pkg/config" | ||
| "github.com/gruntwork-io/terragrunt/pkg/log" | ||
|
|
@@ -611,7 +612,7 @@ func discoverFormCmd(ctx context.Context, l log.Logger, opts *options.Terragrunt | |
| func discoverModuleFields(ctx context.Context, l log.Logger, opts *options.TerragruntOptions, c *Component) tea.Msg { | ||
| quiet := l.WithOptions(log.WithOutput(io.Discard)) | ||
|
|
||
| plan, err := scaffold.Prepare(ctx, quiet, opts, c.TerraformSourcePath(), "") | ||
| plan, err := scaffold.Prepare(ctx, quiet, venv.OSVenv(), opts, c.TerraformSourcePath(), "") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 615 still prepares modules in the real OS environment.
Suggested direction-func discoverFormCmd(ctx context.Context, l log.Logger, opts *options.TerragruntOptions, c *Component) tea.Cmd {
+func discoverFormCmd(ctx context.Context, l log.Logger, v venv.Venv, opts *options.TerragruntOptions, c *Component) tea.Cmd {
return func() tea.Msg {
if c.Kind.IsCopyable() {
return discoverValuesFields(c)
}
- return discoverModuleFields(ctx, l, opts, c)
+ return discoverModuleFields(ctx, l, v, opts, c)
}
}
@@
-func discoverModuleFields(ctx context.Context, l log.Logger, opts *options.TerragruntOptions, c *Component) tea.Msg {
+func discoverModuleFields(ctx context.Context, l log.Logger, v venv.Venv, opts *options.TerragruntOptions, c *Component) tea.Msg {
quiet := l.WithOptions(log.WithOutput(io.Discard))
- plan, err := scaffold.Prepare(ctx, quiet, venv.OSVenv(), opts, c.TerraformSourcePath(), "")
+ plan, err := scaffold.Prepare(ctx, quiet, v, opts, c.TerraformSourcePath(), "")Then pass the same handle from the TUI model/entrypoint into 🤖 Prompt for AI Agents |
||
| if err != nil { | ||
| return formDiscoveryErrMsg{err: err} | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 54 still bypasses the caller's virtualized environment.
Using
venv.OSVenv()here means the non-interactive catalog scaffold path still executes against the real OS-backed FS/exec instead of the rootvenvthis PR is threading through the CLI. That leaves this leaf outside the new side-effect boundary.Suggested direction
type scaffoldCmd struct { component *Component opts *options.TerragruntOptions logger log.Logger + v venv.Venv plan *scaffold.Plan values map[string]string } -func newScaffoldCmd(l log.Logger, opts *options.TerragruntOptions, c *Component) *scaffoldCmd { - return &scaffoldCmd{component: c, opts: opts, logger: l} +func newScaffoldCmd(l log.Logger, v venv.Venv, opts *options.TerragruntOptions, c *Component) *scaffoldCmd { + return &scaffoldCmd{component: c, opts: opts, logger: l, v: v} } @@ - return scaffold.Run(context.Background(), c.logger, venv.OSVenv(), c.opts, c.component.TerraformSourcePath(), "") + return scaffold.Run(context.Background(), c.logger, c.v, c.opts, c.component.TerraformSourcePath(), "")🧰 Tools
🪛 GitHub Check: SonarCloud Code Analysis
[warning] 52-52: Complete the task associated to this TODO comment.
See more on https://sonarcloud.io/project/issues?id=gruntwork-io_terragrunt&issues=AZ4hcumwLKV5nElQS5JU&open=AZ4hcumwLKV5nElQS5JU&pullRequest=6089
🤖 Prompt for AI Agents