Commit Graph

4782 Commits

Author SHA1 Message Date
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
Rebecca Law
d3017da94a Merge pull request #1438 from alphagov/use-reply-to-in-send-to-provider
Use reply to in send to provider
2017-11-29 14:52:26 +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
Richard Chapman
c14b396deb Merge pull request #1443 from alphagov/rc_increase_gunicorn_threads
Increased Gunicorn threads
2017-11-29 14:25:18 +00:00
Richard Chapman
349887178c Increased Gunicorn threads
Increased Gunicorn threads to 10 on staging to test if there is a
performance increase when testing request per second. Increased to 10.
Gunicorn recommend 2 x cores + 1 however on PaaS the number of cores
is not consistent.
2017-11-29 14:13:26 +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
Leo Hemsted
82acec87b6 flake8 the entire repo now that the tests are good 👌 2017-11-28 17:29:43 +00:00
Leo Hemsted
08494ef206 more flake8. lots of unused imports and variables that didn't get used. i tried to preserve old variable names as comments when it looked like they were useful (eg when they were describing timestamps) 2017-11-28 17:23:09 +00:00
Leo Hemsted
b1cccdcc6b First batch of flake8 changes.
Many unused variables, and replacing some old fixtures with
admin_request before I realised just how many there where 😩
2017-11-28 17:00:01 +00:00
Leo Hemsted
6ff9b8526a Merge branch 'master' into pyup-update-pytest-3.2.5-to-3.3.0 2017-11-28 15:33:47 +00:00
Leo Hemsted
363105774f Merge pull request #1439 from alphagov/flake8
Flake8
2017-11-28 15:33:07 +00:00
venusbb
5761d22822 Migration to create new database table service_callback_api 2017-11-28 15:25:15 +00:00
Leo Hemsted
90e9a2f1b3 use flake8 instead of pycodestyle
since there are thousands and thousands of errors in the tests files
at the moment, i propose fixing those errors in separate PR for now.
2017-11-28 14:28:01 +00:00
Leo Hemsted
28088428f1 flake8 - misc flake8 errs.
* unused variables
* variables in loops overshadowing imports
* excepts with no defined exc type (tried to avoid `except Exception` too)
* history mapper is still too complex
* default variables should never be mutable
2017-11-28 14:28:01 +00:00
Leo Hemsted
28d5f9b87f flake8 - remove unused imports and ensure they're always at the top of the file 2017-11-28 14:28:01 +00:00
Leo Hemsted
043dee5a54 ensure no tests share the same name (using flake8's checker) 2017-11-28 14:28:01 +00:00
Leo Hemsted
3ee351b802 remove unused db.py and add flake8 config 2017-11-28 14:26:40 +00:00
Leo Hemsted
9a0c01fee5 Merge pull request #1436 from alphagov/click-tweaks
Click tweaks
2017-11-28 14:26:29 +00:00
Rebecca Law
0d86738696 Merge branch 'master' into use-reply-to-in-send-to-provider 2017-11-28 13:20:26 +00:00
Rebecca Law
a7232381bf Merge pull request #1433 from alphagov/add-reply-to-notifications
Populate reply-to-text field in notifications
2017-11-28 13:19:36 +00:00
Leo Hemsted
5b7118973e take advantage of click's type validation/coercion
(saves us having to write the stuff ourselves). Also adds a small
click plugin to do datetime parsing.

Sample output:

```
[leohemsted:~/dev/api]$ flask command create_provider_rates --help
Usage: flask command create_provider_rates [OPTIONS]

  Backfill rates for a given provider

Options:
  -p, --provider_name [mmg|firetext|ses]
                                  [required]
  -c, --cost FLOAT                Cost (pence) per message including decimals
                                  [required]
  -d, --valid_from DATE           [required]
  --help                          Show this message and exit.
[leohemsted:~/dev/api]$ flask command create_provider_rates -p ses -c 1.234 -d invalid
Usage: flask command create_provider_rates [OPTIONS]

Error: Invalid value for "-d" / "--valid_from": Could not parse datetime string "invalid" formatted as %Y-%m-%dT%H:%M:%S
```
2017-11-28 12:50:29 +00:00
Rebecca Law
b0d88ec08c Updates as per review comments 2017-11-28 11:05:56 +00:00
Leo Hemsted
300ff0ebf6 Merge pull request #1435 from alphagov/fix-bad-test
fix test that did not depend on the notify-db-session fixture, so left a messy db
2017-11-28 11:02:55 +00:00
Leo Hemsted
2b54c2308b fix test that did not depend on the notify-db-session fixture, so left a messy db 2017-11-28 10:42:54 +00:00
Leo Hemsted
721202b44f use more click functionality to reduce our own codes' complexity 2017-11-28 10:35:46 +00:00
Leo Hemsted
fa3b48b357 Merge pull request #1421 from alphagov/celery-fix
celery.task.retry exc param should be a throwable.
2017-11-28 10:19:14 +00:00
pyup-bot
8b6036e0e2 Update pytest from 3.2.5 to 3.3.0 2017-11-27 22:37:37 +00:00
Rebecca Law
ab5b7c20a7 Use sms sender or reply to email address of the Notify service in create_2fa_code depending on message type. 2017-11-27 16:52:52 +00:00
Rebecca Law
caf810eb76 Select sms sender or email reply to when creating a 2fa code notification 2017-11-27 16:49:18 +00:00
Venus Bailey
9af2b54e48 Merge pull request #1413 from alphagov/pyup-update-boto3-1.4.7-to-1.4.8
Update boto3 to 1.4.8
2017-11-27 16:09:25 +00:00
Rebecca Law
03c3ebbbe7 Update send_to_providers and create_dvla_file_contents_for_notifications to use notification.reply_to_text.
The next thing to do is to stop updating the notification to sender mapping tables.
2017-11-27 15:24:16 +00:00
Leo Hemsted
1e4a480298 only catch s3 and db errors in build-dvla-file-for-job
this reduces the amount of error messages we log (we'll no longer log
at error level when build-dvla-file-for-job retries while waiting for
the task to finish), and make sure we retry in those cases above - db
or s3 having temporary troubl
2017-11-27 15:11:58 +00:00