Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add support for PubSub webhook registration #181

Merged
merged 3 commits into from
May 20, 2021
Merged

Add support for PubSub webhook registration #181

merged 3 commits into from
May 20, 2021

Conversation

tbrenev
Copy link
Contributor

@tbrenev tbrenev commented May 14, 2021

WHY are these changes introduced?

We will soon have support for webhook delivery via Google Cloud PubSub.
We need to update the webhook registration function in this library to support this new delivery method.

WHAT is this pull request doing?

The register function already takes in a DeliveryMethod. This PR adds a new DeliveryMethod.PubSub,
and implements the appropriate behaviour for it. In particular, register hits the new pubSubWebhookSubscriptionCreate
and pubSubWebhookSubscriptionUpdate endpoints in the GraphQL API.

This PR also adds some documentation about registering non-HTTP-delivery webhooks (the docs for
EventBridge webhooks were missing as well).

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

src/webhooks/registry.ts Outdated Show resolved Hide resolved
src/webhooks/registry.ts Show resolved Hide resolved
@tbrenev tbrenev force-pushed the pub-sub-webhooks branch from d541a1e to 6809ba4 Compare May 17, 2021 16:53
@tbrenev tbrenev requested a review from james-langille May 17, 2021 17:01
@tbrenev
Copy link
Contributor Author

tbrenev commented May 17, 2021

🎩

  • Checked that pubsub webhooks are successfully registered
  • Checked that eventbridge webhooks are successfully registered
  • Checked that http webhooks are successfully registered, and the handler is called when the webhook fires

@tbrenev tbrenev requested a review from paulomarg May 17, 2021 17:26
@tbrenev tbrenev marked this pull request as ready for review May 17, 2021 17:26
@tbrenev tbrenev requested a review from a team as a code owner May 17, 2021 17:26
docs/usage/webhooks.md Outdated Show resolved Hide resolved
docs/usage/webhooks.md Outdated Show resolved Hide resolved
docs/usage/webhooks.md Outdated Show resolved Hide resolved
docs/usage/webhooks.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@tbrenev tbrenev force-pushed the pub-sub-webhooks branch from 4e19cfb to c4c3854 Compare May 17, 2021 19:32
Copy link
Contributor

@thecodepixi thecodepixi left a comment

Choose a reason for hiding this comment

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

This looks really good! Just left a few nit-ish comments and one question for you.

src/base_types.ts Show resolved Hide resolved
src/webhooks/registry.ts Show resolved Hide resolved
src/webhooks/registry.ts Show resolved Hide resolved
@tbrenev tbrenev force-pushed the pub-sub-webhooks branch from c4c3854 to 03f4036 Compare May 17, 2021 20:20
@tbrenev tbrenev merged commit 07252a9 into main May 20, 2021
@tbrenev tbrenev deleted the pub-sub-webhooks branch May 20, 2021 20:43
@shopify-shipit shopify-shipit bot temporarily deployed to production May 21, 2021 18:24 Inactive
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants