-
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
Generate hooks client #1161
Generate hooks client #1161
Conversation
Adds default hash and missing key error Co-Authored-By: Mark Tareshawty <[email protected]>
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.
🍰 just a few questions.
# @return [Boolean] True if hook removed, false otherwise. | ||
# @param repo [Integer, String, Repository, Hash] A GitHub repository | ||
# @param hook_id [Integer] The ID of the hook | ||
# @return <Boolean> True on success, false otherwise |
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.
Looks like this should be
# @return <Boolean> True on success, false otherwise | |
# @return [Boolean] True on success, false otherwise |
spec/octokit/client/hooks_spec.rb
Outdated
context "with repository" do | ||
before(:each) do | ||
@repo = @client.create_repository("an-repo") | ||
@repo = @client.create_repository("a-repo") |
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.
Do we maybe want to use the already created repo?
spec/octokit/client/hooks_spec.rb
Outdated
end | ||
|
||
describe ".create_hook", :vcr do | ||
it "creates a hook" do | ||
assert_requested :post, github_url("/repos/#{@repo.full_name}/hooks") | ||
end | ||
it "returns with no config url passed" do | ||
expect { @client.create_hook(@repo.full_name)}.to raise_error Octokit::MissingKey |
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.
✨
Return type formatting + test repo
Part of #1157. Continues to generalize the
openapi_client_generator
and generates thehooks.rb
client.There are breaking changes as a few of the method definitions have changed, however the underlying api calls appeared to have changed and the old methods don't completely work. This does removes support for service hooks (which aren't supported in general anymore) and
parse_payload
which is a helper function. Also,remove_hook
is nowdelete_hook
andtest_hook
istest_push_hook
as these more closely resemble the API.This also retroactively affects the previous generated clients as we changed list calls to
paginate
.TODOs:
hooks_spec
andopenapi_client_generator_spec