-
Notifications
You must be signed in to change notification settings - Fork 110
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
[RSDK-4975] CLI update warning #3585
[RSDK-4975] CLI update warning #3585
Conversation
This is still a draft, still needs tests and verification. Wanted to get feedback on the approach, messages, etc. before going further. |
fb40338
to
a868377
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.
Nice! Some initial comments.
to test the changes you can alter the following in
|
dbf3bbe
to
205cd07
Compare
TAG_VERSION?=$(shell git tag --points-at | sort -Vr | head -n1) | ||
LDFLAGS = -ldflags "-s -w -extld="$(shell pwd)/etc/ld_wrapper.sh" -X 'go.viam.com/rdk/config.Version=${TAG_VERSION}' -X 'go.viam.com/rdk/config.GitRevision=${GIT_REVISION}'" | ||
TAG_VERSION?=$(shell git tag --points-at | sort -Vr | head -n1 | grep . || echo "(dev)") | ||
DATE_COMPILED?=$(shell date +'%Y-%m-%d') |
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.
[opt] A friend of mine mentioned that using the go debug vcs.time
would work as well.
See: https://pkg.go.dev/runtime/debug#BuildSetting
We report this in viam --debug version
Note: if you compile the cli with go build ./viam/main.go
the vcs debug info won't be there. golang/go#51279
I don't want to drag down this PR in refactors so I don't see a strong reason to do this now, but might be worth considering in the future.
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.
looks good w/ respect to my change requests
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.
LGTM
@@ -380,6 +387,129 @@ func RobotsPartShellAction(c *cli.Context) error { | |||
) | |||
} | |||
|
|||
// checkUpdateResponse holds the values used to hold release information. |
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.
nit: rename this too
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.
Nice! LGTM 🧑🔧 .
RSDK-4975
On installs older than one week, warns users when their CLI is out of date against the latest stable release.