Leo Hemsted
4e2a14ed28
Merge branch 'master' into notifications-get-api-key-filter
2016-07-01 17:12:03 +01:00
Rebecca Law
3aff22cf87
Improve the logging message
2016-07-01 14:42:40 +01:00
Leo Hemsted
01419e7894
store api_key_id and key_type on notification
...
pass through from POST /notification/<type> to the celery task
also removed a couple of asserts that can fail (based on unfrozen time comparisons)
2016-07-01 14:35:02 +01:00
Rebecca Law
f52755742c
Split send_email task into one task to create the notification and one to send it to the provider.
...
Is there is an exception the task will go to the retry queue.
2016-07-01 14:14:28 +01:00
Rebecca Law
3f11447bc8
A small refactor to use the SMS_TYPE and EMAIL_TYPE in code rather that 'sms' or 'email'
2016-06-30 15:41:51 +01:00
Rebecca Law
25db1bce74
Use the notification types enum for the notifications.notification_type.
...
Reuse EMAIL_TYPE in template_types and notification_types.
2016-06-29 11:50:54 +01:00
Rebecca Law
60e159e3c0
Add notification_type to notification table.
...
It seems like an oversight not to include the notification type in the notifcation.
When updating statistics a query to the template table is required to get the type, this update will mean that query does not have to happen.
2016-06-29 11:23:02 +01:00
Rebecca Law
8a0211b3eb
Only send to the provider if the notification has a created status.
...
If the notification ends up in the retry queue and the delivery app is restarted the notification will get sent twice.
This is because when the app is restarted another message will be in the retry queue as message available which is a
duplicate of the one in the queue that is a message in flight.
This should complete https://www.pivotaltracker.com/story/show/121844427
2016-06-27 14:47:20 +01:00
Rebecca Law
8f19ad19f8
Stop sending the encrypted message to the send_sms_to_provider task.
...
Everything the task needs is now stored in the db.
2016-06-23 09:41:21 +01:00
Rebecca Law
fcb5ca9ef4
The send_sms task will created the notification with a status = created.
...
The encrypted_notification for the send_sms_to_provider task has been made optional.
2016-06-22 13:32:27 +01:00
Rebecca Law
3d3bff25a8
[WIP] updating notification to start in the created status
2016-06-21 15:51:30 +01:00
Rebecca Law
b17aaaabfb
Set a notification.status=created in the send_sms task
2016-06-21 14:38:17 +01:00
Rebecca Law
6c81d0f465
Merge branch 'master' into move-scheduler-tasks
...
Conflicts:
tests/app/celery/test_tasks.py
2016-06-21 11:24:26 +01:00
Adam Shimali
731bb19a9c
Template and personalisation content is now merged and returned with
...
notifications, when retrieved by notification id, or service id (i.e.
all notifications for service).
There is a new element returned at top level of notification json called
body, which is the template content merged with personalisation. This
is consistent with api to endpoint to create notification which returns
what was sent as 'body' in json response.
Merging of template with personalisation is done in the
NotificationStatusSchema.
Personalisation data in encrypted before storing in db.
2016-06-20 16:49:17 +01:00
Rebecca Law
316b5d0e64
Move scheduled tasks into their own module.
...
There is no change to the functionality - only moving the code around.
2016-06-20 13:33:53 +01:00
Martyn Inglis
838bf1d7d4
Merge branch 'master' into split-sms-and-retry
...
Conflicts:
app/celery/tasks.py
tests/app/celery/test_tasks.py
2016-06-17 16:39:03 +01:00
Martyn Inglis
51c6d57a86
Changed the delay period. Now waits
...
10 seconds, 1 minute, 5 minutes, 1 hour and 4 hours.
Total elapsed wait is max 5 hours 6 minutes and 10 seconds.
Changed visibility window of SQS to be 4 hours 10 seconds, longer the max retry period.
2016-06-17 16:32:56 +01:00
Rebecca Law
fa6ae864d6
Remove the invitation email and reset password email tasks.
2016-06-17 13:49:33 +01:00
Rebecca Law
0200d3ab11
Remove the extra task created to handle the change to the send_email signature
2016-06-15 15:28:53 +01:00
Martyn Inglis
0a933021d6
Merge branch 'master' into split-sms-and-retry
2016-06-14 12:55:16 +01:00
Rebecca Law
b31c4e801e
Remove old email_registration_verification task
2016-06-14 11:43:13 +01:00
Martyn Inglis
f143aade71
Added new tests/code to ensure failure stats recorded
2016-06-13 16:40:46 +01:00
Rebecca Law
a6ce109c62
Rename first send_email to send_email_v1.
...
Fix the tests
2016-06-13 16:16:56 +01:00
Rebecca Law
cd2627e5ed
Create a new task called send_email_v2 so that I can get rid of the from_address in the signature.
...
This is done to make sure we do not lose any messages in the queue during deployment.
2016-06-13 15:31:45 +01:00
Rebecca Law
5fc14940f3
Let the send_email task set the from address
2016-06-13 14:58:00 +01:00
Rebecca Law
c9f1eb65a7
Build the from address in the task instead of the rest call.
2016-06-13 14:57:59 +01:00
Martyn Inglis
bec882ba41
Merge branch 'master' into split-sms-and-retry
2016-06-13 11:39:13 +01:00
Martyn Inglis
6b5b40b953
Added tests for statsd and provider stats outcomes with the new provider stats tasks
...
- note large change to DAO to remove provider from create notification. Added on send now not creation.
2016-06-13 11:38:25 +01:00
Rebecca Law
b677768de1
Merge pull request #400 from alphagov/remove-task-send-sms-code
...
Remove task send_sms_code.
2016-06-13 11:34:26 +01:00
Leo Hemsted
fd2a0a0b10
fix firetext research mode requests
...
requests converts dicts into query parameters anyway if you don't specify so dont try and encode the data ourselves, also hardened up tests
2016-06-09 15:15:44 +01:00
Rebecca Law
50ec2eb7fc
Remove task send_sms_code.
...
We use a notify service to send the sms code via using a template.
2016-06-09 11:54:34 +01:00
Nicholas Staples
8a1f4de217
Task added to update 'sending' notifications after 72 hours, set task to temporary-failure.
2016-06-08 15:25:57 +01:00
Martyn Inglis
92e4c0872b
Pulled out the tests that send SMSs into provider_tasks file/tests
...
- updated tests to validate creation of next task, not sending direct to provider
2016-06-07 12:53:31 +01:00
Martyn Inglis
642aa2890e
Starting to implement tests across the new tasks file
2016-06-07 11:09:54 +01:00
Martyn Inglis
12503d6291
First spike to split up send-sms task
...
- 2 separate tasks - DB and Provider
- DB to persist notification
- Provider to contact provider
- Each piece has separate retries
- Provider retries have configured back-off
2016-06-03 14:54:46 +01:00
Martyn Inglis
754ccbe9af
Removed update reference from updating the provider stats
...
- single focus method
- allows not to pollute DAO with research mode
2016-06-02 09:52:47 +01:00
Martyn Inglis
099c17192d
Merged provider stats only on success branch
...
- ensures that don't raise stats in research mode
2016-06-02 09:30:01 +01:00
Martyn Inglis
001149c263
Merge branch 'master' into research-mode-implementation
2016-06-02 09:28:35 +01:00
Martyn Inglis
6ca2e588a9
Re-aligned the dao update that moved by mistake
2016-06-02 08:59:30 +01:00
Martyn Inglis
97e29b9039
Merge branch 'master' into research-mode-implementation
2016-06-01 17:06:38 +01:00
Martyn Inglis
290f416485
Various tidy ups and changes
...
- use new queue
- remove some new lines in AWS response data
- migration script to populate new fields
2016-06-01 16:57:57 +01:00
Nicholas Staples
276ca15919
Provider stats only updated if the provider successfully sends the message.
2016-06-01 12:43:26 +01:00
Martyn Inglis
909fac3c05
Added research mode tasks
...
- if a service is in research mode the don't send the notifications via the providers (MMG/SES/etc)
- instead set up a task to mimic those services callbacks - this completes the loop, and show stats, delivery receipts and so on.
- Use the "to" field to choose the response, allows users to create successful and errored notifications
temp fail sms, uses "07833333333"
perm fail sms, uses = "07822222222"
success = "07811111111" (or anything else)
success email = "delivered@simulator.notify "
perm fail = "perm-fail@simulator.notify "
temp fail = "temp-fail@simulator.notify "
2016-05-31 16:55:26 +01:00
Nicholas Staples
79dfc360f2
Notification not created in send_sms or send_email when service is in restricted mode.
2016-05-31 14:55:06 +01:00
Nicholas Staples
0fe0c1d2b4
Added job row number to the notification for csv jobs. All tests passing.
2016-05-19 10:46:03 +01:00
Adam Shimali
e1685d6a45
Was incorrectly setting from not reply to
2016-05-17 14:31:33 +01:00
Rebecca Law
4762aef1aa
Merge pull request #318 from alphagov/tech-failures
...
New notification status types
2016-05-17 13:50:57 +01:00
Rebecca Law
191a79f27b
Add new failure status for notifications.
2016-05-17 13:06:08 +01:00
Adam Shimali
642fb6f68b
Process job for email uses reply to if present
2016-05-17 12:41:13 +01:00
minglis
3c751d94a4
Merge pull request #309 from alphagov/statsd-integration
...
Statsd integration
2016-05-16 12:29:14 +01:00