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

Statuspage.io webhook integration #7911

Closed
wants to merge 1 commit into from

Conversation

Rishabh570
Copy link
Collaborator

@Rishabh570 Rishabh570 commented Dec 27, 2017

Fixes #5868 .

@MadElf1337
Copy link
Contributor

I'm doing the documentation, not coding

@Rishabh570
Copy link
Collaborator Author

Okay, cool !!!

@Rishabh570 Rishabh570 force-pushed the statuspage-webhook branch 4 times, most recently from 5d82ca5 to 0843f20 Compare January 7, 2018 11:03
@showell
Copy link
Contributor

showell commented Jan 7, 2018

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.

@Rishabh570
Copy link
Collaborator Author

Rishabh570 commented Jan 7, 2018

@showell That's not my commit message..my commit message is "integration: Statuspage.io webhook integration"

@Balaji2198
Copy link
Member

Balaji2198 commented Jan 7, 2018

Hi @Rishabh570. It will be better if your commit message looks like
integration: Add Statuspage.io webhook integration.
You can do that by git commit --amend.

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.

@Rishabh570: Thanks for working on this! Left a few comments! :)

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.

Copy link
Member

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!


1. What company needs to do:
Go to the **subscribers settings** in **notifications** tab and **enable** notifications delivery through **webhook**.

Copy link
Member

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

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

Copy link
Collaborator Author

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

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.

Copy link
Member

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

stream: str=REQ(default='statuspage-test'),
topic: str=REQ(default='Statuspage')) -> HttpResponse:

status = payload["page"]["status_description"]
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 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. :)

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)

Copy link
Member

Choose a reason for hiding this comment

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

Okay so:

  1. Split out each if clause into a separate function. See how our GCI webhook does this.
  2. Do not have a space before the :. So use Component status changed:. :)
  3. I think the topic should be the status_description and the name of the incident, which would mean that you would not need things like Incident Report: or Component status changed:.

@Rishabh570 Rishabh570 force-pushed the statuspage-webhook branch 3 times, most recently from 8844cfb to ffea6d3 Compare January 29, 2018 16:06
@Rishabh570
Copy link
Collaborator Author

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

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.

@Rishabh570: Hey, I left a couple of more comments! Thanks for working on this! :)


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

What company needs to do:
Copy link
Member

Choose a reason for hiding this comment

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

Delete this line. :)


What company needs to do:

Go to the **subscribers settings** in **notifications** tab and enable notifications delivery through **WEBHOOK**.
Copy link
Member

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 like Subscriber'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. :)

Copy link
Collaborator Author

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

@eeshangarg
Copy link
Member

@Rishabh570: Also your build is failing with some pep8 indentation issues! :)

@Rishabh570 Rishabh570 force-pushed the statuspage-webhook branch 2 times, most recently from e3989b0 to 2d9fc26 Compare January 31, 2018 18:25
@Rishabh570
Copy link
Collaborator Author

@eeshangarg Done changes here also :)

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.

@Rishabh570: Thanks so much for working on this! Left one final comment! :)

{!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
Copy link
Member

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

@Rishabh570
Copy link
Collaborator Author

@eeshangarg Done changes here...Please take a look :)

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.

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

@timabbott
Copy link
Sponsor Member

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

@timabbott timabbott closed this Feb 7, 2018
@Rishabh570 Rishabh570 deleted the statuspage-webhook branch March 10, 2018 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants