Skip to content

Commit

Permalink
integrations: Added honeybadger webhook.
Browse files Browse the repository at this point in the history
Honeybadger mintors web applications to report various events like
errors or deploymnet. Added support for 9 out of 10 events supported
by Honeybadger webhook integration. Tested the integration manually
on my dev env. Fixtures were captured using ngrok.
  • Loading branch information
Udit107710 committed Apr 21, 2020
1 parent 10d93ae commit a674da8
Show file tree
Hide file tree
Showing 18 changed files with 1,071 additions and 216 deletions.
Binary file added static/images/integrations/honeybadger/001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/images/integrations/logos/honeybadger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions zerver/lib/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def __init__(self, name: str, *args: Any, **kwargs: Any) -> None:
WebhookIntegration('helloworld', ['misc'], display_name='Hello World'),
WebhookIntegration('heroku', ['deployment'], display_name='Heroku'),
WebhookIntegration('homeassistant', ['misc'], display_name='Home Assistant'),
WebhookIntegration('honeybadger', ['monitoring'], display_name="Honeybadger"),
WebhookIntegration(
'ifttt',
['meta-integration'],
Expand Down
Empty file.
17 changes: 17 additions & 0 deletions zerver/webhooks/honeybadger/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Get Zulip notifications for your Honeybadger projects!

1. {!create-stream.md!}

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

1. Go to your honeybadger project's **settings** and select **Alert & Integrations**.

1. Select **WebHook Integration** option which should be present at the end of the page.

1. Select the various events you want to be notified about. Set the **Url** to the above constructed URL.

(Note: Currently **When project is deployed** option is not supported )

{!congrats.md!}

![](/static/images/integrations/honeybadger/001.png)
33 changes: 33 additions & 0 deletions zerver/webhooks/honeybadger/fixtures/assigned.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"event": "assigned",
"message": "[My Project/development] RuntimeError assigned to Joerge by Joerge",
"actor": {
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
},
"fault": {
"project_id": 69422,
"klass": "RuntimeError",
"component": "",
"action": "fail",
"environment": "development",
"resolved": false,
"ignored": false,
"created_at": "2020-03-10T13:46:32.205860Z",
"comments_count": 11,
"message": "This is a runtime error generated by the crywolf app.",
"notices_count": 18,
"last_notice_at": "2020-03-14T12:14:37.875451Z",
"tags": [],
"id": 61726306,
"assignee": "500062348@stu.upes.ac.in",
"url": "https://app.honeybadger.io/projects/69422/faults/61726306",
"deploy": null
},
"assignee": {
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
}
}
65 changes: 65 additions & 0 deletions zerver/webhooks/honeybadger/fixtures/check_in_missing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"event": "check_in_missing",
"message": "[My Project] MISSING: Sample Test hasn't checked in for 3 minutes",
"project": {
"id": 69422,
"name": "My Project",
"token": "5268bd40",
"created_at": "2020-03-10T13:45:15.294368Z",
"disable_public_links": false,
"pivotal_project_id": null,
"asana_workspace_id": null,
"github_project": null,
"environments": [
{
"id": 97171,
"project_id": 69422,
"name": "development",
"notifications": true,
"created_at": "2020-03-10T13:46:32.220499Z",
"updated_at": "2020-03-10T13:46:32.220499Z"
}
],
"owner": {
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
},
"last_notice_at": "2020-03-14T12:27:00.000000Z",
"earliest_notice_at": "2020-01-14T12:34:12.212844Z",
"unresolved_fault_count": 1,
"fault_count": 1,
"active": true,
"users": [
{
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
}
],
"sites": [
{
"id": "ff71a50d-dc88-448b-8a1b-97587d8c0fb9",
"active": true,
"last_checked_at": "2020-03-14T12:34:10.437813Z",
"name": "Resume Builder",
"state": "up",
"url": "https://resume-builder-v1.herokuapp.com/"
}
],
"team_id": null
},
"check_in": {
"state": "missing",
"schedule_type": "simple",
"reported_at": "2020-03-14T12:31:29.113825Z",
"expected_at": "2020-03-14T12:35:12.128944Z",
"missed_count": 1,
"grace_period": "1 minute",
"id": "wqIoL5",
"name": "Sample Test",
"url": "https://api.honeybadger.io/v1/check_in/wqIoL5",
"details_url": "https://app.honeybadger.io/projects/69422/check_ins",
"report_period": "1 minute"
}
}
65 changes: 65 additions & 0 deletions zerver/webhooks/honeybadger/fixtures/check_in_reporting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"event": "check_in_reporting",
"message": "[My Project] REPORTING: Sample Test is reporting again",
"project": {
"id": 69422,
"name": "My Project",
"token": "5268bd40",
"created_at": "2020-03-10T13:45:15.294368Z",
"disable_public_links": false,
"pivotal_project_id": null,
"asana_workspace_id": null,
"github_project": null,
"environments": [
{
"id": 97171,
"project_id": 69422,
"name": "development",
"notifications": true,
"created_at": "2020-03-10T13:46:32.220499Z",
"updated_at": "2020-03-10T13:46:32.220499Z"
}
],
"owner": {
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
},
"last_notice_at": "2020-03-14T12:27:00.000000Z",
"earliest_notice_at": "2020-01-14T12:34:58.611135Z",
"unresolved_fault_count": 1,
"fault_count": 1,
"active": true,
"users": [
{
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
}
],
"sites": [
{
"id": "ff71a50d-dc88-448b-8a1b-97587d8c0fb9",
"active": true,
"last_checked_at": "2020-03-14T12:34:10.437813Z",
"name": "Resume Builder",
"state": "up",
"url": "https://resume-builder-v1.herokuapp.com/"
}
],
"team_id": null
},
"check_in": {
"state": "reporting",
"schedule_type": "simple",
"reported_at": "2020-03-14T12:34:58.503611Z",
"expected_at": "2020-03-14T12:35:58.503611Z",
"missed_count": 0,
"grace_period": "1 minute",
"id": "wqIoL5",
"name": "Sample Test",
"url": "https://api.honeybadger.io/v1/check_in/wqIoL5",
"details_url": "https://app.honeybadger.io/projects/69422/check_ins",
"report_period": "1 minute"
}
}
57 changes: 0 additions & 57 deletions zerver/webhooks/honeybadger/fixtures/checkin.json

This file was deleted.

38 changes: 38 additions & 0 deletions zerver/webhooks/honeybadger/fixtures/commented.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"event": "commented",
"message": "[My Project/production] Joerge commented on RuntimeError: \"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate ...",
"actor": {
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
},
"fault": {
"project_id": 69422,
"klass": "RuntimeError",
"component": "",
"action": "fail",
"environment": "production",
"resolved": true,
"ignored": false,
"created_at": "2020-03-14T13:40:32.025475Z",
"comments_count": 2,
"message": "This is a runtime error generated by the crywolf app.",
"notices_count": 1,
"last_notice_at": "2020-03-14T13:40:32.015894Z",
"tags": [],
"id": 61859041,
"assignee": null,
"url": "https://app.honeybadger.io/projects/69422/faults/61859041",
"deploy": null
},
"comment": {
"id": 10957852,
"fault_id": 61859041,
"event": null,
"source": "web",
"created_at": "2020-03-15T11:22:25.227373Z",
"email": null,
"author": "Joerge",
"body": "\"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.\"\r\nThe standard Lorem Ipsum passage, used since the 1500s\r\n\r\n\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\"\r\nSection 1.10.32 of \"de Finibus Bonorum et Malorum\", written by Cicero in 45 BC\r\n\r\n\"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\""
}
}
81 changes: 81 additions & 0 deletions zerver/webhooks/honeybadger/fixtures/downtime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"event": "down",
"message": "[My Project] Resume Builder is down.",
"project": {
"id": 69422,
"name": "My Project",
"token": "5268bd40",
"created_at": "2020-03-10T13:45:15.294368Z",
"disable_public_links": false,
"pivotal_project_id": null,
"asana_workspace_id": null,
"github_project": null,
"environments": [
{
"id": 97171,
"project_id": 69422,
"name": "development",
"notifications": true,
"created_at": "2020-03-10T13:46:32.220499Z",
"updated_at": "2020-03-10T13:46:32.220499Z"
}
],
"owner": {
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
},
"last_notice_at": "2020-03-14T12:14:37.000000Z",
"earliest_notice_at": "2020-01-14T12:24:34.262799Z",
"unresolved_fault_count": 0,
"fault_count": 1,
"active": true,
"users": [
{
"id": 74968,
"email": "500062348@stu.upes.ac.in",
"name": "Joerge"
}
],
"sites": [
{
"id": "ff71a50d-dc88-448b-8a1b-97587d8c0fb9",
"active": true,
"last_checked_at": "2020-03-14T12:24:34.170301Z",
"name": "Resume Builder",
"state": "down",
"url": "https://resume-builder-v1.herokuapp.com/"
}
],
"team_id": null
},
"site": {
"id": "ff71a50d-dc88-448b-8a1b-97587d8c0fb9",
"name": "Resume Builder",
"url": "https://resume-builder-v1.herokuapp.com/",
"frequency": 1,
"match_type": "success",
"match": null,
"state": "down",
"active": true,
"last_checked_at": "2020-03-14T12:24:34.170301Z",
"retries": 3,
"proxy": 0,
"details_url": "https://app.honeybadger.io/projects/69422/sites/ff71a50d-dc88-448b-8a1b-97587d8c0fb9"
},
"outage": {
"down_at": "2020-03-14T12:24:34.153649Z",
"up_at": null,
"status": 503,
"reason": "Expected 2xx status code -- got 503",
"headers": {
"date": "Sat, 14 Mar 2020 12:24:33 GMT",
"server": "Cowboy",
"connection": "close",
"content-type": "text/html; charset=utf-8",
"cache-control": "no-cache, no-store",
"content-length": "511"
},
"details_url": "https://app.honeybadger.io/projects/69422/sites/ff71a50d-dc88-448b-8a1b-97587d8c0fb9"
}
}
Loading

0 comments on commit a674da8

Please sign in to comment.