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

Add hooks support for WebSub (formerly PubSubHubbub) protocol #2397

Merged
merged 3 commits into from Aug 21, 2022

Conversation

YuyaAbo
Copy link
Contributor

@YuyaAbo YuyaAbo commented Jun 26, 2022

resolves #1265

Note: PubSubHubbub seems to have been renamed WebSub when it was adopted by the W3C. So we use the name WebSub in our code.
ref https://github.com/pubsubhubbub/PubSubHubbub

Added support for API to subscribe and unsubscribe to repository events via WebSub protocol.

GitHub API Docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub
WebSub Docs: https://www.w3.org/TR/websub/

WebSub requires Content-Type to be application/x-www-form-urlencoded, so a new factory function has been added.

This request MUST have a Content-Type header of application/x-www-form-urlencoded (described in Section 4.10.22.6 [HTML5])
https://www.w3.org/TR/websub/#subscriber-sends-subscription-request

@google-cla
Copy link

google-cla bot commented Jun 26, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov
Copy link

codecov bot commented Jun 26, 2022

Codecov Report

Merging #2397 (bf7f3b4) into master (404bf94) will decrease coverage by 0.01%.
The diff coverage is 94.11%.

@@            Coverage Diff             @@
##           master    #2397      +/-   ##
==========================================
- Coverage   98.06%   98.04%   -0.02%     
==========================================
  Files         119      119              
  Lines       10546    10597      +51     
==========================================
+ Hits        10342    10390      +48     
- Misses        140      142       +2     
- Partials       64       65       +1     
Impacted Files Coverage Δ
github/github.go 97.37% <83.33%> (-0.43%) ⬇️
github/repos_hooks.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 404bf94...bf7f3b4. Read the comment docs.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @YuyaAbo !
Just a couple tiny tweaks, please, then we should be ready for a second approval before merging.

github/repos_hooks.go Outdated Show resolved Hide resolved
github/repos_hooks.go Outdated Show resolved Hide resolved
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Jun 26, 2022
YuyaAbo and others added 2 commits June 26, 2022 22:13
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@YuyaAbo YuyaAbo requested a review from gmlewis June 26, 2022 13:13
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @YuyaAbo !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

Copy link
Contributor

@raynigon raynigon left a comment

Choose a reason for hiding this comment

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

Can be merged, but it would be nice if the error case test gets added first.

github/github.go Show resolved Hide resolved
@gmlewis gmlewis added waiting for reply and removed NeedsReview PR is awaiting a review before merging. labels Aug 19, 2022
@gmlewis gmlewis merged commit e5e45da into google:master Aug 21, 2022
@YuyaAbo YuyaAbo deleted the support-websub-api branch August 25, 2022 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PubSubHubbub API for creating hooks
3 participants