From fac15bca97c51f65cd7d0f1de8398034e1d45f64 Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Thu, 30 Oct 2025 11:23:52 +0000 Subject: [PATCH 1/4] fix: improve confusing update messaging --- cmd/root.go | 7 +++++++ internal/model/command.go | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 7954b81c4..b8b28b9bc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -161,6 +161,13 @@ func checkForUpdate(ctx context.Context, currentVersion, artifactArch string, cm return } + wf, _, err := utils.GetWorkflow() + + // If a workflow file is present and specifies that the speakeasyVersion is "latest", don't display update notifications as it will be automatically updated when the command is run. + if wf != nil && wf.SpeakeasyVersion.String() == "latest" { + return + } + newerVersion, err := updates.GetNewerVersion(ctx, artifactArch, currentVersion) if err != nil { return // Don't display error to user diff --git a/internal/model/command.go b/internal/model/command.go index fc41cb2a8..33165a721 100644 --- a/internal/model/command.go +++ b/internal/model/command.go @@ -312,7 +312,13 @@ func runWithVersionFromWorkflowFile(cmd *cobra.Command) error { } desiredVersion = latest.String() - logger.PrintfStyled(styles.DimmedItalic, "Running with latest Speakeasy version\n") + // Check if we're actually running the latest version + currentVersion := events.GetSpeakeasyVersionFromContext(ctx) + if newerVersion, err := updates.GetNewerVersion(ctx, artifactArch, currentVersion); err == nil && newerVersion == nil { + logger.PrintfStyled(styles.DimmedItalic, "Running with latest Speakeasy version\n") + } else { + logger.PrintfStyled(styles.DimmedItalic, "Downloading Speakeasy version %s\n", desiredVersion) + } } else if desiredVersion == "pinned" { return ErrPinned } else { From afb17c63f183776c5da4ea737327deccf56b79ab Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Thu, 30 Oct 2025 11:27:58 +0000 Subject: [PATCH 2/4] fix: remove dupe message --- internal/model/command.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/model/command.go b/internal/model/command.go index 33165a721..a932f00d9 100644 --- a/internal/model/command.go +++ b/internal/model/command.go @@ -316,8 +316,6 @@ func runWithVersionFromWorkflowFile(cmd *cobra.Command) error { currentVersion := events.GetSpeakeasyVersionFromContext(ctx) if newerVersion, err := updates.GetNewerVersion(ctx, artifactArch, currentVersion); err == nil && newerVersion == nil { logger.PrintfStyled(styles.DimmedItalic, "Running with latest Speakeasy version\n") - } else { - logger.PrintfStyled(styles.DimmedItalic, "Downloading Speakeasy version %s\n", desiredVersion) } } else if desiredVersion == "pinned" { return ErrPinned From bbf52d56d6c7c6291a2759c28c190efd44ac497c Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Thu, 30 Oct 2025 11:33:36 +0000 Subject: [PATCH 3/4] fix: do not use err --- cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index b8b28b9bc..713083fca 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -161,7 +161,7 @@ func checkForUpdate(ctx context.Context, currentVersion, artifactArch string, cm return } - wf, _, err := utils.GetWorkflow() + wf, _, _ := utils.GetWorkflow() // If a workflow file is present and specifies that the speakeasyVersion is "latest", don't display update notifications as it will be automatically updated when the command is run. if wf != nil && wf.SpeakeasyVersion.String() == "latest" { From b0808a0c19c2447725937089aed867d9519b1ded Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Thu, 30 Oct 2025 15:42:12 +0000 Subject: [PATCH 4/4] fix: scoping --- cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 713083fca..08272ab05 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -163,8 +163,8 @@ func checkForUpdate(ctx context.Context, currentVersion, artifactArch string, cm wf, _, _ := utils.GetWorkflow() - // If a workflow file is present and specifies that the speakeasyVersion is "latest", don't display update notifications as it will be automatically updated when the command is run. - if wf != nil && wf.SpeakeasyVersion.String() == "latest" { + // If we are running the run command and a workflow file is present and specifies that the speakeasyVersion is "latest", don't display update notifications as it will be automatically updated when the command is run. + if cmd.Name() == "run" && wf != nil && wf.SpeakeasyVersion.String() == "latest" { return }