22
33I'm open to feature suggestions and happy to review code contributions.
44If you are planning to contribute something larger than a small, straightforward
5- bugfix, please open an issue so we can discuss it first. Otherwise you are risking a
5+ bugfix, please open an issue so we can discuss it first. Otherwise you are risking a
66"no" or a "yes, but let's do it differently" to an already implemented feature.
77
8+ ## AI Policy
9+
10+ I do not accept content generated or touched up by AI tools. Do not
11+ submit pull requests or issues produced with the help of LLMs or code generation
12+ assistants, they will be closed with no discussion. Do not write emails
13+ generated or rewritten by LLMs, they will be marked as spam.
14+
815## Code Style
916
10- * Format your Python code with [ black ] ( https://black.readthedocs.io/en/stable / ) .
17+ * Format your Python code with [ ruff ] ( https://docs.astral.sh/ruff / ) .
1118* Prefer simplicity over cleverness.
12- * If you are fixing a bug or adding a feature, add a test. Run tests before
19+ * If you are fixing a bug or adding a feature, add a test. Run tests before
1320 submitting pull requests.
1421
1522## Adding Documentation
1623
17- This project uses the Markdown format for documentation. Use the ` render_docs `
24+ This project uses the Markdown format for documentation. Use the ` render_docs `
1825management command to generate the HTML version of the documentation. To add a new
1926documentation page:
2027
21281 . Create the appropriate .md file under ` templates/docs `
22- 2 . Generate the HTML version with ` ./manage.py render_docs `
29+ 2 . Generate the HTML version with ` ./manage.py render_docs `
23303 . Add the page to the navigation in ` /templates/front/docs_single.html `
2431
2532## Developing a New Integration
@@ -41,20 +48,23 @@ The best way to build a new integration is to pick a similar existing integratio
4148as a starting point for the new integration and replicate every aspect of it.
4249You will need to make changes in the following files:
4350
44- * Add a new class in ` /hc/api/transports.py ` .
45- * Add a new notification template in ` /templates/integrations/ ` .
46- * Write testcases for the new transport class in ` /hc/api/tests/test_notify_<kind>.py ` .
47- * Update ` CHANNEL_KINDS ` in ` /hc/api/models.py ` .
48- * Update ` Channel.transport() ` in ` /hc/api/models.py ` .
49- * Create a view for provisioning the new integration in ` /hc/front/views.py ` .
50- * Write a HTML template for the new view in ` /templates/front/add_<kind>.py ` , and
51- prepare any supporting illustrations in ` /static/img/integrations/ ` .
52- * Add a route for the new view in ` /hc/front/urls.py ` .
53- * Write testcases for the new view in ` /hc/font/tests/test_add_<kind>.py ` .
51+ * In ` /hc/integrations/ ` , copy an existing integration to a new directory
52+ * Edit the transport class in ` /hc/integrations/<kind>/transport.py ` .
53+ * Edit the notification template(s) in ` /hc/integrations/<kind>/templates/ ` .
54+ * Write testcases for the transport class in
55+ ` /hc/integrations/<kind>/tests/test_notify.py ` .
56+ * Update ` TRANSPORTS ` in ` /hc/api/models.py ` .
57+ * Edit the view(s) for provisioning the integration in
58+ ` /hc/integrations/<kind>/views.py ` .
59+ * Write a HTML template for the new view in
60+ ` /hc/integrations/<kind>/templates/</add_<kind>.py ` , and prepare any supporting
61+ illustrations in ` /hc/integrations/<kind>/static/img/ ` .
62+ * Edit routes for the new view(s) in ` /hc/integrations/<kind>/urls.py ` .
63+ * Include the new integration's urls.py in ` /hc/urls.py `
64+ * Write testcases for the new view in ` /hc/integrations/<kind>/tests/test_add.py ` .
5465* Update ` /templates/front/channels.html ` – add a new section in the list of available
5566 integrations, make sure an existing integration is displayed nicely.
5667* Update ` /templates/front/event_summary.html ` to make sure notifications sent to the
5768 new integration are displayed nicely.
58- * Add a logo in ` /static/img/integrations / ` .
69+ * Add a logo in ` /hc/integrations/<kind> static/img/ ` .
5970* Update the icon font (it's a little tricky to do, I can take care of that).
60-
0 commit comments