Conversation
Now, version are checked using simple comparison. If you install newer version, for example from GH, then try to use it locally and locally latest available version is not as new as for GH, you can see, for example. Version: 1.16.2 Available 1.15.2, do you want to update, which is strange and confusing. Here is a tiny zero-dependency fix that allows to check versions accurately.
bhou
left a comment
There was a problem hiding this comment.
The current design is that it check a particular url (self_update_latest_version_url) and ensure local version align with that one. This will make the rollback much easier. What we need to do is simply point the url to the previous version.
I think the fix should be the update message, which is confusing because it is not necessary always the "newer" version to be installed.
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
There was a problem hiding this comment.
I think the file has a format issue
There was a problem hiding this comment.
What format issue, gofmt show nothing
There was a problem hiding this comment.
Question is not about the message, the problem is suggestion to update when it is no needed and interface is blocked until explicit response is provided and it is completely not expected to ask about rollback when it's not needed
There was a problem hiding this comment.
This fix handles version accurately
a) if we compare regular versions (not dev, custom, hotfix etc) version will be compared using semver
b) otherwise - current logic with equals
it allows to easily update to latest published/available from dev
About:
This will make the rollback much easier.
at the same time it allows to ignore old version if currently new version is already installed.
| remoteParts, remoteOk := splitVersionInts(remote) | ||
| currentParts, currentOk := splitVersionInts(current) | ||
| if !remoteOk || !currentOk { | ||
| return remote != current |
Now, version are checked using simple comparison.
If you install newer version, for example from GH, then try to use it locally
and locally latest available version is not as new as for GH, you can see, for example.
Version: 1.16.2
Available 1.15.2, do you want to update,
which is strange and confusing.
Here is a tiny zero-dependency fix that allows to check versions accurately.