-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for the Commit Search API preview #959
Conversation
Ensure that the preview accept header is set properly
I know I need a new cassette. The code works in |
Changes Unknown when pulling 25a9433 on azizshamim:commit-search-preview into ** on octokit:master**. |
@tarebyte - any tips on getting the right fixtures into this branch? I'm struggling to generate them. |
@azizshamim everything seems to be ok, I'll take a look to see if something funky is going on. |
@tarebyte I'm about 90% sure it's because I don't have the right credentials set up, nor the right configuration set up, to connect to GitHub API and generate the right fixture for the tests. Any guidance would be much appreciated. |
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.
This looks reasonable to me!
# | ||
# @param query [String] Search terms and qualifiers | ||
# @param options [Hash] Sort and pagination options | ||
# @option options [String] :sort Sort field |
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.
Maybe Field to sort by
instead of Sort field
.
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.
I was matching the language of the other option descriptions.
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, the rest of the codebase uses Sort field
. Some endpoints also mention what the available sort options are, but many do not.
@azizshamim Did you define |
@kytrinyx - Yes. Just retested it, same error. 1) Octokit::Client::Search.search_commits searches commits
Failure/Error: results = @client.search_commits 'repo:octokit/octokit.rb author:jasonrudolph', \
NoMethodError:
undefined method `<<' for {:read_timeout=>60, :continue_timeout=>nil, :debug_output=>nil}:Hash
Did you mean? < Does the token need any specific permissions? |
No, it shouldn't. Let me pull this down and see if I can figure out what's going on. |
This worked for me with a token that didn't have any scopes. I've pushed up the VCR cassette. If this passes I'll go ahead and merge it. |
Thanks for your patience in getting this change in! ✨ |
Thanks for the assist @kytrinyx. I wonder if I’ve borked my global I’d like to add support for all the API previews that aren’t implemented to this gem. I wonder if I can fix it before I open the next Pull Request. |
One thing occurred to me... did you delete the generated cassette between
each attempt? One thing that I tend to do is retry... after a failed call
gets recorded by VCR, thereby replaying the bad request /facepalm
|
The cassette never regenerates if I delete it. None of them do. Whether I have a valid token in |
Ok, that totally sucks! I have no idea what might be going on here. |
This has been released as part of https://github.com/octokit/octokit.rb/releases/tag/v4.9.0 |
This PR adds support for the Commit Search API preview:
search_commits
method for returning the search results for commits