-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
webhooks: Create Honeybadger Integration. #8066
webhooks: Create Honeybadger Integration. #8066
Conversation
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.
@ViRu-ThE-ViRuS: This looks good! A couple of comments:
- Add an empty
doc.md
file. - Add a logo file (the missing logo is the reason the build is failing).
Make sure you run ./tools/test-all
before you submit a PR or push to it. If you do that, you'll find that you can discover most errors before someone reviews your PR! :) Thanks!
I usually do that. Its just that the last PR I made for Webhooks (Intercom), someone commented that I should remove the empty doc file and the logo as they are part of another task [Link]. Nevermind... I will do as you suggest here and notify. :-) |
cfb0b25
to
5420e6d
Compare
@ViRu-ThE-ViRuS: Yeah, so the reason Robert said that is because you have to write the contents of the |
5420e6d
to
ac7911f
Compare
@ViRu-ThE-ViRuS: This looks good to me! So I am approving this on GCI! I would recommend claiming the documentation task next and write the contents of the |
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.
Oops forgot to approve the changes! :)
GCI Task for documentation. |
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.
@ViRu-ThE-ViRuS: This looks good! I left one comment I'd like you to address! Thanks! :)
4. Test the webhook by clicking `Test This Integration`. | ||
|
||
5. Click `Save changes` to create the 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.
@ViRu-ThE-ViRuS: This looks great! But you are supposed to have have screenshots for the various steps to make it more clear as to where the user is supposed to go/click, etc. I would recommend looking at how the other integrations are documented and adding similar screenshots for Honeybadger. Thanks! :)
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.
Added some screenshots (but no so many that they become distracting)!
7ae6a64
to
b57e549
Compare
b57e549
to
091a9a5
Compare
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.
Almost ready @ViRu-ThE-ViRuS! Left two comments. Additionally, I think there are too many screenshots. Instead of having one for every instructions, it's better to go with 1-2 screenshots at most, e.g. one for the beginning and one for the end.
zerver/webhooks/honeybadger/doc.md
Outdated
the triggers for the webhook. | ||
![](/static/images/integrations/honeybadger/004.png) | ||
|
||
4. Test the webhook by clicking `Test This Integration`. |
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.
Screenshots shouldn't display any private tokens - even if you are fine with sharing them publicly. You could blur the key in this image, but I recommend removing it completely, as it is not crucial for the process and there already are several other screenshots.
zerver/webhooks/honeybadger/doc.md
Outdated
|
||
{!create-bot-construct-url.md!} | ||
|
||
Honeybadger will use the `Honeybadger` stream by default if no stream is given |
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.
We recommend lower case stream names, and the introductory section of this integration doc recommends the stream name "honeybadger". Can you change "Honeybadger" to "honeybadger" here and for the stream name in your first commit?
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.
sure
091a9a5
to
3204941
Compare
This is a minor nitpick but should we use just the bolt (https://www.honeybadger.io/assets/) as the logo without the "Honeybadger.io" text? That seems to go inline with the logos from the other integrations (https://chat.zulip.org/integrations/) |
zerver/webhooks/honeybadger/doc.md
Outdated
|
||
**Follow these steps:** | ||
|
||
1. Go to `Alerts & Integrations` page of your `Honeybadger` Console. |
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 step was a bit hard to follow for me. Something like "Go to the Alerts & Integrations
page in the project settings" or however you would like to put it, would be better I think.
zerver/webhooks/honeybadger/doc.md
Outdated
the triggers for the webhook. | ||
![](/static/images/integrations/honeybadger/003.png) | ||
|
||
4. Test the webhook by clicking `Test This Integration`. |
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.
How about "Test the webhook by clicking on the Test This Integration
button at the bottom of the page".
Makes it a bit easier to find I think
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.
will do
e484937
to
de52e5e
Compare
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.
LGTM. Ready for merging if Travis build succeeds.
de52e5e
to
ba5445b
Compare
Sorry for the late update. Build seems to pass now. Can someone give a final review? |
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.
@ViRu-ThE-ViRuS: Left a few more comments! This is mostly good to go! Also,
- Squash the two commits into one please and make the commit message
webhooks: Create Honeybadger integration.
. - After you address my feedback, please generate a new screenshot for the sample message!
Thanks for working on this! :)
zerver/webhooks/honeybadger/view.py
Outdated
def api_honeybadger_webhook(request: HttpRequest, user_profile: UserProfile, | ||
payload: Dict[str, Any] = REQ(argument_type='body'), | ||
stream: Text = REQ(default='honeybadger')) -> HttpResponse: | ||
body = '**{}**: {}'.format(payload['event'], payload['message']) |
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 don't think the message needs to have the **up**:
, since the event type is already in the topic of the message. :)
body += '\n**Message**: {}\n**Site**: [{}]({})'.format(payload['fault']['message'], | ||
payload['project']['name'], | ||
payload['fault']['url']) | ||
|
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 would have the topic include the <event_type>: <site>
. :)
zerver/webhooks/honeybadger/view.py
Outdated
def api_honeybadger_webhook(request: HttpRequest, user_profile: UserProfile, | ||
payload: Dict[str, Any] = REQ(argument_type='body'), | ||
stream: Text = REQ(default='honeybadger')) -> HttpResponse: | ||
body = '**{}**: {}'.format(payload['event'], payload['message']) |
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.
Also, maybe surround payload['message']
by a quoteblock, since it looks like a Traceback.
zerver/webhooks/honeybadger/view.py
Outdated
body += '\n**Site**: [{}]({})'.format(payload['site']['name'], payload['site']['url']) | ||
|
||
elif payload['event'] == 'occurred': | ||
body += '\n**Message**: {}\n**Site**: [{}]({})'.format(payload['fault']['message'], |
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 don't think you need **Message**:
before the message. :)
ba5445b
to
93e0000
Compare
@eeshangarg Changes made. |
93e0000
to
0513fe7
Compare
0513fe7
to
b05d5a0
Compare
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.
@ViRu-ThE-ViRuS: A couple of more final comments, mostly about code style! Thanks for bearing with me through multiple rounds of feedback! Looking forward to seeing this get merged! :)
payload['fault']['url']) | ||
|
||
check_send_stream_message(user_profile, request.client, stream, | ||
'{}: {}'.format(payload['event'], payload['project']['name']), body) |
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.
@ViRu-ThE-ViRuS: This section is a bit confusing. I would suggest doing something like:
topic = '{}: {}'.format(payload['event'], payload['project']['name'])
check_send_stream_message(user_profile, request.client, stream,
topic, body)
Do that for all of the code in thie file! :)
body = '**{}**'.format(payload['message']) | ||
|
||
if payload['event'] == 'check_in_missing': | ||
reported_at = datetime.strptime(payload['check_in']['reported_at'], "%Y-%m-%dT%H:%M:%S.%fZ") \ |
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.
Also, could you please wrap this code at 80 characters per line? And I would suggest avoiding breaking up function calls over multiple lines with a \
, like you do with .strftime()
. :)
@ViRu-ThE-ViRuS are you planning to finish this? You haven't replied to @eeshangarg's comments in a month. |
@ViRu-ThE-ViRuS thanks for the initial work on this. |
GCI TASK