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

integrations: added honeybadger webhook #14281

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
integrations: Added honeybadger webhook.
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
commit 674d61195d3ebb639c24b0599fa7817b7dd948cb
91 changes: 91 additions & 0 deletions static/generated/github-contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"contrib": [{
"name": "eeshangarg",
"python-zulip-api": 57,
"server": 179,
"avatar": "https://avatars0.githubusercontent.com/u/7251823?v=4"
}, {
"name": "borisyankov",
"mobile": 613,
"avatar": "https://avatars3.githubusercontent.com/u/867242?v=4"
}, {
"name": "geeeeeeeeek",
"avatar": "https://avatars1.githubusercontent.com/u/7262715?v=4",
"desktop": 170
}, {
"name": "showell",
"python-zulip-api": 16,
"server": 1620,
"avatar": "https://avatars2.githubusercontent.com/u/142908?v=4"
}, {
"name": "rishig",
"python-zulip-api": 3,
"zulipbot": 2,
"avatar": "https://avatars2.githubusercontent.com/u/890911?v=4",
"server": 649
}, {
"name": "hackerkid",
"server": 526,
"avatar": "https://avatars1.githubusercontent.com/u/7190633?v=4",
"desktop": 1
}, {
"name": "TomaszKolek",
"python-zulip-api": 2,
"mobile": 4,
"server": 60,
"avatar": "https://avatars3.githubusercontent.com/u/5993758?v=4"
}, {
"name": "umairwaheed",
"python-zulip-api": 1,
"server": 661,
"avatar": "https://avatars1.githubusercontent.com/u/641763?v=4"
}, {
"name": "timabbott",
"python-zulip-api": 520,
"server": 6094,
"avatar": "https://avatars0.githubusercontent.com/u/2746074?v=4",
"desktop": 2
}, {
"name": "brockwhittaker",
"mobile": 3,
"server": 643,
"avatar": "https://avatars0.githubusercontent.com/u/10321399?v=4",
"desktop": 3
}, {
"name": "akashnimare",
"server": 10,
"avatar": "https://avatars0.githubusercontent.com/u/2263909?v=4",
"desktop": 489
}, {
"name": "zbenjamin",
"python-zulip-api": 91,
"server": 1103,
"avatar": "https://avatars3.githubusercontent.com/u/58684?v=4"
}, {
"name": "gnprice",
"python-zulip-api": 1,
"server": 241,
"avatar": "https://avatars1.githubusercontent.com/u/28173?v=4",
"desktop": 4
}, {
"name": "synicalsyntax",
"avatar": "https://avatars0.githubusercontent.com/u/15116870?v=4",
"zulipbot": 277,
"desktop": 2,
"server": 334,
"mobile": 1
}, {
"name": "lonerz",
"python-zulip-api": 3,
"avatar": "https://avatars1.githubusercontent.com/u/12992571?v=4",
"zulipbot": 36,
"desktop": 2,
"server": 109
}, {
"name": "lfaraone",
"python-zulip-api": 22,
"server": 426,
"avatar": "https://avatars2.githubusercontent.com/u/73410?v=4"
}],
"date": "2017-11-20"
}
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?\""
}
}
Loading