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

[feat]: add methods for app hook deliveries #1620

Merged
merged 5 commits into from
Sep 29, 2023

Conversation

SebRollen
Copy link
Contributor

@SebRollen SebRollen commented Sep 7, 2023

Resolves #1619


Before the change?

  • The endpoints for /app/hooks are not yet implemented

After the change?

  • Implementations for listing app webhooks and retriggering delivery have been implemented

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

This is my first PR to Octokit and I wasn't able to get a test working using the JWT token, would appreciate some pointers here!

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@SebRollen SebRollen force-pushed the add-app-hook-methods branch from d7efeec to 65c467d Compare September 7, 2023 02:06
@SebRollen SebRollen force-pushed the add-app-hook-methods branch from f5ebd7c to f3d13b6 Compare September 7, 2023 02:11
describe '.list_app_hook_deliveries' do
it 'lists hook deliveries for an app' do
response = @jwt_client.list_app_hook_deliveries
expect(response).to be_kind_of(Array)
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about expanding the list of assertions here to include a total count check?

Copy link
Contributor Author

@SebRollen SebRollen Sep 9, 2023

Choose a reason for hiding this comment

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

Sure, that sounds good to me!

I've got to admit that I'm still a bit confused about how to successfully record a new VCR cassette, which is needed for the tests. Do I need to provide some of the ENV variables listed in the table in the README and run the specs with those variables?

Edit: Figured it out 😁

# @see https://developer.github.com/v3/apps/#redeliver-a-delivery-for-an-app-webhook
#
# @return [Boolean] Success
def deliver_app_hook(delivery_id, options = {})
Copy link
Member

Choose a reason for hiding this comment

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

Do you have thoughts on how this might be tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, just added in a spec for this endpoint as well. Similar to some of the specs for endpoints the delete resources, the only real thing to test for here is a truthy response

@SebRollen SebRollen requested a review from kfcampbell September 9, 2023 18:42
@SebRollen
Copy link
Contributor Author

@kfcampbell, friendly bump on this one, I think I addressed all your comments

Copy link
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

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

Thanks @SebRollen for these changes! ❤️

@nickfloyd nickfloyd added the Type: Feature New feature or request label Sep 29, 2023
@nickfloyd nickfloyd changed the title add methods for app hook deliveries [feat]: add methods for app hook deliveries Sep 29, 2023
@nickfloyd nickfloyd merged commit bd95b27 into octokit:main Sep 29, 2023
@SebRollen SebRollen deleted the add-app-hook-methods branch October 9, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[FEAT]: Add methods for app webhooks
3 participants