Commit Graph

4782 Commits

Author SHA1 Message Date
Richard Chapman
bb15ed0d01 Commited by mistake - changed the log level back to INFO 2018-02-08 17:55:01 +00:00
Richard Chapman
632364633b Fixed typo in call, should be self.name not Task.name.
Task.name always returned None.
2018-02-08 17:47:59 +00:00
Rebecca Law
8aa829e93a Merge pull request #1622 from alphagov/reduce-logging
Reducing the logging for the life cycle of a notification
2018-02-08 16:57:21 +00:00
pyup-bot
7edaa8dc51 Update psycopg2 from 2.7.3.2 to 2.7.4 2018-02-08 15:37:12 +00:00
Katie Smith
269923ba28 Add Organisations endpoints
As part of this we also needed to add:
- schemas for validation
- serialize method for Organisation model
2018-02-08 15:22:21 +00:00
Katie Smith
6a79eedbce Add Organisation DAO 2018-02-08 14:44:40 +00:00
Katie Smith
d40d520d2c Add Organisation model and migration
Now that we have renamed the 'old' organisation model to email_branding,
we can create a new organisation model.
2018-02-08 14:39:25 +00:00
Leo Hemsted
08c35b3c72 downgrade lots of routine logging from error/exception to info
most of them are 400s for badly inputted phone numbers etc
2018-02-08 13:38:32 +00:00
Leo Hemsted
1326eae587 Merge pull request #1634 from alphagov/email-branding-remove-org-from-db
Email branding remove org from db
2018-02-08 13:25:41 +00:00
Leo Hemsted
37dda1d235 remove organisation from db
also make sure email branding is not nullable, because it shouldnt be
2018-02-08 11:26:10 +00:00
Leo Hemsted
7ac351d9b3 Merge pull request #1633 from alphagov/email-branding-remove-org
Email branding remove org
2018-02-08 10:59:11 +00:00
Rebecca Law
b2dfa59b1b We are not handling the case of an unknown status code sent by the SMS provider. This PR attempts to fix that.
- If the SMS client sends a status code that we do not recognize raise a ClientException and set the notification status to technical-failure
- Simplified the code in process_client_response, using a simple map.
2018-02-07 17:49:15 +00:00
Leo Hemsted
ba20010f27 remove organisation from api 2018-02-07 11:39:33 +00:00
Richard Chapman
a5343fb837 Merge pull request #1628 from alphagov/rc_updated_to_use_utils_statsd
Removed statsd from the api and use the statsd in the utils library.
2018-02-07 09:07:16 +00:00
Sakis
80b3ca8a55 Merge pull request #1627 from alphagov/async-workers
Use eventlet workers for gunicorn
2018-02-06 16:38:12 +00:00
Athanasios Voutsadakis
dc772fab3b Move config from command line args to gunicorn_config.py 2018-02-06 15:13:04 +00:00
Athanasios Voutsadakis
97e5594dfe Merge branch 'master' into async-workers 2018-02-06 14:59:21 +00:00
Leo Hemsted
fb271ee4fb Merge pull request #1630 from alphagov/fix-template-usage-page
exclude test keys from template usage page
2018-02-06 14:47:37 +00:00
Athanasios Voutsadakis
1e65c6721d Merge branch 'master' into async-workers 2018-02-06 14:42:40 +00:00
Leo Hemsted
b9446b660d exclude test keys from template usage page
they were not included in nightly task since that runs off
NotificationHistory, which doesn't include test keys. However, when you
load the page we top up the nightly stats with today's data from the
Notifications table, which *does* include test data.
2018-02-06 14:31:12 +00:00
Leo Hemsted
e8cb60eadc Merge pull request #1629 from alphagov/email-branding-fix-route
ensure old route still returns json in same shape
2018-02-06 12:50:52 +00:00
Leo Hemsted
0c67a61604 ensure old route still returns json in same shape 2018-02-06 12:10:00 +00:00
Athanasios Voutsadakis
650455806d Use - not _ 2018-02-06 11:50:40 +00:00
Leo Hemsted
37a44ab3a9 Merge pull request #1624 from alphagov/email-branding-endpoints
Email branding endpoints
2018-02-06 11:41:36 +00:00
Athanasios Voutsadakis
9307f54d9a Use eventlet workers for gunicorn
Cap their parallel connections to 1/4 of the default to play it safe
while we keep an eye on our resources utilisation
2018-02-06 11:24:01 +00:00
Leo Hemsted
2f79da8702 create, edit and use email branding instead of organisation
notable things that have been kept until migration is complete:

