53 Commits

Author SHA1 Message Date
Klaas van Schelven
2ac297c012 Slack alerts: issue title in message title
Fix #283
2025-11-26 10:35:26 +01:00
Klaas van Schelven
1ecd03634c Note about Discord & channels
See #281
2025-11-26 10:20:53 +01:00
Klaas van Schelven
e6096a0472 Note about Slack & channels
See #281
2025-11-26 10:06:35 +01:00
Klaas van Schelven
164a1b5c5c Channel support for Mattermost
based on the work in 62fdfb7623, tested for both channels and users

Fix #281
2025-11-26 09:48:40 +01:00
Klaas van Schelven
2a90d6ab1e Message service backend setup: switch config form per-service in the UI
See #281, which this commit prepares for
2025-11-26 09:10:14 +01:00
Klaas van Schelven
4e71f4f04c Discord alert backend: send 'valid' URLs only
Fix #280
2025-11-25 21:26:41 +01:00
Klaas van Schelven
e35f10b5d4 Formatting (no behavior change)
Facilitate visual comparison with the 'reference impl' (slack).
The service backends do heavy copy/pasting, good to keep the beast
in check by at least limiting the changes to the bits that actually
diverge
2025-11-25 13:08:31 +01:00
neverabsolute
c8792e5c84 Add Discord backend support to MessagingServiceConfig and related tests
Fix #121
2025-11-25 13:08:22 +01:00
Klaas van Schelven
167fe8bbc9 Mattermost Alert Backend
W.r.t. the user-contributed version, this:

* removes commented-out code
* removes channels (not supported at the UI level)
* removes all other things

Said differently: the mattermost Alert Service Backend is simply the Slack version
with edits to make it mattermost-specific (and nothing else).

