-
Notifications
You must be signed in to change notification settings - Fork 39
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
Update klotho checks #137
Update klotho checks #137
Conversation
This check was there intentionally. Let's say both the latest in both oss and pro is 0.6.0, and I'm on the oss stream. If I do It's very possible I got some other aspect of the workflow wrong, but I think we do need to preserve that behavior at least. |
pkg/cli/cli_options.go
Outdated
@@ -126,3 +128,19 @@ func OptionOrDefault(given string, defaultValue string) string { | |||
} | |||
return given | |||
} | |||
|
|||
func ShouldCheckForUpdate(given string, defaultValue string, currVersion string) bool { |
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.
small: can we rename these args? something like
func ShouldCheckForUpdate(given string, defaultValue string, currVersion string) bool { | |
func ShouldCheckForUpdate(updateStreamOverride string, defaultUpdateStream string, currVersion string) bool { |
and then similarly below:
givenParts
=>streamOverrideParts
givenVersion
=>streamOverrideVersion
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.
yep can change for sure
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.
Logic is good. For some reason, it took me a bit to actually grok this. Partially I could just be a bit out of it, but I think the var name changes I suggested would have helped a lot. If you disagree, feel free to disregard — my suggestions aren't blocking.
|
Previously, if you tried to pin to a lower version, we would treat it as a no-op (and keep you at your current version). Now, we'll perform the update ("downdate"). This resolves #187. We've had a few back-and-forths in this code, most recently #137. I added unit tests to try and put this to bed for good, or at least prevent further regressions.
Previously, if you tried to pin to a lower version, we would treat it as a no-op (and keep you at your current version). Now, we'll perform the update ("downdate"). This resolves #187. We've had a few back-and-forths in this code, most recently #137. I added unit tests to try and put this to bed for good, or at least prevent further regressions.
Previously, if you tried to pin to a lower version, we would treat it as a no-op (and keep you at your current version). Now, we'll perform the update ("downdate"). This resolves #187. We've had a few back-and-forths in this code, most recently #137. I added unit tests to try and put this to bed for good, or at least prevent further regressions. I found myself getting kinda confused about the various situations, so I wrote a novel to explain it to myself. I figured I'd keep it around for the next person.
I think the second stream check will result in false update messages being printed.
Here's an example where I set my options to
oss:v0.5.19
If the user pins the version to the current version, it's just never going to match the stream check because the current stream is always the default value
oss:latest
I'm pretty sure the first check for the semver is good enough since that takes the latest and converts it to the version number and compares that to the running builds version in the build file.
Discussion: Not sure if the initial intention was to notify the user every time they run, that their pinned version is behind latest, but if that's the case, then this needs to be merged in https://github.com/klothoplatform/klotho-server/pull/27. The server was checking w/ the stream version provided instead of actual latest.