-
Notifications
You must be signed in to change notification settings - Fork 569
Conversation
module OrganizationWebhook | ||
extend ActiveSupport::Concern | ||
|
||
def create_organization_webhook |
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.
Rubocop will complain if we put this method inside OrganizationController
.
I'm not sure if it's correct to extract this as a concern
.
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'm fine with it being here for now.
@@ -46,8 +46,9 @@ def slugify | |||
self.slug = "#{github_id} #{title}".parameterize | |||
end | |||
|
|||
def create_organization_webhook(webhook_url) | |||
webhook = github_organization.create_organization_webhook(config: { url: webhook_url }) | |||
def create_organization_webhook(webhook_url, client = nil) |
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 added an optional parameter client
here just in case we randomly picked other admins who don't have enough token scopes to manipulate organization webhook.
c2188b0
to
b4be608
Compare
describe 'ping event' do | ||
context 'valid payload signature' do | ||
before(:each) do | ||
params = JSON.parse(File.open("#{Rails.root}/spec/support/fixtures/webhook_payloads/ping.json").read) |
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.
@tarebyte I placed the JSON payload at this path, is this okay?
@tarebyte Thanks a lot for reviewing! I've made changes based on your feedback. Would you mind taking a 👀 at them? Thanks! |
I'll mark it as in progress for now since this PR should be a part of due date feature, which will be built on explicit assignment submission feature. Please see #720 for the explicit assignment submission feature. |
52fb3ed
to
910f29d
Compare
Closing this in favor of #756 (comment) |
Part of #667, follow up of #668.
This pull request:
ping
event of the webhookTODO:
WebhookEventController
ping
event if a hook has not receive one yet