Commit Graph

322 Commits

Author SHA1 Message Date
Katie Smith
6544666cd2 Merge pull request #1846 from alphagov/pyup-update-marshmallow-2.15.0-to-2.15.1
Update marshmallow to 2.15.1
2018-05-01 14:47:59 +01:00
Katie Smith
2619bc1002 Merge pull request #1843 from alphagov/pyup-update-notifications-python-client-4.8.1-to-4.8.2
Update notifications-python-client to 4.8.2
2018-05-01 14:47:48 +01:00
Leo Hemsted
897ab93148 zendesk instead of deskpro 2018-04-27 16:36:39 +01:00
pyup-bot
f7df64522a Update marshmallow from 2.15.0 to 2.15.1 2018-04-26 03:55:47 +01:00
pyup-bot
adfb0a5367 Update notifications-python-client from 4.8.1 to 4.8.2 2018-04-25 10:41:46 +01:00
Chris Hill-Scott
308511e0ed Bump utils to normalise newlines in text messages
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/460
2018-04-12 11:13:02 +01:00
Chris Hill-Scott
c9882e2f9c Bump utils to improve plain text email formatting
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/438
- [x] https://github.com/alphagov/notifications-utils/pull/450
- [x] https://github.com/alphagov/notifications-utils/pull/454

Changes:
- https://github.com/alphagov/notifications-utils/compare/25.3.0...26.2.0
2018-04-10 11:14:48 +01:00
Leo Hemsted
aa7a33c859 Merge pull request #1815 from alphagov/pyup-update-sqlalchemy-1.2.5-to-1.2.6
Update sqlalchemy to 1.2.6
2018-04-09 15:17:14 +01:00
Leo Hemsted
8e73961f65 add new redis template usage per day key
We've run into issues with redis expiring keys while we try and write
to them - short lived redis TTLs aren't really sustainable for keys
where we mutate the state. Template usage is a hash contained in redis
where we increment a count keyed by template_id each time a message is
sent for that template. But if the key expires, hincrby (redis command
for incrementing a value in a hash) will re-create an empty hash.

This is no good, as we need the hash to be populated with the last
seven days worth of data, which we then increment further. We can't
tell whether the hincrby created the key, so a different approach
entirely was needed:

* New redis key: <service_id>-template-usage-<YYYY-MM-DD>. Note: This
  YYYY-MM-DD is BTC time so it lines up nicely with ft_billing table
* Incremented to from process_notification - if it doesn't exist yet,
  it'll be created then.
* Expiry set to 8 days every time it's incremented to.

Then, at read time, we'll just read the last eight days of keys from
Redis, and sum them up. This works because we're only ever incrementing
from that one place - never setting wholesale, never recreating the
data from scratch. So we know that if the data is in redis, then it is
good and accurate data.

One thing we *don't* know and *cannot* reason about is what no key in
redis means. It could be either of:

* This is the first message that the service has sent today.
* The key was deleted from redis for some reason.

Since we set the TTL to so long, we'll never be writing to a key that
previously expired. But if there is a redis (or operator) error and the
key is deleted, then we'll have bad data - after any data loss we'll
have to rebuild the data.
2018-04-03 16:12:54 +01:00
Chris Hill-Scott
c9b297a3d4 Bump utils to 25.2.3
To bring in:
- [x] https://github.com/alphagov/notifications-utils/pull/436

Changes:
- https://github.com/alphagov/notifications-utils/compare/25.2.2...25.2.3
2018-04-03 12:10:45 +01:00
pyup-bot
691a44f1cf Update sqlalchemy from 1.2.5 to 1.2.6 2018-03-30 21:49:12 +01:00
Chris Hill-Scott
eebd754a58 Don’t show HTML entities in plain text emails
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/427
2018-03-27 14:44:41 +01:00
Chris Hill-Scott
af9e9aa1f5 Update utils to fix size of non-gov logos
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/421
2018-03-23 14:56:42 +00:00
kentsanggds
6e9bab5544 Merge pull request #1778 from alphagov/pyup-update-notifications-python-client-4.7.2-to-4.8.1
Update notifications-python-client to 4.8.1
2018-03-23 10:35:16 +00:00
pyup-bot
62e5c9742b Update pyjwt from 1.6.0 to 1.6.1 2018-03-18 13:39:46 +00:00
pyup-bot
4fd472f53c Update notifications-python-client from 4.7.2 to 4.8.1 2018-03-16 14:55:34 +00:00
kentsanggds
421d358525 Merge pull request #1718 from alphagov/pyup-update-cffi-1.11.0-to-1.11.5
Update cffi to 1.11.5
2018-03-16 11:29:38 +00:00
Richard Chapman
3e48903b23 Merge pull request #1756 from alphagov/rc_send_template_preview_one_page
Updated the notification template endpoint to extract the pdf page
2018-03-12 14:46:38 +00:00
Ken Tsang
a29f4ed117 Removed comments as no longer necessary 2018-03-12 12:45:42 +00:00
kentsanggds
df5cdc239f Merge pull request #1736 from alphagov/pyup-update-pyjwt-1.5.3-to-1.6.0
Update pyjwt to 1.6.0
2018-03-12 10:34:42 +00:00
Richard Chapman
04048aa220 Updated the notification template endpoint to extract the pdf page
before sending it to template preview. This stops the whole pdf file
being sent to template preview for each page which is really inefficient
on network traffic and memory usage.

