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

webhooks: Create Honeybadger Integration. #8066

Conversation

ViRu-ThE-ViRuS
Copy link
Contributor

Copy link
Member

@eeshangarg eeshangarg left a 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!

@ViRu-ThE-ViRuS
Copy link
Contributor Author

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. :-)

@eeshangarg
Copy link
Member

@ViRu-ThE-ViRuS: Yeah, so the reason Robert said that is because you have to write the contents of the doc.md file as part of another task. But you have to add en empty one to make sure that the build doesn't fail because it can't find a doc.md file. After you do that, you can then claim the documentation task and then write the doc.md file! :)

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from 5420e6d to ac7911f Compare January 12, 2018 18:06
@eeshangarg
Copy link
Member

@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 doc.md file! Thanks! :)

Copy link
Member

@eeshangarg eeshangarg left a 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! :)

@ViRu-ThE-ViRuS
Copy link
Contributor Author

ViRu-ThE-ViRuS commented Jan 13, 2018

GCI Task for documentation.

Copy link
Member

@eeshangarg eeshangarg left a 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.

Copy link
Member

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! :)

Copy link
Contributor Author

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)!

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from 7ae6a64 to b57e549 Compare January 14, 2018 08:09
@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from b57e549 to 091a9a5 Compare January 14, 2018 08:11
Copy link
Contributor

@roberthoenig roberthoenig left a 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.

the triggers for the webhook.
![](/static/images/integrations/honeybadger/004.png)

4. Test the webhook by clicking `Test This Integration`.
Copy link
Contributor

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.


{!create-bot-construct-url.md!}

Honeybadger will use the `Honeybadger` stream by default if no stream is given
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from 091a9a5 to 3204941 Compare January 14, 2018 12:52
@sampritipanda
Copy link
Member

sampritipanda commented Jan 14, 2018

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/)


**Follow these steps:**

1. Go to `Alerts & Integrations` page of your `Honeybadger` Console.
Copy link
Member

@sampritipanda sampritipanda Jan 14, 2018

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.

the triggers for the webhook.
![](/static/images/integrations/honeybadger/003.png)

4. Test the webhook by clicking `Test This Integration`.
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch 2 times, most recently from e484937 to de52e5e Compare January 15, 2018 10:18
Copy link
Member

@aero31aero aero31aero left a 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.

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from de52e5e to ba5445b Compare January 22, 2018 10:55
@ViRu-ThE-ViRuS
Copy link
Contributor Author

ViRu-ThE-ViRuS commented Jan 22, 2018

Sorry for the late update. Build seems to pass now. Can someone give a final review?

Copy link
Member

@eeshangarg eeshangarg left a 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! :)

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'])
Copy link
Member

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'])

Copy link
Member

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>. :)

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'])
Copy link
Member

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.

body += '\n**Site**: [{}]({})'.format(payload['site']['name'], payload['site']['url'])

elif payload['event'] == 'occurred':
body += '\n**Message**: {}\n**Site**: [{}]({})'.format(payload['fault']['message'],
Copy link
Member

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. :)

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from ba5445b to 93e0000 Compare January 26, 2018 12:06
@zulipbot zulipbot added size: XL and removed size: L labels Jan 26, 2018
@ViRu-ThE-ViRuS
Copy link
Contributor Author

@eeshangarg Changes made.

@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from 93e0000 to 0513fe7 Compare January 26, 2018 12:14
@ViRu-ThE-ViRuS ViRu-ThE-ViRuS force-pushed the honeybadger_integration_code branch from 0513fe7 to b05d5a0 Compare January 26, 2018 12:31
Copy link
Member

@eeshangarg eeshangarg left a 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)
Copy link
Member

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") \
Copy link
Member

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(). :)

@timabbott
Copy link
Member

@ViRu-ThE-ViRuS are you planning to finish this? You haven't replied to @eeshangarg's comments in a month.

@punchagan
Copy link
Member

@ViRu-ThE-ViRuS thanks for the initial work on this.
#14281 adds a more complete integration.

@punchagan punchagan closed this Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants