Commit Graph

10 Commits

Author SHA1 Message Date
Ben Thorner
190c2b5122 Fix broadcast alert not triggering PagerDuty
We previously decided against this [^1] but the lambda alerts are
not a replacement for this one.

Even if both sets of alerts go off, we expect PagerDuty to aggregate
them into a single notification.

[^1]: 65c21f694c
2022-04-06 14:06:03 +01:00
Ben Thorner
f4cc87dc77 Remove excess indentation in broadcast alert
In response to: [^1].

[^1]: https://github.com/alphagov/notifications-api/pull/3497#discussion_r842747749
2022-04-05 14:42:24 +01:00
Ben Thorner
e84014b86d Update broadcast approval alert content
This now links to the new runbook for the alert.
2022-04-05 12:57:09 +01:00
Ben Thorner
779b8e941f Rewrite broadcast Zendesk alert at approval time
The new alert happens earlier but is otherwise the same:

- We only create a ticket in Production.
- We only create a ticket on approval.

I took this opportunity to refactor the alert as a private function
and test this specifically in detail to avoid lots of repetitive
mocks, which are required when calling the main "update" function.

One test I haven't preserved was for when the "names" array is empty,
as this was added for a legacy data integrity scenario [^1].

[^1]: bf0bf4e31c
2022-04-05 12:57:08 +01:00
Ben Thorner
c7c5793da4 Shorten name of broadcast utility function
This is doing more than just validating and updating an is about to
do even more. Saying "update" is broad enough to cover the others.
2022-04-05 11:35:33 +01:00
Ben Thorner
3b705a780a Extract broadcast validations into separate fn
This makes it easier to see the key stages of the function, which
we're about to make a bit bigger.
2022-04-05 11:29:36 +01:00
Pea Tyczynska
3dc1907321 Audit api key id when cancelling broadcast via api 2022-02-11 12:01:56 +00:00
Pea Tyczynska
a780933893 Revert "Audit api key id when cancelling broadcast via api" 2022-02-09 11:01:39 +00:00
Pea Tyczynska
82f08f230c Save api key id when cancelling broadcast by API call
This is so that we can audit who cancelled the broadcast if
there are any issues.
2022-01-26 17:26:58 +00:00
Pea Tyczynska
52dbdb7518 Move validate_and_update_broadcast_message_status to a utils file
This is because that function is used both when broadcast status
is updated via API and via admin, so it's a shared resource.

Also move and update tests for updating broadcast message status
so things are tested at source and repetition is avoided.
2022-01-20 18:14:41 +00:00