* passing in `organisation` to update_service will update email branding
* both `/email-branding` and `/organisation` hit the same code
* service endpoints still return organisation as well as email branding
2018-02-06 11:23:34 +00:00
Leo Hemsted
cea52929d3 Merge pull request #1621 from alphagov/email-branding-mapping-table
Email branding mapping table
2018-02-06 09:56:31 +00:00
Richard Chapman
d855b4e4ec Removed statsd from the api and use the statsd in the utils library.
The statsd code was added to the utils library a while ago, uses the
statsd from the util library and therefore consolidates the code into
once place.
2018-02-06 09:52:15 +00:00
Richard Chapman
8696f8995d Merge pull request #1610 from alphagov/pyup-update-boto3-1.5.21-to-1.5.22
Update boto3 to 1.5.22
2018-02-05 16:31:48 +00:00
Richard Chapman
3925736f5c Merge pull request #1612 from alphagov/pyup-update-awscli-1.14.31-to-1.14.32
Update awscli to 1.14.32
2018-02-05 16:31:30 +00:00
Richard Chapman
1f05bba696 Merge pull request #1623 from alphagov/rc_update_utils_add_logs_to_celery
Updated utils to the latest version and add celery logging
2018-02-05 15:47:33 +00:00
Richard Chapman
2d670e8cf0 Updated utils to the latest version. This version of utils has less
logging at info level and as such no longer prints out the celery task
timing which are found to be use to find out if a tasks has been called
but also the timing for the task. Added an extra timing message for
celery tasks so that it can be determined if the these are less frequent
than the API calls and provide more useful information
2018-02-05 14:58:02 +00:00
kentsanggds
4773e1b51b Merge pull request #1617 from alphagov/ken-set-page-count-0-fake-dvla-response
Update the dvla response data to 0 page count
2018-02-05 10:48:28 +00:00
Rebecca Law
dce79832ff As Notify matures we probably need less logging, especially to report happy path events.
This PR is a proposal to reduce the average messages we see for a single notification from about 7 messages to 2.

Messaging would change to something like this:
February 2nd 2018, 15:39:05.885	Full delivery response from Firetext for notification: 8eda51d5-cd82-4569-bfc9-d5570cdf2126
{'status': ['0'], 'reference': ['8eda51d5-cd82-4569-bfc9-d5570cdf2126'], 'time': ['2018-02-02 15:39:01'], 'code': ['000']}
February 2nd 2018, 15:39:05.885	Firetext callback return status of 0 for reference: 8eda51d5-cd82-4569-bfc9-d5570cdf2126
February 2nd 2018, 15:38:57.727	SMS 8eda51d5-cd82-4569-bfc9-d5570cdf2126 sent to provider firetext at 2018-02-02 15:38:56.716814
February 2nd 2018, 15:38:56.727	Starting sending SMS 8eda51d5-cd82-4569-bfc9-d5570cdf2126 to provider at 2018-02-02 15:38:56.408181
February 2nd 2018, 15:38:56.727	Firetext request for 8eda51d5-cd82-4569-bfc9-d5570cdf2126 finished in 0.30376038211397827
February 2nd 2018, 15:38:49.449	sms 8eda51d5-cd82-4569-bfc9-d5570cdf2126 created at 2018-02-02 15:38:48.439113
February 2nd 2018, 15:38:49.449	sms 8eda51d5-cd82-4569-bfc9-d5570cdf2126 sent to the priority-tasks queue for delivery

To somthing like this:
February 2nd 2018, 15:39:05.885	Firetext callback return status of 0 for reference: 8eda51d5-cd82-4569-bfc9-d5570cdf2126
February 2nd 2018, 15:38:49.449	sms 8eda51d5-cd82-4569-bfc9-d5570cdf2126 created at 2018-02-02 15:38:48.439113
2018-02-02 15:55:25 +00:00
Leo Hemsted
5d00abd6bc update service_email_branding mapping table alongside organisation_id 2018-02-02 12:50:53 +00:00
Leo Hemsted
6e9edc3e8a add email branding mapping table 2018-02-02 11:48:58 +00:00
Rebecca Law
a2c7acd1ac Merge pull request #1620 from alphagov/fix-despro-ticket
Fix bug with sending deskpro tickets in production.
2018-02-02 11:42:03 +00:00
Rebecca Law
cf8be03c5e Fix bug with sending deskpro tickets in production.
The NOTIFY_ENVIRONMENT variable is set to `production` from the run_paas_app script, but that is overwritten with `live` in the create_app function when starting an application.
Although this is confusing and it would be good to resolve that. It is a larger piece of work. For now I have included booth strings in the if condition, that way when we do migrate the code we will not have an issue with these two methods.
2018-02-02 11:27:58 +00:00
pyup-bot
69ce50a35e Update notifications-python-client from 4.7.1 to 4.7.2 2018-02-01 16:24:57 +00:00
Chris Hill-Scott
5349736781 Merge pull request #1618 from alphagov/pyup-update-pytest-3.3.2-to-3.4.0
Update pytest to 3.4.0
2018-01-31 14:17:11 +00:00
pyup-bot
041c9ee9b5 Update pytest from 3.3.2 to 3.4.0 2018-01-30 23:19:54 +00:00
Leo Hemsted
800fbb4c6e Merge pull request #1613 from alphagov/international-500
fix 500 when receiving delivery receipt from some international nums
2018-01-30 13:58:39 +00:00
Leo Hemsted
3d389472b8 fix 500 when receiving delivery receipt from some international nums
if the international_billing_rates.yml has `dlr: null`, that means we
don't know what delivery receipts they provide - they might not provide
any. So if we do get an update, we don't know for sure that the message
was actually delivered - lets not update it.
2018-01-30 12:08:18 +00:00
Chris Hill-Scott
aab05ac8f1 Merge pull request #1600 from alphagov/letters-for-new-services
Turn letters on by default for new services
2018-01-30 11:07:55 +00:00
Chris Hill-Scott
3ec8008d67 Merge pull request #1616 from alphagov/ea-letter-org
Add letter logo for environment agency
2018-01-30 10:41:20 +00:00
Chris Hill-Scott
f0f3e03931 Add letter logo for environment agency
Depends on:
https://github.com/alphagov/notifications-template-preview/pull/87
2018-01-29 17:29:24 +00:00
Ken Tsang
9122efc45e Update the dvla response data to 0 page count
- as the response is fake, the notifications billable_unit is left at 0, the fake dvla response should also be 0. Otherwise there will be confusing logs reporting mismatched page count and billable units which are just research ones.
2018-01-29 16:39:53 +00:00
kentsanggds
24e890fad5 Merge pull request #1614 from alphagov/ken-remove-redundant-sent-dvla-task
Remove sent to dvla task
2018-01-29 16:04:20 +00:00
Ken Tsang
54835b56e1 Remove sent to dvla task
- task not really necessary as the status is already set to 'sending' before the task is called if it is not sending i.e. in reseach mode or using a test key
2018-01-29 14:34:22 +00:00
pyup-bot
9526d12e78 Update awscli from 1.14.31 to 1.14.32 2018-01-26 23:39:54 +00:00