Commit Graph

1217 Commits

Author SHA1 Message Date
Rebecca Law
a9e429b09f Fix task name, should have dashes not underscores 2017-04-06 15:26:50 +01:00
Rebecca Law
1d46dd0be1 Remove bucket-name from the task. 2017-04-06 15:03:06 +01:00
Rebecca Law
7bd0a07f0d Added bucket name to task arguments. 2017-04-06 12:18:34 +01:00
Rebecca Law
970a4e7b4e New endpoint to send a list of job ids to a queue.
The task will be picked up by the FTP app. Given the list of job ids the tasks will get all the files from s3, aggregate them then send to dvla
2017-04-06 12:14:17 +01:00
minglis
29c84d73ff Merge pull request #889 from alphagov/restrict-delete-files-job-query
Updates to the delete CSV file job to reduce the number jobs included in any run.
2017-04-06 10:09:49 +01:00
minglis
4d5e697f1c Merge pull request #888 from alphagov/throw-exception-on-long-running-client-call
Throw exception on long running client call
2017-04-06 09:24:26 +01:00
Martyn Inglis
80965e4651 Good spot by Leo on has_calls not being exclusive,
Using call_args_list to get accurate list of args
2017-04-05 16:50:32 +01:00
Martyn Inglis
c8a26fcd40 Fixed test names 2017-04-05 16:30:53 +01:00
Martyn Inglis
832005efef Updates to the delete CSV file job to reduce the number of eligible jobs in any run
- previously this was unbounded, so it got all jobs older then 7 days. In excess of 75,000 🔥
- this meant that the job took (a) a long time and (b) a lot memory and (c) doing the same thing every day

These changes mean that the job has a 2 day eligible window for jobs, minimising the number of eligible jobs in a run, whilst still retaining some leeway in event if it failing one night.

In principle the job runs early morning on a given day. The previous 7 days are left along, and then the previous 2 days worth of files are deleted:

so:
runs on
31st
30,29,28,27,26,25,24 are ignored
23,22 jobs here have files deleted
21 and earlier are ignored.
2017-04-05 16:23:41 +01:00
Martyn Inglis
72ecca4dab Added a 60 second timeout to the MMG and fire text clients.
- This is a CONNECT and a READ timeout.
- Gets wrapped in the standard client exception, with a status code of 504, message Gateway timeout.
- Is quiet noisy in logs to allow us to see it
- Ensures we flick across the provider.

To test change the timeout to 0 and it will timeout.
2017-04-05 15:31:37 +01:00
Chris Hill-Scott
61a8097ca5 Merge pull request #886 from alphagov/revert-883-revert-867-bump-utils-lists-as-placeholder-values
Revert "Revert "Bump utils to allow lists as placeholder values""
2017-04-05 13:14:57 +01:00
Chris Hill-Scott
f98f220e74 Update utils to fix letter output
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/136
- [ ] https://github.com/alphagov/notifications-utils/pull/131
2017-04-05 12:35:28 +01:00
Chris Hill-Scott
3783a449b7 Merge pull request #880 from alphagov/pass-contact-block
Pass through contact block from service to outputted letter
2017-04-05 09:45:28 +01:00
Chris Hill-Scott
1802c84b8a Add handling for data types other than list/string
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/135

Also adds extra tests for:
- the exact issue that we saw in production when #867 was deployed
- what happens when `None` is passed as a placeholder value, because
  this should never get as far as the relevant bit of utils
2017-04-05 09:28:17 +01:00
Chris Hill-Scott
7943b6819b Revert "Revert "Bump utils to allow lists as placeholder values"" 2017-04-05 09:18:58 +01:00
Chris Hill-Scott
cb208473c6 Revert "Bump utils to allow lists as placeholder values" 2017-04-04 15:19:53 +01:00
Martyn Inglis
ac445114c7 When using a priority template put the notification in the priority queue.
- there is now a dedicated worker to handle priority queues. We don't now bundle this in the default worker.
2017-04-04 13:44:11 +01:00
Chris Hill-Scott
0ac3bfcb81 Merge pull request #867 from alphagov/bump-utils-lists-as-placeholder-values
Bump utils to allow lists as placeholder values
2017-04-03 17:31:30 +01:00
Ken Tsang
817790784f Fix test for utc to bst conversion 2017-04-03 16:02:26 +01:00
Ken Tsang
2b53e14a73 Add fix for bst 2017-04-03 15:49:23 +01:00
Chris Hill-Scott
e47a008dd9 Pass through contact block from service to letter
Whatever a user has entered for their service’s contact block should
appear in the right place in the file we give to DVLA.

The work to output in the right fields in the DVLA file has already been
done. We just weren’t passing it through. This commit passes it through.
2017-04-03 13:27:47 +01:00
Chris Hill-Scott
eb5f9421dd Check for what DVLALetterTemplate is called with
Extends the test to make sure that the thing that builds each line of
the file is getting called with the right template, personalisation and
numeric ID. Will be helpful the more complicated the call to the
template gets.
2017-04-03 13:25:22 +01:00
Leo Hemsted
243c0632ed add test 2017-03-31 17:18:18 +01:00
Chris Hill-Scott
585ef8e66a Bump utils to allow lists as placeholder values
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/128

Also adds a test to make sure that passing a dictionary as a value in
the `personalisation` argument works.
2017-03-31 17:02:54 +01:00
Ken Tsang
d5e8cb3354 Updated cf conf unit tests 2017-03-31 16:50:30 +01:00
Rebecca Law
3838fb583c The redis cache for daily limits and template usage was being updated for notifications with a test api key.
This PR corrects that.
2017-03-30 13:43:44 +01:00
Martyn Inglis
7dcd3164e2 Revert "Reinstating the 2 task model for API submitted notifications."
This reverts commit 1c154c4113.
2017-03-30 10:46:23 +01:00
Martyn Inglis
5cd0507e99 Revert "Fixed faoiling jenkins tests. Mocked the required functions"
This reverts commit 4b60c8dada.
2017-03-30 10:46:15 +01:00
Martyn Inglis
9ee26e0b67 Revert "update notification rest tests"
This reverts commit 11919d9810.
2017-03-30 10:38:51 +01:00
Martyn Inglis
385a73da2b Revert "ensure we're passing through api keys and key types from notifications"
This reverts commit 25d1777937.
2017-03-30 10:38:41 +01:00
Ken Tsang
5f945ab30e Refactored code, changed now to utcnow in test 2017-03-29 11:47:41 +01:00
Ken Tsang
af78efd137 Fix get_detailed_services BST 2017-03-29 11:03:28 +01:00
kentsanggds
79025e54b0 Merge pull request #865 from alphagov/add-v2-template-preview
Add v2 template preview endpoint and schema
2017-03-28 18:40:32 +01:00
Leo Hemsted
d639aa22df skip failing timezone test
TODO fixme
2017-03-28 14:02:47 +01:00
Leo Hemsted
11919d9810 update notification rest tests 2017-03-28 13:51:42 +01:00
Leo Hemsted
25d1777937 ensure we're passing through api keys and key types from notifications
when we made the change to async persist notifications, we forgot to
pass through api_key_id and key_type. in send_sms/email, for legacy
reasons, they default to None/KEY_TYPE_NORMAL, so regardless of what
your api key was set up as, we would send real messages!

TODO: Once the PaaS transition is complete and the task changes are
reverted, remove the api_key_id and key_type params from the send_*
tasks entirely, as those are only called from the csv job flow, and
don't need them
2017-03-28 13:14:46 +01:00
Rebecca Law
31979c3272 Use 500 for org id 2017-03-27 17:49:09 +01:00
minglis
d7adfcaf87 Merge pull request #866 from alphagov/no-downtime-hosting-migration
Reinstating the 2 task model for API submitted notifications.
2017-03-27 13:54:43 +01:00
Rebecca Law
37a5ce601a Update the version of notifications-utils.
There was a problem with the address block for the DVLATemplate.

Added a countdown to the build_dvla_file.
2017-03-24 15:25:02 +00:00
Martyn Inglis
4b60c8dada Fixed faoiling jenkins tests. Mocked the required functions 2017-03-23 15:05:56 +00:00
Martyn Inglis
1c154c4113 Reinstating the 2 task model for API submitted notifications.
This is being done for the PaaS migration to allow us to keep traffic coming in whilst we migrate the database.

uses the same tasks as the CSV uploaded notifications. Simple changes to not persist the notification, and call into a different task.
2017-03-23 14:41:00 +00:00
Ken Tsang
50db538df7 Updated schema to remove redundant 'content' 2017-03-23 11:50:15 +00:00
Ken Tsang
41f82c0aef Refactored tests to use fake_uuid 2017-03-22 14:31:16 +00:00
Ken Tsang
ecbe87a0d6 Added letter preview 2017-03-22 14:22:26 +00:00
Ken Tsang
b81d789307 Add preview endpoint and tests 2017-03-22 10:11:31 +00:00
Ken Tsang
fbcea9c777 Refactored test for optionals 2017-03-22 10:10:06 +00:00
Ken Tsang
8d63f8d9d3 Refactored get template test 2017-03-22 10:10:06 +00:00
Ken Tsang
fad67e1bdd Added schemas + tests & updated get template tests 2017-03-22 10:10:05 +00:00
Rebecca Law
37293b6c7a Added a test to ensure that all blueprints have a registered before_request method.
Added a test for the status endpoint.
2017-03-17 16:21:41 +00:00
Rebecca Law
e4e7a99f40 Merge branch 'master' into secure-endpoints
Conflicts:
	app/__init__.py
2017-03-17 10:24:12 +00:00