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

Use GITHUB_TOKEN if set #5070

Merged

Conversation

jkwak-work
Copy link
Collaborator

We have been having an error from Github saying that API rate limit exceeded for IP. It hits the limit more often if your public IP is shared by many other collegues.

{"message":"API rate limit exceeded for 216.228.112.22. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

The suggested solution from GitHub is to use gh.exe tool with "auth login" arguments. It will store a token and allow us to use API more than the limit set for IP without token.

However, our cmake build doesn't use gh.exe and API is called via REST. This commit adds an extra header to the HTTP request with the infomration of the github token if the value is.

Usage: cmake.exe --preset vs2019 -DSLANG_GITHUB_TOKEN=your_token_here

We have been having an error from Github saying that API rate limit
exceeded for IP. It hits the limit more often if your public IP is
shared by many other collegues.

{"message":"API rate limit exceeded for 216.228.112.22. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

The suggested solution from GitHub is to use gh.exe tool with "auth
login" arguments. It will store a token and allow us to use API more
than the limit set for IP without token.

However, our cmake build doesn't use gh.exe and API is called via REST.
This commit adds an extra header to the HTTP request with the
infomration of the github token if the value is.

Usage: cmake.exe --preset vs2019 -DSLANG_GITHUB_TOKEN=your_token_here
@jkwak-work jkwak-work added the pr: non-breaking PRs without breaking changes label Sep 16, 2024
@jkwak-work jkwak-work self-assigned this Sep 16, 2024
Copy link
Collaborator

@expipiplus1 expipiplus1 left a comment

Choose a reason for hiding this comment

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

What happens when one doesn't specify a token?

We might want to issue a message(WARNING if we detect a failure that adding a token would help with.

@jkwak-work
Copy link
Collaborator Author

The token is optional.
When not specified, the default value is an empty string. I tested this case locally.

I can add the suggested message.

@csyonghe csyonghe merged commit c6b702c into shader-slang:master Sep 19, 2024
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants