-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add showMessage support to xpls
and new version notifications
#134
Conversation
- emits a message to the client informing them that a new version is available of up Signed-off-by: Taylor Thornton <thornton.tn@gmail.com>
internal/xpls/version/version.go
Outdated
func (i *Informer) newAvailable(local, remote string) bool { | ||
lv, err := semver.NewVersion(local) | ||
if err != nil { | ||
// invalid remote version detected |
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.
// invalid remote version detected | |
// invalid local version detected |
should this be in error message?
internal/xpls/version/version.go
Outdated
|
||
"github.com/crossplane/crossplane-runtime/pkg/logging" | ||
|
||
"github.com/upbound/up/internal/version" |
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.
Could this be bundled into the existing version
pkg? I could see this being useful for checking for a new available version in up -v
:) (perhaps it should be an optional flag though so that it doesn't make an unexpected network call -- could explore 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.
Sure thing 👍 (I'll move it). I'll hold off on adding it to up --version
for now though.
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.
SGTM 👍🏻
moved folded local/remote version comments into errors returned to client Signed-off-by: Taylor Thornton <thornton.tn@gmail.com>
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
type client interface { | ||
Do(*http.Request) (*http.Response, error) | ||
} |
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.
Probably wouldn't hurt for us to have a small http
package eventually as we are probably doing (or will do) some of this in a variety of places 👍🏻
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.
Totally agree.
Description of your changes
Add support to
xpls
for emitting messages to the end user throughwindow/showMessage
. For now, this is only used to inform the end user that a new version is available to download up.I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Beyond the unit tests, I hardcoded my version locally to "v0.5.0" and confirmed that I received the following pop-up: