Skip to content
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

Golangci-lint downloader fails to download binary #3509

Closed
4 tasks done
ssko1 opened this issue Jan 27, 2023 · 12 comments · Fixed by #3510
Closed
4 tasks done

Golangci-lint downloader fails to download binary #3509

ssko1 opened this issue Jan 27, 2023 · 12 comments · Fixed by #3510
Labels
area: install Issue relates to installation or downloading process bug Something isn't working

Comments

@ssko1
Copy link

ssko1 commented Jan 27, 2023

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc.).
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)

Description of the problem

The downloader decscribed in the installation guide https://golangci-lint.run/usage/install/#other-ci returns with an error. It does not install the golangci-lint binary into my go path.

Perhaps the Github API changed?

Version of golangci-lint

N/A

Configuration file

N/A

Go environment

N/A

Verbose output of running

computer@computer directory % curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1

golangci/golangci-lint info checking GitHub for tag 'v1.50.1'
golangci/golangci-lint info found version:  <!DOCTYPE html> <html lang= for  <!DOCTYPE html> <html lang=/darwin/amd64
computer@computer directory %

Code example or link to a public repository

N/A

@ssko1 ssko1 added the bug Something isn't working label Jan 27, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 27, 2023

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@mdestagnol
Copy link

Same problem here, since this morning. The script mentioned in the install page is broken. It seems that it's fetching from a URL which is not returning what it used to

@ssko1
Copy link
Author

ssko1 commented Jan 27, 2023

The script performs a check against github to obtain a tag... something like:

curl https://github.com/golangci/golangci-lint/releases/v1.49.0 -H "Accept: application/json"

This now returns a webpage instead of JSON like it was before?

@mfine
Copy link
Contributor

mfine commented Jan 28, 2023

Maybe they turned off that access path in favor of using the API?

~ curl --silent -H 'Accept: application/json'  https://api.github.com/repos/golangci/golangci-lint/releases/tags/v1.35.2 | head
{
  "url": "https://api.github.com/repos/golangci/golangci-lint/releases/36207082",
  "assets_url": "https://api.github.com/repos/golangci/golangci-lint/releases/36207082/assets",
  "upload_url": "https://uploads.github.com/repos/golangci/golangci-lint/releases/36207082/assets{?name,label}",
  "html_url": "https://github.com/golangci/golangci-lint/releases/tag/v1.35.2",
  "id": 36207082,
  "author": {
    "login": "golangci-releaser",
    "id": 65486276,
    "node_id": "MDQ6VXNlcjY1NDg2Mjc2",

@mfine
Copy link
Contributor

mfine commented Jan 28, 2023

This works for me:

321c321
<   giturl="https://github.com/${owner_repo}/releases/${version}"
---
>   giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
324c324
<   version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//')
---
>   version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": "//' | sed 's/".*//')

@ben-tbotlabs
Copy link

Hopefully this can get merged fairly quickly. The devcontainers install for Go (https://github.com/devcontainers/features/tree/main/src/go) is currently broken as it has been dependant on the golangci install since Oct

@mfine
Copy link
Contributor

mfine commented Jan 28, 2023

And added support for handling without a specified version #3510.

@ldez ldez added the area: install Issue relates to installation or downloading process label Jan 28, 2023
@ldez
Copy link
Member

ldez commented Jan 28, 2023

Seems to be a GitHub bug related to an API change: https://github.com/orgs/community/discussions/45590

@cyprianbergoniatmo
Copy link

I'm getting rate limits so our pipelines are still failing on the api calls

@ldez
Copy link
Member

ldez commented Jan 28, 2023

I have no solution for your rate limits problem, it's a GitHub constraint.
You have to stop calling the API for 1 hour.

For unauthenticated requests, the rate limit allows for up to 60 requests per hour.

https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting

mmcloughlin added a commit to mmcloughlin/avo that referenced this issue Jan 28, 2023
Updates golangci-lint install to incorporate the fix for
golangci/golangci-lint#3509, which was affecting CI tests, for example:

https://github.com/mmcloughlin/avo/actions/runs/4030013813
mmcloughlin added a commit to mmcloughlin/addchain that referenced this issue Jan 28, 2023
Updates golangci-lint install to incorporate the fix for
golangci/golangci-lint#3509.
@ldez
Copy link
Member

ldez commented Jan 28, 2023

@ldez
Copy link
Member

ldez commented Jan 28, 2023

@cyprianbergoniatmo as GitHub engineers reverted their change, and due to the rate limit problem I will revert the previous fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: install Issue relates to installation or downloading process bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants