Commit Graph

8036 Commits

Author SHA1 Message Date
David McDonald
a2cc0df5a7 Merge pull request #3167 from alphagov/broadcast_services_history
Add service versioning to broadcast account type change
2021-03-11 17:07:24 +00:00
Rebecca Law
2fabd59cf4 Merge pull request #3176 from alphagov/fix-update-notification-method
Refactor method for deciding the failure type
2021-03-11 14:34:50 +00:00
Rebecca Law
19f7a6ce38 Refactor method for deciding the failure type 2021-03-10 14:39:55 +00:00
Rebecca Law
a7a504a599 Merge pull request #3173 from alphagov/performance-platform-endpoints
Add an endpoint to return all the data required for the performance platform page
2021-03-10 13:27:08 +00:00
Rebecca Law
11d10d5293 Rename to performance_dashboard
Fix totals to return totals for all time rather than for date range.
Added more test data
2021-03-10 13:16:25 +00:00
Ben Thorner
6db9a7a2f2 Merge pull request #3170 from alphagov/quiet-pytest
Quieten output for pytest
2021-03-09 08:51:16 +00:00
Ben Thorner
94718c1d29 Quieten output for pytest
This avoids being verbose by default, which is consistent with how
we configure pytest for the admin app [1].

[1]: https://github.com/alphagov/notifications-admin/blob/master/pytest.ini#L16
2021-03-08 17:44:48 +00:00
David McDonald
ff11f39ce4 Merge pull request #3165 from alphagov/pyup-scheduled-update-2021-03-03
Scheduled weekly dependency update for week 09
2021-03-08 17:02:27 +00:00
David McDonald
289c0ea0c6 Make freeze requirements 2021-03-08 15:56:42 +00:00
David McDonald
8cf32d6f22 Add service versioning to broadcast account type change
We are using the `set_broadcast_service_type` route to make changes to
service objects. However, we had forgotten to add the `version_class`
decorator to it which will mean the changing of a service going from
training to live mode will also be recorded in the services_history
table for free. Whilst not essential, this easy change makes things more
consistent for how we update other services.
2021-03-08 14:09:24 +00:00
Leo Hemsted
dabdc2c4ac Merge pull request #3169 from alphagov/remove-old-user-email-endpoint
add POST get user by email endpoint
2021-03-05 14:06:57 +00:00
Leo Hemsted
e0234fecba add POST get user by email endpoint
the existing endpoint is a GET, and so leaves email addresses in log
files.

we've got an existing POST find_users_by_partial_email, but not one that
matches on a whole email address.
2021-03-05 12:58:45 +00:00
David McDonald
6b535fe946 Merge pull request #3166 from alphagov/email-auth-broadcast-bug
Email auth broadcast bug
2021-03-05 09:59:59 +00:00
Rebecca Law
b06850e611 Add an endpoint to return all the data required for the performance
platform page.
2021-03-05 09:59:03 +00:00
David McDonald
fcf667f09c Add test coverage for setting service permission
Spotted that we aren't testing all our permission types here so added
this one in.

It includes the TODO for allowing the API to give a service the
broadcast permission. We don't want this to happen, we want them to use
the `set_as_broadcast_service` route instead. We will probably get away
with it for the moment for it would be tighter validation we should add
to reduce the risk of letting a service get in a dodgy state.
2021-03-03 18:49:40 +00:00
David McDonald
0ce539704e Fix bug with removing email auth for broadcast service
We accidently were removing the ability for a service to do email auth
if it was a broadcast service with email auth. This fixes it.

Note, it might be up for debate later whether we let broadcast services
use email auth (I think we should) so this might change in time, but we
will fix this bug regardless.

