Wrong version of n8n
TheBlusky opened this issue · 5 comments
Project with incorrect version
To Reproduce
$ lastversion n8n-io/n8n --verbose
lastversion.lastversion - INFO - Verbose 1 level output.
lastversion.ProjectHolder - INFO - Using cache directory: C:\Users\micro\AppData\Local\lastversion\lastversion\Cache.
lastversion.ProjectHolder - INFO - Created instance of GitHubRepoSession
lastversion.GitHubRepoSession - INFO - No API token found in environment variables ['LASTVERSION_GITHUB_API_TOKEN', 'GITHUB_API_TOKEN', 'GITHUB_TOKEN'].
lastversion.GitHubRepoSession - INFO - Got HTTP status code 200 from https://github.com/n8n-io/n8n/releases.atom
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.20.0
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.20.0 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.20.0 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.20.0.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.20.0 is not comparable to current selection
lastversion.GitHubRepoSession - INFO - Got HTTP status code 200 from https://api.github.com/repos/n8n-io/n8n/releases
lastversion.GitHubRepoSession - INFO - Found formal release for this tag which is unwanted pre-release: 1.20.0.
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.19.5
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.19.5 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.19.5 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.19.5.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.19.5 is not comparable to current selection
lastversion.GitHubRepoSession - INFO - Found formal release for this tag which is unwanted pre-release: 1.19.5.
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.18.2
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.18.2 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.18.2 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.18.2.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.18.2 is not comparable to current selection
lastversion.GitHubRepoSession - INFO - Selected version as current selection: 1.18.2.
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.19.4
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.19.4 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.19.4 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.19.4.
lastversion.GitHubRepoSession - INFO - Found formal release for this tag which is unwanted pre-release: 1.19.4.
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.19.3
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.19.3 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.19.3 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.19.3.
lastversion.GitHubRepoSession - INFO - Got HTTP status code 404 from https://api.github.com/repos/n8n-io/n8n/releases/tags/n8n@1.19.3
lastversion.GitHubRepoSession - INFO - No formal release for tag n8n@1.19.3
lastversion.GitHubRepoSession - INFO - Selected version as current selection: 1.19.3.
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.18.1
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.18.1 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.18.1 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.18.1.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.18.1 does not contain newer version than we already found
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.19.2
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.19.2 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.19.2 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.19.2.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.19.2 does not contain newer version than we already found
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.19.1
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.19.1 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.19.1 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.19.1.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.19.1 does not contain newer version than we already found
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.19.0
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.19.0 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.19.0 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.19.0.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.19.0 does not contain newer version than we already found
lastversion.GitHubRepoSession - INFO - Checking tag n8n@1.18.0
lastversion.ProjectHolder - INFO - Sanitizing string n8n@1.18.0 as a satisfying version.
lastversion.ProjectHolder - INFO - Failed to parse n8n@1.18.0 as Version.
lastversion.ProjectHolder - INFO - Sanitized tag name value to 1.18.0.
lastversion.GitHubRepoSession - INFO - Tag n8n@1.18.0 does not contain newer version than we already found
lastversion.lastversion - INFO - Located the latest release tag n8n@1.19.3 at: https://github.com/n8n-io/n8n via feed mechanism
1.19.3
Expected behavior
1.18.2
(Tag 1.19.3 exists, but latest release is 1.18.2 and latest pre-release is 1.20.0, I don't know why current output is 1.19.3)
Program output
1.19.3
Support This Project
❤️ Love this project? Consider supporting us by becoming a GitHub Sponsor. GitHub Sponsors get priority attention to their issues and requests. Click here to sponsor.
lastversion
was created exactly to address this and the output seems actually correct here.
Author did not file formal release for 1.19.3, but it is not marked as pre-release, doesn't contain beta keywords, etc.
So https://github.com/n8n-io/n8n/releases/tag/n8n%401.19.3 is latest release :-)
In this case only raises question why they tagged 1.19.3 two weeks ago while the 1.18.2 one week later.
@TheBlusky maybe this issue should be about adding --formal
tag to only consider those as releases. I am not sure. So far, virtually in 99% cases tags as releases is the most reliable approach. Let me know what you think.
Oh, alright, I guess misunderstood the definition of release, my bad :-)
I use lastversion in a script for something like ~20 projects. I use it mainly to auto update images in docker-compose file. Usually, docker images of projects are updated using the same schema as projects release.
These two projects (my issues about n8n and cadvisor are now obviously the same issue), are the only ones I'm having issues with.
A --formal
option could solve my problems, and as you said, it's not needed for most of projects I'm following with this tool, but my help me for edge cases.
Added --formal
in v3.4.3
With this update, I was able to tweak my script with the formal
argument of latest()
.
Everything now works as expected for both projects. Thanks for this fast update !!!