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
Statuspage.io webhook integration #7911
Conversation
ef57752
to
e758c56
Compare
I'm doing the documentation, not coding |
e758c56
to
90748a9
Compare
Okay, cool !!! |
5d82ca5
to
0843f20
Compare
I did a quick skim, but not a complete review. Overall things seem reasonable. Can you put the world "Add" in your commit message, after the "integration: " prefix? We like verbs in the commit message. |
@showell That's not my commit message..my commit message is "integration: Statuspage.io webhook integration" |
Hi @Rishabh570. It will be better if your commit message looks like |
4571dd5
to
a0b1700
Compare
a0b1700
to
7e78e93
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.
@Rishabh570: Thanks for working on this! Left a few comments! :)
zerver/webhooks/statuspage/doc.md
Outdated
Get notifications from Statuspage.io in Zulip whenever any | ||
company that you subscribed to creates or updates an incident, or updates a component's | ||
status. | ||
|
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.
Replace the above with:
Get Zulip notifications for your Statuspage.io subscriptions!
zerver/webhooks/statuspage/doc.md
Outdated
|
||
1. What company needs to do: | ||
Go to the **subscribers settings** in **notifications** tab and **enable** notifications delivery through **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.
Okay, I am not sure what you mean by this step. For instance is **enable**
something users click on or is it **webhook**
that they are supposed to click on! I would recommend being more explicit here and making sure you get capitalisation for the buttons' text right! :)
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.
@eeshangarg This setting is something company needs to set up as how they want notifications to be sent to their users (like by email, webhooks or sms)...company must select this if they want to send webhook notifications to their users...
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.
Here is the screenshot of that setting : https://github.com/Rishabh570/zulip/blob/statuspage-webhook/static/images/integrations/statuspage/001.png
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.
@Rishabh570: I see that, what I meant was that you don't need to bold things like **enable**
unless they are actual physical sections or buttons on the website. And you need to make sure that stuff like **webhook**
(which is an actual button in the screenshot) is properly capitalised. So, in this case, it would be **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.
Ooh okay ! I'll change this..
zerver/webhooks/statuspage/doc.md
Outdated
2. What users need to do: | ||
Go to the company's statuspage.io site(which is example.statuspage.io) and click **SUBSCRIBE TO UPDATES** button and | ||
provide there the Webhook 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.
Okay, so replace the above point with this:
In order to subscribe to a company's Statuspage.io notifications:
1. Go to the company's Statuspage.io site (for instance, `example.statuspage.io`).
2. Enter the webhook URL constructed above in the **Target Webhook** field.
2. Click on **SUBSCRIBE TO UPDATES**.
For future reference, with instructions such as these, try to make sure that they are in the correct order. For example, you can't click on SUBSCRIBE TO UPDATES without providing the webhook URL first, etc. :)
zerver/webhooks/statuspage/view.py
Outdated
stream: str=REQ(default='statuspage-test'), | ||
topic: str=REQ(default='Statuspage')) -> HttpResponse: | ||
|
||
status = payload["page"]["status_description"] |
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 recommend using payload["page"]["status_indicator"]
. Relying on the description to figure out what kind of event a payload corresponds to can be wrong. Descriptions can be anything and can change. :)
zerver/webhooks/statuspage/view.py
Outdated
new_status = payload["component_update"]["new_status"] | ||
body = u"Component status changed :\n **{}** has changed status from **{}** to **{}**" | ||
body = body.format(name, old_status, new_status) | ||
|
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.
Okay so:
- Split out each
if
clause into a separate function. See how our GCI webhook does this. - Do not have a space before the
:
. So useComponent status changed:
. :) - I think the topic should be the
status_description
and thename
of the incident, which would mean that you would not need things likeIncident Report:
orComponent status changed:
.
8844cfb
to
ffea6d3
Compare
@eeshangarg Sorry for delay...had a vagrant issue. I would like you to take a look at view.py (created functions and called them inside if else). Thanx for reviewing btw :) |
ffea6d3
to
4bb0df3
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.
@Rishabh570: Hey, I left a couple of more comments! Thanks for working on this! :)
zerver/webhooks/statuspage/doc.md
Outdated
|
||
{!create-bot-construct-url.md!} | ||
|
||
What company needs to do: |
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.
Delete this line. :)
zerver/webhooks/statuspage/doc.md
Outdated
|
||
What company needs to do: | ||
|
||
Go to the **subscribers settings** in **notifications** tab and enable notifications delivery through **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.
Okay so a couple of points about this one:
- Is
subscribers settings
an option on the third party website? If so, shouldn't it be capitalised likeSubscriber's Settings
? If not, then you do not need to bold the text. :) - Change it like this:
If you're a company and you'd like to enable webhook notifications, go to the ....
and so on. :)
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.
Subscriber's settings are for company... I guess Subscriber's Settings
would be good because it is present in the Notification settings dashboard...
@Rishabh570: Also your build is failing with some |
e3989b0
to
2d9fc26
Compare
@eeshangarg Done changes here also :) |
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.
@Rishabh570: Thanks so much for working on this! Left one final comment! :)
zerver/webhooks/statuspage/doc.md
Outdated
{!create-bot-construct-url.md!} | ||
|
||
If you're a company and you'd like to enable webhook notifications, | ||
go to the **Subscriber's Settings** in **Notifications** tab and enable |
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.
Replace **Subscriber's Settings**
with just **Settings**
, your screenshot doesn't say Subscriber's Settings
, it says only Settings
2d9fc26
to
f21f3d2
Compare
@eeshangarg Done changes here...Please take a look :) |
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.
@Rishabh570: Thanks for working on this and bearing with me through so many rounds of feedback! This looks good to me! :)
@timabbott: This LGTM! Could you please take one final look and merge? Thanks! :)
Merged, thanks @Rishabh570 and @eeshangarg! I made a small tweak to the documentation text when merging to make it a bit more clear what the difference was between the two ways to setup notifications on the statuspage.io site (depending whether it's your own product's status page). It may be worth further work to make it even clearer (e.g. using bold or headings or something). |
Fixes #5868 .