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

feat: promote speakeasy version on successful run #1224

Merged
merged 4 commits into from
Jan 22, 2025
Merged

Conversation

chase-crumbaugh
Copy link
Member

@chase-crumbaugh chase-crumbaugh commented Jan 21, 2025

If run completes successfully using latest, promote the used version to be the installed CLI version (as if the user had run speakeasy update)

Also cleans up some of the logging to be a bit less obnoxious

https://linear.app/speakeasy/issue/SPE-4408/speakeasy-run-too-many-version-update-mentions

CleanShot 2025-01-21 at 15 49 28@2x

@@ -349,6 +353,20 @@ func runWithVersion(cmd *cobra.Command, artifactArch, desiredVersion string) err
return fmt.Errorf("failed to run with version %s: %w", desiredVersion, err)
}

// If the workflow succeeded, make the used version the default
if promote && !env.IsGithubAction() && !env.IsLocalDev() {
currentExecPath, err := os.Executable()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose there is a valid reason for us to prompt and only do this when we are in interactive mode and we know we can. Idk what do you think

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that, and I'm open to it, but it just felt a bit tedious. Like, if the CLI just ran using that version, why would I not want to install it (that's what im imagining customers saying/thinking)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya that's fair.

@chase-crumbaugh chase-crumbaugh merged commit f7d2170 into main Jan 22, 2025
3 checks passed
@chase-crumbaugh chase-crumbaugh deleted the chase/25-1-21 branch January 22, 2025 19:57
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.

2 participants