Commit Graph

2437 Commits

Author SHA1 Message Date
Leo Hemsted
b0d4044ff5 remove free_sms_fragment_limit from service
* remove from model
* still required when calling POST /service - we just call through
  from dao_create_service to add a new annual billing entry.
* removed from POST /service/<id> update_service - if you want to
  update/add a new one, use POST /service/<id>/free-sms-fragment-limit
* made sure tests create services with default 250k limit.
2017-12-06 14:45:43 +00:00
Richard Chapman
af1ab437be Revert changes to staging for performance tests and increased rate limit
- Reverted the Gunicorn worker number to 5 (this should be investigated
further on a well baselined system to compare)
- Enabled REDIS
- Increased the rate limit to 400 req/sec as using early testing
yesterday 450+ was being achieved
2017-12-06 09:38:31 +00:00
Ken Tsang
7b390e74c4 Upper case the filename to meet requirements 2017-12-05 16:03:08 +00:00
kentsanggds
30d66c3d62 Merge branch 'master' into ken-add-letters-pdf-s3-bucket 2017-12-05 15:29:28 +00:00
venusbb
185155a521 Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-callback-receipt-1 2017-12-05 12:04:18 +00:00
venusbb
81ead8b246 code style fix 2017-12-05 11:23:21 +00:00
Rebecca Law
956907c170 Revert the last commit. It was intended for another branch. 2017-12-05 10:54:55 +00:00
venusbb
1c1cdbdf7c Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-callback-receipt-1 2017-12-05 10:49:05 +00:00
Rebecca Law
06a6d37595 Merge branch 'master' into add-crown-column-to-services 2017-12-05 10:28:26 +00:00
Rebecca Law
b4a1d635f7 Rebuild the letter_rates table to include everything it needs.
The current letter_rates table is not used so it is ok to drop and re-create it
2017-12-05 10:27:29 +00:00
venusbb
5482ee4fe7 - wrap apply_async parameter notification_id in a str() argument
- check if service_callback_api exist before putting tasks on queue
- create_service_callback_api in tests before asserting if send_delivery_status_to_service has been called.
2017-12-04 17:58:38 +00:00
Ken Tsang
aa39f47d8e Added letters pdf S3 upload function
- uses s3upload from notifications_utils which will create an s3 bucket if it doesn't already exist
2017-12-04 16:48:38 +00:00
Ken Tsang
d62b350fcb Add config for letters pdf s3 bucket different environments 2017-12-04 16:29:04 +00:00
Athanasios Voutsadakis
c2228bb7d2 Enable proxy header check on live 2017-12-04 16:14:30 +00:00
Rebecca Law
7fa4e7ffc7 Set crown if organisation_type is updated on service.
Add some tests.
Update the initial values of crown.
2017-12-04 16:07:26 +00:00
Katie Smith
f73319f5ef Add and populate crown column to services and services_history
- Added the boolean 'crown' column to services and services_history tables
- We populate this column in the same migration script by checking the
'organisation_type' of a service
2017-12-04 13:31:08 +00:00
Leo Hemsted
88c878c83e don't hit the query to get daily msg stats if redis is disabled 2017-12-04 11:12:26 +00:00
kentsanggds
3ba7e8abd9 Merge pull request #1455 from alphagov/ken-add-letters_as_pdf-permission
Add letters_as_pdf service permission
2017-12-04 10:30:49 +00:00
Richard Chapman
12665912ca Merge pull request #1456 from alphagov/rc_performance_testing_updates_staging
Disable Redis for Staging added statsd for post methods
2017-12-04 09:26:22 +00:00
venusbb
771ce9e2bc fixed code style 2017-12-01 22:24:53 +00:00
venusbb
f5a0ca9184 Added delivery status to services for letter callbacks 2017-12-01 21:59:46 +00:00
venusbb
096657799c Added send delivery status to SES callbacks 2017-12-01 21:13:01 +00:00
venusbb
a604fb82bb added sms delivery status callback 2017-12-01 21:11:56 +00:00
Ken Tsang
907a9d62a1 Add letters_as_pdf service permission 2017-12-01 17:25:20 +00:00
Alexey Bezhan
1bcca032c2 Merge pull request #1424 from alphagov/create-history-using-init-kwargs
Use model constructors when creating history instances
2017-12-01 16:42:29 +00:00
venusbb
489f43a2c9 rename callback_tasks.py to process_ses_receipts.py
create service_callback_tasks.py for tasks to send delivery statuses to services
2017-12-01 16:15:21 +00:00
Richard Chapman
344e5c1f5d dded statsd to the endpoint and removed it from a letters only method
as we are not interested int he letters performance at the moment.
2017-12-01 15:46:31 +00:00
Richard Chapman
5f25d3162a Disable Redis for Staging added statsd for post methods
- Disable Redis as there is a current connection limit of 256 which
 could slow down the request if they are all used
 - Added statd to methods in the post to help spot any bottlenecks
2017-12-01 15:41:53 +00:00
venusbb
ad861f2d55 Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-receipt-callback-dao 2017-12-01 14:36:25 +00:00
venusbb
988b22391b added send_delivery_status_to_service task worker 2017-12-01 14:06:13 +00:00
venusbb
23a40b9fd0 create method _post_status_update for the actual sending of callbacks 2017-12-01 09:54:18 +00:00
venusbb
a0fe5c6971 created dao to get notifications by references 2017-12-01 09:31:03 +00:00
Rebecca Law
a01838e833 Drop the Notification to sender mapping tables.
We no longer need them because we record the text value of the sender on the notification.
2017-11-30 15:53:08 +00:00
venusbb
f32051194d Bugs rectified 2017-11-30 12:39:19 +00:00
Rebecca Law
e9a1cc5f83 Stop deleting the mapping tables. 2017-11-30 11:27:08 +00:00
venusbb
bf8fe09908 changed name of endpoint from service_callback to delivery_receipt 2017-11-30 11:27:07 +00:00
Alexey Bezhan
17f5742e2c Use model constructors when creating history instances
`create_history` used to initialise an empty model instance and
assign attributes to it one by one. Assigned attributes are
collected by iterating over internal state of the modified record
and stored in a dictionary, so the order in which they are set on
the history instance is undefined.

This works fine for most model instances, but recent changes to the
Template models require `template_type` to be set before `reply_to`,
otherwise Template doesn't know which column to use to persist the
`reply_to` value.

This means that we need to order the attributes when they're being
assigned. We achieved this by defining a constructor for Template
objects that assigns `template_type` first.

In order to make it work with `create_history` we replace individual
`setattr` calls with a single call to the Template constructor which
passes the entire data dictionary as keyword arguments.

This works because all persisted attributes are defined as columns
and SQLAlchemy accepts all column values as constructor arguments.
2017-11-30 10:57:13 +00:00
venusbb
6a994793dc Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-receipt-callback-dao 2017-11-29 17:39:33 +00:00
venusbb
02f8ad4db2 added test for service_callback_api rest 2017-11-29 17:36:43 +00:00
venusbb
a628834a2b Add service callback endpoints 2017-11-29 16:51:39 +00:00
Rebecca Law
8aa94af5d7 Stop populating the notification to sender mapping table when creating a notificaiton. 2017-11-29 16:47:23 +00:00
venusbb
8dc0455f70 move inbound_api tests into test_callback_rest.py 2017-11-29 16:43:09 +00:00
Leo Hemsted
0304af08df move service_inbound_api endpoints to their own blueprint
try and reduce the size of the service blueprint :)
2017-11-29 16:28:01 +00:00
venusbb
c07e804319 Created service_callback_api daos 2017-11-29 15:58:11 +00:00
Rebecca Law
3b1112d4e4 Remove SQLALCHEMY_ECHO for test 2017-11-29 15:15:03 +00:00
Rebecca Law
fbcf777884 Remove unused import 2017-11-29 14:38:38 +00:00
Rebecca Law
ac6d041d26 Merge branch 'master' into use-reply-to-in-send-to-provider 2017-11-29 14:34:28 +00:00
Rebecca Law
39950c47bc Remove \t 2017-11-29 14:30:02 +00:00
Venus Bailey
795056bc1b Merge pull request #1440 from alphagov/vb-govuk-db-migration
Migration to create new database table service_callback_api
2017-11-29 11:46:51 +00:00
venusbb
5761d22822 Migration to create new database table service_callback_api 2017-11-28 15:25:15 +00:00