-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: Split email notifications and webhook notifications into separate howtos #10396
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
Merged
benjaoming
merged 8 commits into
readthedocs:main
from
benjaoming:docs/split-howto-notifications-webhooks
Jun 9, 2023
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
20c7e66
Split email notifications and webhook notifications into separate howtos
benjaoming 5ddd445
Updates re: review @ericholscher
benjaoming fea3fc6
More review feedback addressed
benjaoming e60ca66
Update several parts of copy to adapt to the split
benjaoming 33b3b9c
Dot the i's
benjaoming 8df4c44
Adds a note about PR notifications being skipped
benjaoming 1454899
prefer "documentation builds"
benjaoming 3368ed9
Trim out a seealso to give the other two more prominence
benjaoming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
How to setup email notifications | ||
================================ | ||
|
||
In this guide, | ||
you can learn how to setup a simple build notification via email. | ||
|
||
Read the Docs allows you to configure emails that will be notified on failing builds. | ||
This makes sure that you are aware of failures happening in an otherwise automated process. | ||
|
||
.. seealso:: | ||
|
||
:doc:`/guides/build/webhooks` | ||
How to use webhooks to be notified about builds on popular platforms like Slack and Discord. | ||
|
||
:doc:`/pull-requests` | ||
Similarly to email notifications, | ||
you can also configure automated feedback for your pull requests. | ||
|
||
|
||
Email notifications | ||
------------------- | ||
|
||
Take these steps to enable build notifications using email: | ||
|
||
* Go to :menuselection:`Admin --> Notifications` in your project. | ||
* Fill in the **Email** field under the **New Email Notifications** heading | ||
* Press :guilabel:`Add` and the email is saved and will be displayed in the list of **Existing notifications**. | ||
|
||
A newly added email will be notified once a build fails. | ||
|
||
|
||
.. note:: | ||
|
||
We don't send email notifications on :doc:`builds from pull requests </pull-requests>`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,17 @@ | ||
How to setup build notifications and webhooks | ||
============================================= | ||
How to setup webhook notifications | ||
================================== | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we should be systematic about calling the feature "build status webhooks" since that's how it is right now. If we're gonna do anything more drastic, I think it should include the Dashboard terminology, so I would just save that for later.. |
||
|
||
In this guide, you can learn how to setup a number of build notification mechanisms. | ||
In this guide, you can learn how to setup build notification with webhooks. | ||
Build notifications can alert you when your builds fail so you can take immediate action. | ||
|
||
.. note:: | ||
|
||
Currently we don't send notifications or trigger :term:`webhooks <webhook>` | ||
on :doc:`builds from pull requests </pull-requests>`. | ||
.. seealso:: | ||
|
||
:doc:`/guides/build/email-notifications` | ||
How to setup a basic email notification for build failures. | ||
|
||
.. tip:: | ||
:doc:`/pull-requests` | ||
Similarly to build notifications, you can also configure automated feedback for your pull requests. | ||
|
||
|
||
.. contents:: Contents | ||
:local: | ||
|
||
|
||
Email notifications | ||
------------------- | ||
|
||
Read the Docs allows you to configure emails that can be sent on failing builds. | ||
This makes sure you know when your builds have failed. | ||
|
||
Take these steps to enable build notifications using email: | ||
|
||
* Go to :guilabel:`Admin` > :guilabel:`Notifications` in your project. | ||
* Fill in the **Email** field under the **New Email Notifications** heading | ||
* Submit the form | ||
|
||
You should now get notified by email when your builds fail! | ||
Similarly to email notifications, | ||
you can also configure automated feedback for your pull requests. | ||
|
||
Build status webhooks | ||
--------------------- | ||
|
@@ -40,7 +20,7 @@ Read the Docs can also send webhooks when builds are triggered, successful or fa | |
|
||
Take these steps to enable build notifications using a webhook: | ||
|
||
* Go to :guilabel:`Admin` > :guilabel:`Webhooks` in your project. | ||
* Go to :menuselection:`Admin --> Webhooks` in your project. | ||
* Fill in the **URL** field and select what events will trigger the webhook | ||
* Modify the payload or leave the default (see below) | ||
* Click on :guilabel:`Save` | ||
|
@@ -79,6 +59,11 @@ you will see the server response, the webhook request, and the payload. | |
|
||
Activity of a webhook | ||
|
||
.. note:: | ||
|
||
We don't trigger :term:`webhooks <webhook>` on :doc:`builds from pull requests </pull-requests>`. | ||
|
||
|
||
Custom payload examples | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
@@ -93,81 +78,81 @@ and in the following section you will find all the available variables. | |
|
||
Custom payload | ||
|
||
Slack | ||
+++++ | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#db3238", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Read the Docs build failed*" | ||
.. tabs:: | ||
|
||
.. tab:: Slack | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#db3238", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Read the Docs build failed*" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*: <{{ project.url }}|{{ project.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Version*: {{ version.name }} ({{ build.commit }})" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Build*: <{{ build.url }}|{{ build.id }}>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*: <{{ project.url }}|{{ project.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Version*: {{ version.name }} ({{ build.commit }})" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Build*: <{{ build.url }}|{{ build.id }}>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
More information on `the Slack Incoming Webhooks documentation <https://api.slack.com/messaging/webhooks>`_. | ||
|
||
Discord | ||
+++++++ | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"username": "Read the Docs", | ||
"content": "Read the Docs build failed", | ||
"embeds": [ | ||
{ | ||
"title": "Build logs", | ||
"url": "{{ build.url }}", | ||
"color": 15258703, | ||
"fields": [ | ||
{ | ||
"name": "*Project*", | ||
"value": "{{ project.url }}", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Version*", | ||
"value": "{{ version.name }} ({{ build.commit }})", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Build*", | ||
"value": "{{ build.url }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
More information on `the Slack Incoming Webhooks documentation <https://api.slack.com/messaging/webhooks>`_. | ||
|
||
.. tab:: Discord | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"username": "Read the Docs", | ||
"content": "Read the Docs build failed", | ||
"embeds": [ | ||
{ | ||
"title": "Build logs", | ||
"url": "{{ build.url }}", | ||
"color": 15258703, | ||
"fields": [ | ||
{ | ||
"name": "*Project*", | ||
"value": "{{ project.url }}", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Version*", | ||
"value": "{{ version.name }} ({{ build.commit }})", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Build*", | ||
"value": "{{ build.url }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
More information on `the Discord webhooks documentation <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>`_. | ||
More information on `the Discord webhooks documentation <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>`_. | ||
|
||
Variable substitutions reference | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
@@ -213,7 +198,7 @@ Variable substitutions reference | |
Version name. | ||
|
||
Validating the payload | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
---------------------- | ||
|
||
After you add a new webhook, Read the Docs will generate a secret key for it | ||
and uses it to generate a hash signature (HMAC-SHA256) for each payload | ||
|
@@ -255,7 +240,7 @@ like this: | |
) | ||
|
||
Legacy webhooks | ||
~~~~~~~~~~~~~~~ | ||
--------------- | ||
|
||
Webhooks created before the custom payloads functionality was added to Read the Docs | ||
send a payload with the following structure: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
@ericholscher
re: naming is hard
I changed the feature page to have this title instead. I think it's clearer than the previous one.
I think we should try to use:
Oh yes, and of course we also say "build status webhooks" 🙃 Not on the website, it just says "webhooks" :)
We could remove "build status webhooks" and say "build notifications via webhooks" or "notification webhooks". It's not any big thing, though, anything containing the word "webhook" is bound to be a bit technical :)