* Added logic to the endpoint to extract the specific page requested
* Updated tests to add a mock for the new call to utils
* Added a new test case for exceptions in the PDF extraction process
2018-03-09 15:50:43 +00:00
kentsanggds
d393342430 Merge branch 'master' into pyup-update-pyjwt-1.5.3-to-1.6.0 2018-03-09 14:21:10 +00:00
Chris Hill-Scott
f902ba476c Bring in refactored CSV processing
Shouldn’t be any functional changes here, just things being named more
clearly.
2018-03-08 13:12:00 +00:00
Chris Hill-Scott
c029927fde Merge pull request #1733 from alphagov/remove-dvla
Remove anything to do with DVLA format letters
2018-03-08 10:58:34 +00:00
pyup-bot
e2a308a703 Update sqlalchemy from 1.2.4 to 1.2.5 2018-03-06 19:17:29 +00:00
pyup-bot
71bf8d4a22 Update pyjwt from 1.5.3 to 1.6.0 2018-03-03 17:24:20 +00:00
Chris Hill-Scott
7ef6af2d14 Remove anything to do with DVLA format letters 2018-03-02 14:13:12 +00:00
pyup-bot
c8c2add9bb Update cffi from 1.11.0 to 1.11.5 2018-02-27 18:27:17 +00:00
Leo Hemsted
ab95a4501b bump requirements
notably, remove awscli and boto3 - they're both required by utils, and
are generating a lot of PR noise
2018-02-27 11:25:57 +00:00
pyup-bot
7638df74a9 Update eventlet from 0.22.0 to 0.22.1 2018-02-17 18:25:26 +00:00
Leo Hemsted
83b26f4a93 use psycopg2-binary to supress warnings 2018-02-15 14:20:25 +00:00
Leo Hemsted
15c2a9461e Merge pull request #1658 from alphagov/pyup-update-boto3-1.5.27-to-1.5.28
Update boto3 to 1.5.28
2018-02-14 11:48:35 +00:00
Leo Hemsted
10ebf4ae02 Merge pull request #1659 from alphagov/pyup-update-awscli-1.14.37-to-1.14.38
Update awscli to 1.14.38
2018-02-14 11:48:21 +00:00
Leo Hemsted
f070b4eab1 Update requirements.txt
email validation
2018-02-14 11:31:17 +00:00
pyup-bot
a6cf634ab6 Update awscli from 1.14.37 to 1.14.38 2018-02-13 23:25:22 +00:00
pyup-bot
ea13919190 Update boto3 from 1.5.27 to 1.5.28 2018-02-13 23:25:18 +00:00
Richard Chapman
362dcb9636 Merge pull request #1654 from alphagov/pyup-update-awscli-1.14.32-to-1.14.37
Update awscli to 1.14.37
2018-02-13 12:19:27 +00:00
Richard Chapman
0aa2a36f6b Merge pull request #1653 from alphagov/pyup-update-boto3-1.5.22-to-1.5.27
Update boto3 to 1.5.27
2018-02-13 12:19:11 +00:00
Richard Chapman
ad8928370c Merge pull request #1638 from alphagov/pyup-update-psycopg2-2.7.3.2-to-2.7.4
Update psycopg2 to 2.7.4
2018-02-13 12:18:39 +00:00
pyup-bot
a56849aee5 Update awscli from 1.14.32 to 1.14.37 2018-02-13 01:10:33 +00:00
pyup-bot
da12acab36 Update boto3 from 1.5.22 to 1.5.27 2018-02-13 01:10:24 +00:00
Leo Hemsted
24fab13d8a fix bug where we s3upload crashed if you didn't supply tags 2018-02-12 15:50:05 +00:00
Leo Hemsted
1ef6718918 Merge pull request #1646 from alphagov/add-tags-to-pdf-letters
upload letter pdfs with retention tag
2018-02-12 15:03:53 +00:00
Leo Hemsted
093e8083e0 upload letter pdfs with retention tag
so we can delete them automatically with s3's lifecycle policy
2018-02-09 17:13:37 +00:00
Leo Hemsted
cc9bea17d1 Merge pull request #1619 from alphagov/pyup-update-notifications-python-client-4.7.1-to-4.7.2
Update notifications-python-client to 4.7.2
2018-02-09 14:58:59 +00:00
pyup-bot
7edaa8dc51 Update psycopg2 from 2.7.3.2 to 2.7.4 2018-02-08 15:37:12 +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
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
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