-
Notifications
You must be signed in to change notification settings - Fork 264
[version] part 1: update command for devbox and launcher updates #965
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
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
6496558
to
2ac75ab
Compare
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.
update coming...
3b96873
to
4e6147a
Compare
Updated code, but need to test properly. |
bb7a730
to
be109ec
Compare
3c86906
to
2d0590d
Compare
if err != nil { | ||
return nil, errors.WithStack(err) | ||
} | ||
cmd := exec.Command(exe, "version", "-v") |
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.
Possibly future hardening is adding --json
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.
that would be a good idea
2d0590d
to
af4992b
Compare
I'm going to merge #966 into this PR, prior to merging to |
af4992b
to
892040c
Compare
…on is outdated (#966) ## Summary This PR updates the `vercheck.CheckVersion` to check launcher and devbox CLI binary versions, and print a notice if either is out-of-date. I print the message in all yellow similar to flyctl. But open to other renderings. ## How was it tested? `go test -run TestCheckVersion ./internal/vercheck/...` <img width="596" alt="Screenshot 2023-04-27 at 5 55 04 PM" src="https://user-images.githubusercontent.com/676452/235029194-d7d43c2a-0905-49e4-b90e-2be99a5a1a51.png"> - [ ] TODO: I need to do more manual testing.
**Motivation:** We want to disable auto-update for devbox CLIs. This will minimize unexpected interruptions for our users. To do so, we are going to do the following: 1. Update `launch.sh` file in `axiom` repo to write new versions to `{XDG_CACHE_HOME}/devbox/available-version`. jetify-com/axiom#3150 2. Change `devbox version update` to update the launcher (if needed) and else, update the CLI binary. (this PR). 3. Change the `vercheck.CheckVersion` that runs in `boxcli/root.go` on every command to check if the launcher or CLI binary versions are out-of-date, and to print a notice if so. (reviewed in #966, but merged into this PR) We will cherry-pick ~these two PRs~ this PR for the next release so auto-update stops for users. **Implementation:** This PR enables `jetpack version update` to: 1. Update the launcher: We detect if the launcher version is outdated, and update it, if needed. This also updates the devbox CLI binary as a side-effect. This requires `sudo` so we only do it, if necessary. 2. Update just the devbox CLI binary: If the launcher is up-to-date, then we update just the devbox CLI binary. 3. Remove dependency on new code like `env` package to minimize cherry-picking merge conflicts. TODO: - [x] confirm that we can switch the `devbox version` operation after an update to `StdOut`. I feel this is better so user is informed about the new version. cc @mikeland86 for the above question. Will only land this after the launch.sh file is updated in jetify-com/axiom#3150 Did some basic testing: hardcoded `true` to ensure `selfUpdateLauncher` runs, and did `devbox version update`: <img width="742" alt="Screenshot 2023-05-01 at 8 57 46 PM" src="https://user-images.githubusercontent.com/676452/235576315-03069599-a469-4f3a-90c2-cc6a58ec648a.png"> regular `devbox version update` <img width="332" alt="Screenshot 2023-05-01 at 8 48 20 PM" src="https://user-images.githubusercontent.com/676452/235575369-f2a70299-4a3a-4b41-80ec-ecedb730ad0b.png">
Summary
Motivation:
We want to disable auto-update for devbox CLIs. This will minimize unexpected interruptions for our users.
To do so, we are going to do the following:
launch.sh
file inaxiom
repo to write new versions to{XDG_CACHE_HOME}/devbox/available-version
. https://github.com/jetpack-io/axiom/pull/3150devbox version update
to update the launcher (if needed) and else, update the CLI binary. (this PR).vercheck.CheckVersion
that runs inboxcli/root.go
on every command to check if the launcher or CLI binary versions are out-of-date, and to print a notice if so. (reviewed in [version] part 2: print notice if devbox CLI binary or launcher version is outdated #966, but merged into this PR)We will cherry-pick
these two PRsthis PR for the next release so auto-update stops for users.Implementation:
This PR enables
jetpack version update
to:Update the launcher: We detect if the launcher version is outdated, and update it, if needed. This also updates the devbox CLI binary as a side-effect. This requires
sudo
so we only do it, if necessary.Update just the devbox CLI binary: If the launcher is up-to-date, then we update just the devbox CLI binary.
Remove dependency on new code like
env
package to minimize cherry-picking merge conflicts.TODO:
devbox version
operation after an update toStdOut
. I feel this is better so user is informed about the new version.cc @mikeland86 for the above question.
Will only land this after the launch.sh file is updated in https://github.com/jetpack-io/axiom/pull/3150
How was it tested?
Did some basic testing:
hardcoded
true
to ensureselfUpdateLauncher
runs, and diddevbox version update
:regular

devbox version update