dvershinin / lastversion

Find the latest release version of an arbitrary project
https://lastversion.getpagespeed.com
BSD 2-Clause "Simplified" License
375 stars 33 forks source link

[GitLab] CRITICAL - No release was found #132

Closed kovmir closed 10 months ago

kovmir commented 10 months ago

Project with incorrect version

https://gitlab.com/librewolf-community/browser/appimage/-/releases

To Reproduce

GITLAB_PA_TOKEN='mytoken' lastversion https://gitlab.com/librewolf-community/browser/appimage --verbose

Expected behavior

Latest release number, e.g. currently 120.0.1-1.

Program output

lastversion.lastversion - INFO - Verbose 1 level output.
lastversion.ProjectHolder - INFO - Using cache directory: /home/uninstance/.cache/lastversion.
lastversion.ProjectHolder - INFO - Created instance of GitLabRepoSession
lastversion.GitLabRepoSession - INFO - Using Personal Access token.
lastversion.lastversion - CRITICAL - No release was found
dvershinin commented 10 months ago

Fixed in just-released lastversion v3.4.4

kovmir commented 10 months ago

Am I doing it wrong?

$ lastversion --version
lastversion 3.4.4, up to date
$ GITLAB_PA_TOKEN='mytoken' lastversion https://gitlab.com/librewolf-community/browser/appimage --verbose
lastversion.lastversion - INFO - Verbose 1 level output.
lastversion.ProjectHolder - INFO - Using cache directory: /home/uninstance/.cache/lastversion.
lastversion.ProjectHolder - INFO - Created instance of GitLabRepoSession
lastversion.GitLabRepoSession - INFO - Using Personal Access token.
lastversion.GitLabRepoSession - DEBUG - Checking if https://gitlab.com/api/v4/projects/librewolf-community%2Fbrowser%2Fappimage is repo
lastversion.GitLabRepoSession - DEBUG - Checking if https://gitlab.com/api/v4/projects/librewolf-community%2Fbrowser is repo
Traceback (most recent call last):
  File "/home/uninstance/.local/bin/lastversion", line 8, in <module>
    sys.exit(main())
  File "/home/uninstance/.local/lib/python3.9/site-packages/lastversion/lastversion.py", line 842, in main
    res = latest(
  File "/home/uninstance/.local/lib/python3.9/site-packages/lastversion/lastversion.py", line 232, in latest
    release = project.get_latest(pre_ok=pre_ok, major=repo_data.get("major", major))
  File "/home/uninstance/.local/lib/python3.9/site-packages/lastversion/GitLabRepoSession.py", line 103, in get_latest
    r = self.repo_query("/repository/tags")
  File "/home/uninstance/.local/lib/python3.9/site-packages/lastversion/GitLabRepoSession.py", line 40, in repo_query
    repo_enc = self.repo.replace("/", "%2F")
AttributeError: 'NoneType' object has no attribute 'replace'
dvershinin commented 10 months ago

@kovmir do you see a different output if you don't prefix your command with GITLAB_PA_TOKEN='mytoken' ?

kovmir commented 10 months ago

I do, it works.

$ lastversion https://gitlab.com/librewolf-community/browser/appimage
120.0.1
dvershinin commented 10 months ago

Probably your GITLAB_PA_TOKEN value is incorrect. Expired perhaps.

kovmir commented 10 months ago

I have created one today with all permissions.

dvershinin commented 10 months ago

@kovmir I tried to follow your steps and the problem was unnecessary quoting of the token. It should be GITLAB_PA_TOKEN=TOKEN and not GITLAB_PA_TOKEN='TOKEN'

kovmir commented 10 months ago

Everything is fine, works even quoted (the quotes are for the shell).

I had a typo in my token string, I am sorry.