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
Adds support to configure the GitHub access token to be used for GitHub API calls #605
Conversation
To avoid Github rate limit issues now it is possible to provide a Github API access token. In shared environment where several virtual machines are using the same public ip address (like travis ci), carthage user could hit a Github API rate limit. By providing a Github API access token, carthage can get a higher rate limit.
You can check https://github.com/Wolox/ReactiveArray to see a running version of this patch in TravisCI |
I have mixed feels about this. @Carthage/carthage? |
Seems like maybe this shouldn’t be a command line argument, but maybe an environment variable? |
The need is real, but I agree that an environment variable is probably the way to go here. |
👍 to an environment variable. |
I will remove the command line parameter and add support for the I wasn't sure about adding a the Should I amend the previous commit or add a new one? |
New commits are preferred to rewriting history. 😄 |
Just replaced the command line argument for the env variable. Let me know if you want to change something else. |
@@ -266,6 +284,14 @@ internal struct GitHubCredentials { | |||
} | |||
} | |||
|
|||
internal func loadGitHubCredentials(accessToken: GitHubAccessToken?) -> SignalProducer<GitHubCredentials?, CarthageError> { | |||
if let accessToken = accessToken { | |||
return SignalProducer(value: AccessTokenGitHubCredentials(accessToken: accessToken)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we read GITHUB_ACCESS_TOKEN
here instead of passing it in? I think it's best to read it from CarthageKit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can definetly do that. My retaionale behind this was that for me the command line app is the one responsabile for obtaining the input (user or env) and feed that input to the CarthageKit lib.
I really like where this is headed—thanks for working on it! ✨ And sorry for the delayed review. |
Instead of reading the env variable in the Carthage command line application we do it inside CarthageKit.
@mdiep I've just commited the fixes we were discussing. Let me know if there is anything else. Should I amend all the commits before merge? |
@@ -11,6 +11,7 @@ import Foundation | |||
import Result | |||
import ReactiveCocoa | |||
import Runes | |||
import Box |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this import needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for that I forgot to delete it. I was trying a different approch that didn't work and I left that. I am adding a new commit to fix it.
No, you don't need to amend the commits. We prefer history to be unaltered. |
Thanks for all the work you put into this. It looks great! ✨ |
Adds support to configure the GitHub access token to be used for GitHub API calls
🎉 |
@mdiep would you mind building a new release including this feature? |
@robb I'll try to do so in the next few days. I've been busy with a move, but would really like to get all the new bits out in the wild. |
I just released 0.8: Llama Calculus. #583 didn't make it in, but I'll cut another release once the current batch of PRs is merged. I haven't opened a PR for homebrew since I don't use it, but it'd be ✨ if someone wanted to do so. |
@mdiep To open a PR for homebrew do we need to collaborators or anybody can do it? I've never released a brew formula before. |
I think anybody, but I've never done it either. You should be able to search for Carthage in their PRs to find an example. |
Carthage version 0.8 has been released and there is no need to use a custom build because Carthage/Carthage#605 is available now
Hey any support for .env files to store the |
PRs welcome :) |
Using direnv will be a possible solution. |
Oh thx, that’s a great tip 👍 |
fixes #603
To avoid Github rate limit issues now it is possible
to provide a Github API access token.
In shared environment where several virtual machines
are using the same public ip address (like travis ci),
carthage user could hit a Github API rate limit. By
providing a Github API access token, carthage can get
a higher rate limit.