Note, worth glancing at `SERVICE_PERMISSION_TYPES` which contains a list
of permissions that a service might have to make sure I haven't missed
any others. The one that looks potentially dodgy is the
`EDIT_FOLDER_PERMISSIONS` permission but I can't see this being used
anywhere in the API or the admin app so think it is likely now defunct
and a user level permission so we don't need to worry about it.
2021-03-03 18:34:24 +00:00
pyup-bot
9f39118991 Update notifications-python-client from 5.7.1 to 6.0.2 2021-03-03 13:00:06 +00:00
pyup-bot
b5f5114c59 Pin cryptography to latest version 3.4.6 2021-03-03 13:00:06 +00:00
pyup-bot
80891199f8 Update cachetools from 4.2.0 to 4.2.1 2021-03-03 13:00:05 +00:00
pyup-bot
8067ebdca5 Update sqlalchemy from 1.3.22 to 1.3.23 2021-03-03 13:00:05 +00:00
pyup-bot
49dac21739 Update pyjwt from 2.0.0 to 2.0.1 2021-03-03 13:00:05 +00:00
pyup-bot
b615f7192f Update marshmallow-sqlalchemy from 0.23.1 to 0.24.0 2021-03-03 13:00:04 +00:00
pyup-bot
e05ae8f413 Update iso8601 from 0.1.13 to 0.1.14 2021-03-03 13:00:04 +00:00
pyup-bot
6371975981 Update eventlet from 0.30.0 to 0.30.1 2021-03-03 13:00:03 +00:00
pyup-bot
d56430b3a8 Update flask-migrate from 2.5.3 to 2.7.0 2021-03-03 13:00:03 +00:00
pyup-bot
83c5a4f67c Update cffi from 1.14.4 to 1.14.5 2021-03-03 13:00:03 +00:00
Richard Baker
30eb98c140 Merge pull request #3164 from alphagov/cell_broadcast_ee_prod
Enable EE Cell Broadcasts in production environment
2021-03-02 09:46:23 +00:00
Richard Baker
2e4ac1f09c Enable EE Cell Broadcasts in production environment
Removes the configuration override for Live, so the base configuration is
used, enabling cell broadcasting for all MNOs.

Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2021-03-02 09:34:35 +00:00
Rebecca Law
08b157df87 Merge pull request #3162 from alphagov/change-dvla-addres-to-list
Change DVLA_EMAIL_ADDRESS to a list
2021-02-26 13:38:06 +00:00
Rebecca Law
3df334d099 Simplify config and add json loads 2021-02-26 12:19:03 +00:00
Rebecca Law
acfb759cb9 Change DVLA_EMAIL_ADDRESS to a list 2021-02-26 11:21:16 +00:00
Rebecca Law
b120b83cc7 Merge pull request #3157 from alphagov/persist-performance-data
Persist the processing time statistics to the database.
2021-02-26 09:09:41 +00:00
Rebecca Law
e105257925 Fix db migration merge conflicts 2021-02-26 08:38:36 +00:00
Rebecca Law
3099c51e12 Command to load the processing time data for the new ft_processing_time
data.
2021-02-26 07:49:49 +00:00
Rebecca Law
1797a993e7 Fix db migration conflict 2021-02-26 07:49:49 +00:00
Rebecca Law
0849070eca Add created_at and updated_at columns to ft_processing_time 2021-02-26 07:49:49 +00:00
Rebecca Law
21edf7bfdd Persist the processing time statistics to the database.
The performance platform is going away soon. The only stat that we do not have in our database is the processing time. Let me clarify the only statistic we don't have in our database that we can query efficiently is the processing time. Any queries on notification_history are too inefficient to use on a web page.
Processing time = the total number of normal/team emails and text messages plus the number of messages that have gone from created to sending within 10 seconds per whole day. We can then easily calculate the percentage of messages that were marked as sending under 10 seconds.
2021-02-26 07:49:49 +00:00
David McDonald
82e5a1804b Merge pull request #3155 from alphagov/migrate-broadcast-settings
Backfill services_broadcast_settings table
2021-02-25 12:16:36 +00:00
Rebecca Law
1b22de3830 Merge pull request #3161 from alphagov/check-use_numeric_sender
Check international rules to decide on a sender
2021-02-25 09:36:29 +00:00
Rebecca Law
97d1bfaee8 Rename method for clarity
Added unit test for new method.
2021-02-25 08:10:52 +00:00
Rebecca Law
11bd906338 Update utils to get the new function 2021-02-24 16:56:33 +00:00
Rebecca Law
5986a65005 Check international number for alpha: NO if true then use number to send
SMS.

This is not a catch all for international SMS, the rules are quite
complex and still not completely understood. We are talking with our
provider who maybe able to sort this out for us. But in the meantime,
this should solve for the case that we understand.
2021-02-24 15:12:03 +00:00
Pea Tyczynska
516a982592 Merge pull request #3159 from alphagov/add-date-to-dvla-email-personalisation
Add date to personalisation for DVLA email
2021-02-24 14:54:06 +00:00
Pea Tyczynska
f3e0cfc727 Pull DVLA address from credentials on staging
So that we can test this flow on staging.
2021-02-24 11:34:29 +00:00
Pea Tyczynska
8e3ef5ff05 Add DVLA_EMAIL_ADDRESS to manifest so it gets picked up from
credentials.
2021-02-24 10:32:20 +00:00
Pea Tyczynska
4fc3af9811 Add date to personalisation for DVLA email
Personalisation was missing date attribute. The email still got sent
tonight, just it didn't have a value for date placeholder.
2021-02-24 10:22:22 +00:00
David McDonald
3ea86bfb48 Remove hardcoded default to use test channel
There is no need for a default now as every broadcast service has set on
it which broadcast channel to use.
2021-02-23 17:15:07 +00:00
David McDonald
9b21e6b04f Use sample_broadcast_service fixture
Now that every service has a row in the service_broadcast_settings
table, we want all our tests to use the `sample_broadcast_service`
fixture as this ensures it has a row in that table and is correctly
representitive of what a real broadcast service looks like.
2021-02-23 17:15:06 +00:00
David McDonald
ce2f550387 Backfill services_broadcast_settings table
At the moment, we currently have broadcast services that have the
'broadcast' service permission in the DB but don't have a corresponding
row in the service_broadcast_settings table. It's important to give them
a row in this table because this will control which broadcast channel
their messages will go out on. All broadcast services will be expected
to have this row so we can then remove hardcoded defaults from our code
that currently set what channel a message should go out on.

Whilst, when this gets deployed, we will have released
https://github.com/alphagov/notifications-admin/pull/3794, which means
that when a service setting is changed via that form, they will get the
corresponding row in the service_broadcast_settings form, we don't want
to ask every developer to go and fill in this form for every service on
their local dev environment and also do the same to every service we
have in preview, staging and production. Therefore a migration is the
best way to backfill the data.

Note, I made the decision that a service that is in trial mode will be
given the 'severe' channel. This is because this is what most trial mode
services should have. Only the MNOs would ever really have a trial mode
service on the test channel. And given they are in trial mode, it is not
too risky to give them the 'severe' channel.

For services that are live though, although there are no services in
production that have the broadcast permission and are live, it is not
worth taking that risk and accidently setting that service to send an
alert out on the 'severe' channel. We play it say by choosing 'test'.
2021-02-23 17:15:05 +00:00
Pea Tyczynska
8e5f956009 Merge pull request #3151 from alphagov/daily-volumes-dvla
Send daily email with volumes of letters and sheets to DVLA
2021-02-23 15:24:31 +00:00