(In a few places I've edited the slack backend to make comparing easier).

Fix #277
See #253
2025-11-25 12:40:18 +01:00
Torsten Curdt
62fdfb7623 Mattermost alert backend
(commits squashed by @vanschelven)
2025-11-25 10:48:16 +01:00
Lutz Lesener
c5c1a8d8cb Fix linting errors 2025-09-09 16:10:44 +02:00
Lutz Lesener
8800c0c65c Implement reviewer's suggestions on PR #203. 2025-09-09 15:36:04 +02:00
Lutz Lesener
08331b2248 Improve Slack alerts to work with Mattermost. 2025-09-09 13:52:22 +02:00
Klaas van Schelven
9b8409d8b2 Global trailing whitespace cleanup 2025-07-29 12:53:10 +02:00
Klaas van Schelven
718127fd08 Add timeouts to external calls to service
following the principle 'always set timeouts when making network calls'
2025-07-28 22:18:02 +02:00
Klaas van Schelven
0aa7de30d2 Don't re-raise exceptions that are 'handled in the UI'
we now have handling for them, no need to keep seeing them as stacktraces.
also: in the EAGER setup, raising means the transaciton is rolled back,
and nothing is stored in the DB at all.

if we ever want to 'get more info' something like capture_or_log_exception
would be more apt
2025-07-28 22:17:59 +02:00
Klaas van Schelven
fe343f0749 Remove copilot's overuse of comments / fallbacks 2025-07-28 22:14:05 +02:00
Klaas van Schelven
e6c8c694bd alerts config: in the admin 2025-07-28 22:14:05 +02:00
Klaas van Schelven
cdca0a054e Whitespace/flake8 2025-07-28 22:14:05 +02:00
copilot-swe-agent[bot]
b564774f21 Add failure tracking fields and error handling to alert backends
Co-authored-by: vanschelven <223833+vanschelven@users.noreply.github.com>
2025-07-28 22:13:17 +02:00
Klaas van Schelven
28b2ce0eaf Various models: .project SET_NULL => DO_NOTHING
Like e45c61d6f0, but for .project.

I originally thought `SET_NULL` would be a good way to "do stuff later", but
that's only so the degree that [1] updates are cheaper than deletes and [2]
2nd-order effects (further deletes in the dep-tree) are avoided.

Now that we have explicit Project-deletion (deps-first, delayed, properly batched)
the SET_NULL behavior is always a no-op (but with cost in queries).

As a result, in the test for project deletion (which has deletes for many
of the altered models), the following 12 queries are no longer done:

```
SELECT "projects_project"."id", [..many fields..] FROM "projects_project" WHERE "projects_project"."id" = 1
DELETE FROM "projects_projectmembership" WHERE "projects_projectmembership"."project_id" IN (1)
DELETE FROM "alerts_messagingserviceconfig" WHERE "alerts_messagingserviceconfig"."project_id" IN (1)
UPDATE "releases_release" SET "project_id" = NULL WHERE "releases_release"."project_id" IN (1)
UPDATE "issues_issue" SET "project_id" = NULL WHERE "issues_issue"."project_id" IN (1)
UPDATE "issues_grouping" SET "project_id" = NULL WHERE "issues_grouping"."project_id" IN (1)
UPDATE "events_event" SET "project_id" = NULL WHERE "events_event"."project_id" IN (1)
UPDATE "tags_tagkey" SET "project_id" = NULL WHERE "tags_tagkey"."project_id" IN (1)
UPDATE "tags_tagvalue" SET "project_id" = NULL WHERE "tags_tagvalue"."project_id" IN (1)
UPDATE "tags_eventtag" SET "project_id" = NULL WHERE "tags_eventtag"."project_id" IN (1)
UPDATE "tags_issuetag" SET "project_id" = NULL WHERE "tags_issuetag"."project_id" IN (1)
```
2025-07-03 21:49:49 +02:00
Klaas van Schelven
f84af74a7c Remove hard-coded webhook_url from test_message
as pointed out by Slack's own bots
2025-06-11 08:42:06 +02:00
Klaas van Schelven
fac5b19966 Slack Alerts
Fix #3
2025-06-10 22:00:37 +02:00
Klaas van Schelven
fd7eae681d Remove migrations directory from modelless apps 2025-02-03 13:05:20 +01:00
Klaas van Schelven
eafdcfdf32 Alert: truncate the individual parts
this way, for a long issue.title, you still see what the project context is
2024-09-26 15:06:24 +02:00
Klaas van Schelven
98caf0ec55 Notifications: link to /accounts/preferences/ 2024-09-13 09:41:44 +02:00
Klaas van Schelven
129a8db421 Fix various flake8 errors 2024-08-21 09:31:05 +02:00
Klaas van Schelven
95cb39f5af Implement 'send_email_alerts'
* cascading from team to project; user is base-level-default
* implemented at form-level
* implemented when emails are actually sent
2024-06-13 13:23:14 +02:00
Klaas van Schelven
c4358aaece Fix tests for users.User idiom 2024-06-12 17:45:06 +02:00
Klaas van Schelven
42ba4cc99c Put mail templates in a so-named directory 2024-06-06 09:38:43 +02:00
Klaas van Schelven
8692378009 Move utils to more general place 2024-05-31 09:38:39 +02:00
Klaas van Schelven
f2de61b273 Use app_settings for Bugsink-specific stuff
something about consistency
2024-05-13 15:09:35 +02:00
Klaas van Schelven
3c106521bc snappea WIP commit 2024-04-19 16:21:42 +02:00
Klaas van Schelven
8e44f7f68e Unmute reason: show in email alert 2024-04-15 10:17:18 +02:00
Klaas van Schelven
2c4e8b9f20 Regular v.s. Django Testcase: be explicit
I recently ran into a funny issue where the TestCases were influencing my
development DB's contents
2024-04-15 09:17:53 +02:00
Klaas van Schelven
0d4c51958f Reordering of the order of elements in subject/first-line
most important change: 'New issue' from start of the subject to its end.
This was prompted by getting flooded with 'New issue' emails, but you
want to know _what_ first.
2024-03-20 21:02:35 +01:00
Klaas van Schelven
331ac49069 Email hidden-div-preview: put some useful info there 2024-03-16 13:01:23 +01:00
Klaas van Schelven
3f8200f940 Textual 'copyable link'
I was confused myself by the previous text
2024-03-15 20:09:05 +01:00
Klaas van Schelven
86e057db5b Add quotes to email subject for legibility 2024-03-15 20:09:15 +01:00
Klaas van Schelven
910b04687b Fix 'view on' link in emails 2024-03-09 21:50:13 +01:00
Klaas van Schelven
9ac74ffe17 rename -> site_title
A foolish consistency is the hobgoblin of little minds
2024-01-16 23:07:10 +01:00
Klaas van Schelven
2eacf93ebc missing file 2024-01-16 22:59:14 +01:00
Klaas van Schelven
1426c2f572 Sending of emails: tests, .txt versions, further small improvements 2024-01-16 18:01:45 +01:00
Klaas van Schelven
8cb918d211 html comments => django template comments 2024-01-16 17:12:56 +01:00
Klaas van Schelven
ec65b52b26 Email layout: margins; cyan 2024-01-15 23:25:58 +01:00
Klaas van Schelven
38312a25e8 First steps towards email-layout (and the right info) 2024-01-15 23:20:35 +01:00
Klaas van Schelven
74188297dc Infrastructure for email-html debugging 2024-01-15 22:59:28 +01:00
Klaas van Schelven
24cbda71dc Don't send images with emails
The cost/benefit says "this is simply not worth it".
It's yet another thing that could break. In ways that are not obvious to me.
(html) email sending is hard enough as it stands.
2024-01-14 22:29:47 +01:00
Klaas van Schelven
97d2e0b09d WIP: email-sending for new_issue 2024-01-14 22:25:36 +01:00
Klaas van Schelven
ae8faa1bcf alerts: new_issue.html from PostMark welcome email (verbatim copy)
https://raw.githubusercontent.com/ActiveCampaign/postmark-templates/main/templates-inlined/basic/password-reset/content.html
2024-01-14 22:23:31 +01:00