Commit Graph

4165 Commits

Author SHA1 Message Date
Rebecca Law
00d2e543dc Refactor letter_rates table to include everything needed to calculate billing for letter notificaitons.
It is ok to drop the existing tables as they are not used anywhere as of yet.
2017-12-05 10:32:19 +00:00
Sakis
b93421208b Merge pull request #1437 from alphagov/enable-proxy-header-live
Enable proxy header check on live
2017-12-04 16:21:58 +00:00
Athanasios Voutsadakis
c2228bb7d2 Enable proxy header check on live 2017-12-04 16:14:30 +00:00
Richard Chapman
3976f7b435 Merge pull request #1461 from alphagov/redis-for-real
don't hit the query to get daily msg stats if redis is disabled
2017-12-04 14:51:56 +00:00
Leo Hemsted
5bb6b68e57 fix tests that expect to be rate limited (which is off if redis is disabled) 2017-12-04 14:13:43 +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
c63cb6572b Merge pull request #1453 from alphagov/pyup-update-awscli-1.14.1-to-1.14.2
Update awscli to 1.14.2
2017-12-04 09:29:54 +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
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
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
Venus Bailey
64c67dea5e Merge pull request #1447 from alphagov/vb-receipt-callback-dao
Email callback receipts rest end points
2017-12-01 14:56:58 +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
Leo Hemsted
f565cf4824 Merge pull request #1454 from alphagov/smartypants-boost
update utils to 23.2.0
2017-12-01 13:39:26 +00:00
Leo Hemsted
f183d03775 update utils to 23.2.1
note: this requires adding smartypants as a line in requirements.txt,
due to it coming from a git repo. Once the new version of smartypants
is in pypi, this'll no longer be required
2017-12-01 13:29:17 +00:00
Rebecca Law
c8afb58474 Merge pull request #1452 from alphagov/drop-mapping-tables
Drop the Notification to sender mapping tables.
2017-12-01 12:29:36 +00:00
pyup-bot
382f429c6c Update awscli from 1.14.1 to 1.14.2 2017-11-30 20:19:45 +00:00
Alexey Bezhan
54ef53cefe Add a test for creating a template with reply_to through the API 2017-11-30 17:31:39 +00:00
Rebecca Law
12dd58d281 Script to drop the tables. 2017-11-30 16:51:26 +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
kentsanggds
adc194f1bb Merge pull request #1449 from alphagov/pyup-pin-awscli-1.14.1
Pin awscli to latest version 1.14.1
2017-11-30 13:47:52 +00:00
Rebecca Law
bfa1fce559 Merge pull request #1445 from alphagov/stop-populating-mapping-tables
Stop populating the notification to sender mapping table
2017-11-30 13:44:32 +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
Rebecca Law
876d30e675 Merge branch 'master' into stop-populating-mapping-tables 2017-11-30 11:20:29 +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
Leo Hemsted
b1a4cc1043 Merge pull request #1451 from alphagov/leohemsted-patch-1
exclude build folder from flake8
2017-11-30 09:56:58 +00:00
Leo Hemsted
e1bc94136b exclude build folder from flake8 2017-11-30 09:56:44 +00:00
Richard Chapman
633d17d14a Merge pull request #1450 from alphagov/rc_increase_gunicorn_threads
Decreased Gunicorn threads
2017-11-30 09:52:59 +00:00
venusbb
d03280776d CodeStyle correction 2017-11-30 09:38:57 +00:00
Richard Chapman
388bba2365 Decreased Gunicorn threads
Increasing the Gunicorn workers to 10 actually made the API decrease
in performance from ~200 requests/sec with with 20 API instances to
150 requests per/sec. The base value is 5 so this is to test how the API
performs with a slight increase.
2017-11-30 09:25:28 +00:00
pyup-bot
59a37d79e5 Pin awscli to latest version 1.14.1 2017-11-30 04:19:44 +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
Leo Hemsted
2f569341f9 Merge pull request #1446 from alphagov/flake8-fix
fix linter stuff
2017-11-29 17:37:31 +00:00
venusbb
02f8ad4db2 added test for service_callback_api rest 2017-11-29 17:36:43 +00:00
Leo Hemsted
be94894753 fix linter stuff 2017-11-29 17:18:53 +00:00
Rebecca Law
a5ceb4ba3c Fix linter 2017-11-29 17:17:08 +00:00
Rebecca Law
8fc0c8b10d Merge branch 'master' into stop-populating-mapping-tables 2017-11-29 16:57:29 +00:00
Leo Hemsted
4e741bab90 Merge pull request #1441 from alphagov/flake8-tests
Flake8 tests
2017-11-29 16:54:29 +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
Rebecca Law
b6c348bc99 Merge pull request #1444 from alphagov/revert-config-change
Remove SQLALCHEMY_ECHO for test
2017-11-29 16:46:40 +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
95fd1e8c31 Merge pull request #1434 from alphagov/pyup-update-pytest-3.2.5-to-3.3.0
Update pytest to 3.3.0
2017-11-29 14:52:53 +00:00