-
Notifications
You must be signed in to change notification settings - Fork 142
Remove Github basic auth from gist-log command #1383
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
base: master
Are you sure you want to change the base?
Remove Github basic auth from gist-log command #1383
Conversation
|
Okay, I've confirmed now that issue creation still works (see the issue referenced above.) |
|
And indeed, the Github API response to tigerbrew/Library/Homebrew/cmd/gist-logs.rb Lines 123 to 131 in d6421dc
tigerbrew/Library/Homebrew/cmd/gist-logs.rb Line 117 in d6421dc
While this is all semantically correct, it took nearly an hour to run on a PowerPC Mac Mini. A much hackier but vastly quicker way to get the same string could be to grab it with a regular expression on the response body, e.g. If you don't think that's too much of a hack, I could amend this PR with that change, or would be glad to look into other optimization ideas. |
|
Nice work here! Thanks so much for this!
When we're dealing with old computers, nothing's too much of a hack - sometimes you have to do something a little weird in the name of performance. I'm fine with it if you think it's the fastest approach. |
…n html_url from github response
|
I've been testing this change against different packages for the past few days, and I think, on balance, it's a reasonable optimization. It's been reliable and quick. I went ahead and amended the PR with this commit: 15879e7. I'm continuing to run tests and let it create issues in my fork, and they're continuing to all look good. |
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.
Excellent! Thanks for the change and for testing.
Since Github has deprecated basic authentication, change the gist-log command to prompt the user to create a Github personal access token any time
HOMEBREW_GITHUB_API_TOKENisn't found in the environment, rather than attempting to fall back to basic auth and failing. This should make it clearer to a user how to successfully post a build log to Github gists.With basic auth functionality no longer available, several lines of code that had enabled it can also be removed - doing so.
Tested on Tiger PowerPC, successfully created these gists:
I'm also currently testing with the
--new-issueflag, but wow does it take a long time for Ruby on one of these old Macintoshes to process the response body from a command that created the gist: I suspect it's trying to JSON parse the entire contents of the logs or something. The only thing it seems to use from the response body is the URL of the gist it just created, so a good optimization might be to do something more efficient thanUtils::JSON.load get_body(response).