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

The only commands that should ignore async runtimes are refresh, deploy, and activate. #3505

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion internal/locale/locales/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,9 @@ err_packages_update_runtime_init:
other: Could not initialize runtime.
pkg_already_uptodate:
other: Dependencies for your project are already configured and installed.
notice_async_runtime:
other: |
[WARNING]Warning:[/RESET] Skipping runtime sourcing since {{.V0}} is enabled. Please run '[ACTIONABLE]state refresh[/RESET]' to manually source the runtime.
install_runtime:
other: Sourcing Runtime
install_runtime_info:
Expand Down Expand Up @@ -1541,7 +1544,7 @@ err_uninstall_platform_nomatch:
err_uninstall_platform_multimatch:
other: |
The platform query you provided matches multiple platforms in your project.
Please specify the platform to uninstall by using its version and bit-width.
Please specify the platform to uninstall by using its version and bit-width.
To view the platforms your project uses run: [ACTIONABLE]state platforms[/RESET].
progress_requirements:
other: "• Updating requirements"
Expand Down
3 changes: 3 additions & 0 deletions internal/runbits/reqop_runbit/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ func UpdateAndReload(prime primeable, script *buildscript.BuildScript, oldCommit
}
return errs.Wrap(err, "Failed to refresh runtime")
}
} else {
prime.Output().Notice("") // blank line
prime.Output().Notice(locale.Tr("notice_async_runtime", constants.AsyncRuntimeConfig))
}

// Update commit ID
Expand Down
2 changes: 2 additions & 0 deletions internal/runbits/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ func Update(
// any errors regarding solves, buildscripts, etc.
if prime.Config().GetBool(constants.AsyncRuntimeConfig) && !opts.IgnoreAsync {
logging.Debug("Skipping runtime update due to async runtime")
prime.Output().Notice("") // blank line
prime.Output().Notice(locale.Tr("notice_async_runtime", constants.AsyncRuntimeConfig))
return rt, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/runners/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (s *Exec) Run(params *Params, args ...string) (rerr error) {

s.out.Notice(locale.Tr("operating_message", projectNamespace, projectDir))

rt, err := runtime_runbit.Update(s.prime, trigger, runtime_runbit.WithoutHeaders(), runtime_runbit.WithIgnoreAsync())
rt, err := runtime_runbit.Update(s.prime, trigger, runtime_runbit.WithoutHeaders())
if err != nil {
return errs.Wrap(err, "Could not initialize runtime")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/runners/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (u *Shell) Run(params *Params) error {
return locale.NewInputError("err_shell_commit_id_mismatch")
}

rti, err := runtime_runbit.Update(u.prime, trigger.TriggerShell, runtime_runbit.WithoutHeaders(), runtime_runbit.WithIgnoreAsync())
rti, err := runtime_runbit.Update(u.prime, trigger.TriggerShell, runtime_runbit.WithoutHeaders())
if err != nil {
return locale.WrapExternalError(err, "err_shell_runtime_new", "Could not start a shell/prompt for this project.")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/runners/use/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (u *Use) Run(params *Params) error {
return locale.NewInputError("err_use_commit_id_mismatch")
}

rti, err := runtime_runbit.Update(u.prime, trigger.TriggerUse, runtime_runbit.WithoutHeaders(), runtime_runbit.WithIgnoreAsync())
rti, err := runtime_runbit.Update(u.prime, trigger.TriggerUse, runtime_runbit.WithoutHeaders())
if err != nil {
return locale.WrapError(err, "err_use_runtime_new", "Cannot use this project.")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/scriptrun/scriptrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *ScriptRun) NeedsActivation() bool {

// PrepareVirtualEnv sets up the relevant runtime and prepares the environment.
func (s *ScriptRun) PrepareVirtualEnv() (rerr error) {
rt, err := runtime_runbit.Update(s.prime, trigger.TriggerScript, runtime_runbit.WithoutHeaders(), runtime_runbit.WithIgnoreAsync())
rt, err := runtime_runbit.Update(s.prime, trigger.TriggerScript, runtime_runbit.WithoutHeaders())
if err != nil {
return locale.WrapError(err, "err_activate_runtime", "Could not initialize a runtime for this project.")
}
Expand Down
Loading