Skip to content

Check new available versions accurately - #210

Open
yantonov wants to merge 1 commit into
criteo:mainfrom
yantonov:version_update
Open

yantonov wants to merge 1 commit into
criteo:mainfrom
yantonov:version_update

Conversation

@yantonov

Copy link
Copy Markdown

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.

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 bhou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the file has a format issue

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What format issue, gofmt show nothing

@yantonov yantonov Sep 14, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function format issue

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants