-
Notifications
You must be signed in to change notification settings - Fork 26
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
Differentiate new PRs from issues in notifications #299
Conversation
This isn't working: Rather than infer PR-ness from |
@@ -6,6 +6,7 @@ class IssuesOpenIssueJob < IssueEventJob | |||
|
|||
def payload(params) | |||
{ | |||
pull_request: params[:pull_request], |
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.
this could also be written params[:issue].key?(:pull_request)
if the webhook payload is similar enough to the original issue payload that is.
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 adding :pull_request
to the base payload, not attaching it to the :issue
hash.
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.
Oh, I assume in discovery you found that the webhook doesn't carry a PR object ?
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.
Correct, in WebhooksController#publish_pull_request_event
we essentially "rename" the pull_request
part of the payload as issue
. So I added a simple flag in 77b26c3 to identify PRs again:
message = HashWithIndifferentAccess.new(
+ :pull_request => true,
:issue => payload[:pull_request],
...
This change just passed that value on through.
Looks good to me ing it |
Follow-up from #255
Fixes this: