Commit Graph

358 Commits

Author SHA1 Message Date
Leo Hemsted
d2f5da317c bump utils
brings in changes to fix crash in GSM downgrading
2018-08-15 16:06:50 +01:00
Athanasios Voutsadakis
6786ff8fde Use the zipkin headers from utils version 30.0.0 2018-08-14 13:20:21 +01:00
Tom Byers
7669ffa8ef Bump notifications-utils to 29.3.6
Brings in:

https://github.com/alphagov/notifications-utils/pull/513

Only effects the email branding preview at
`/_email` so only used by platform admins.
2018-08-14 10:30:35 +01:00
Leo Hemsted
f279bbbd33 bump utils to fix slow notification rendering 2018-08-09 14:07:06 +01:00
Chris Hill-Scott
84b05ab29c make freeze-requirements 2018-08-03 16:13:41 +01:00
Chris Hill-Scott
0d2de75e84 Bump utils to 29.3.4
https://github.com/alphagov/notifications-utils/compare/29.3.2...bullet-for-bullet
2018-08-03 13:57:55 +01:00
Alexey Bezhan
5bae92c738 Make pyup ignore requirements.txt
We don't want pyup.io upgrading sub-dependencies listed in the
requirements.txt file since it does it whenever a new version is
available regardless of what our application dependencies require.
2018-07-30 16:43:44 +01:00
Alexey Bezhan
2f876243ae Pin all requirements in requirements.txt
The list of top-level dependencies is moved to requirements-app.txt,
which is used by `make freeze-requirements` to generate the full
list of requirements in requirements.txt.

(See alphagov/notifications-api#1938 for details.)
2018-07-30 16:43:03 +01:00
pyup-bot
65159ff23b Update notifications-python-client from 4.8.2 to 4.10.0 2018-07-24 15:43:37 +01:00
Chris Hill-Scott
534567a27b Fix mismatch version numbers
Forgot to update both…
2018-07-17 11:50:58 +01:00
Chris Hill-Scott
fbc7960ebe Bump utils to fix smart quotes in email addresses
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/500
2018-07-17 11:22:29 +01:00
Leo Hemsted
0566e89aee Pin wtforms==2.1
Tests fail with `wtforms==2.2.1`.  We're not sure of the reason but on
production this version is used and locally it's not, because we only
require flask-wtforms, which doesn't pin its requirements at all. We
should probably pin all requirements from jenkins onwards to prevent
this kind of thing happening again.
2018-07-05 17:44:23 +01:00
Chris Hill-Scott
34abfa0390 Bump utils to make letters screenreader-accessible
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/497
2018-07-02 13:54:56 +01:00
pyup-bot
fd3043b45a Update pytz from 2018.4 to 2018.5 2018-06-29 08:34:52 +01:00
Chris Hill-Scott
61e0e7e24e Merge pull request #2117 from alphagov/bump-utils-autolink-sms
Bump utils to link URLs in text message previews
2018-06-28 09:32:29 +01:00
Chris Hill-Scott
22bffe779d Bump utils to link URLs in text message previews 2018-06-28 09:18:17 +01:00
Chris Hill-Scott
81dc9a0092 Merge pull request #2063 from alphagov/pyup-update-flask-0.12.2-to-1.0.2
Update flask to 1.0.2
2018-06-18 13:51:14 +01:00
Chris Hill-Scott
4b37ca4021 Don’t duplicate columns in example spreadsheet
If a template has a placeholder like `((email address))` then the sample
spreadsheet and CSV file have the email column twice.

Trying to upload this spreadsheet will result in a ‘duplicate column’
error.

This commit fixes it so that the column will only appear once.
2018-06-08 13:28:02 +01:00
pyup-bot
386724a98b Update flask from 0.12.2 to 1.0.2 2018-05-30 14:01:18 +01:00
Katie Smith
58cc1604a7 Bump utils and sanitise header values
Updated notifications-utils. This brings in
- the renamed character sanitization classes
- the change to allow unicode in letter addresses (this lets us delete
a test that is no longer relevant)

Also replaced non-ascii characters in headers. This fixes a bug where
non-ascii characters in a CSV filename were causing errors since the
filename is also used in the header.
2018-05-25 10:34:47 +01:00
pyup-bot
a2d9cbfde8 Update pyexcel-xls from 0.5.6 to 0.5.7 2018-05-10 23:26:16 +01:00
pyup-bot
d29885f15b Update pyexcel-io from 0.5.6 to 0.5.7 2018-05-02 23:27:01 +01:00
Chris Hill-Scott
b443c299c3 Merge pull request #2058 from alphagov/pyup-update-gunicorn-19.8.0-to-19.8.1
Update gunicorn to 19.8.1
2018-05-02 09:34:15 +01:00
Chris Hill-Scott
fa3b7603f4 Bump utils to fix large CSV bug
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/473

Changes: https://github.com/alphagov/notifications-utils/compare/27.0.0...fix-too-many-rows-exception
2018-05-01 19:49:45 +01:00
pyup-bot
f8723bccf0 Update gunicorn from 19.8.0 to 19.8.1 2018-04-30 19:49:55 +01:00
pyup-bot
fbbc2de13e Update gunicorn from 19.7.1 to 19.8.0 2018-04-28 20:34:52 +01:00
Leo Hemsted
2ceea61bb1 Merge pull request #2034 from alphagov/zendesk
send zendesk rather than deskpro tickets
2018-04-27 14:33:31 +01:00
pyup-bot
7cf8775435 Update notifications-python-client from 4.8.1 to 4.8.2 2018-04-25 10:40:45 +01:00
Leo Hemsted
d675ceb5c2 send zendesk rather than deskpro tickets 2018-04-24 17:37:15 +01:00
Chris Hill-Scott
777bfa2244 Merge pull request #2014 from alphagov/redis-spike-CHS
Use Redis to cache API calls in admin app
2018-04-18 13:26:12 +01:00
Chris Hill-Scott
24dbe7b7b1 Add Redis cache between admin and API
Most of the time spent by the admin app to generate a page is spent
waiting for the API. This is slow for three reasons:

1. Talking to the API means going out to the internet, then through
   nginx, the Flask app, SQLAlchemy, down to the database, and then
   serialising the result to JSON and making it into a HTTP response
2. Each call to the API is synchronous, therefore if a page needs 3 API
   calls to render then the second API call won’t be made until the
   first has finished, and the third won’t start until the second has
   finished
3. Every request for a service page in the admin app makes a minimum
   of two requests to the API (`GET /service/…` and `GET /user/…`)

Hitting the database will always be the slowest part of an app like
Notify. But this slowness is exacerbated by 2. and 3. Conversely every
speedup made to 1. is multiplied by 2. and 3.

So this pull request aims to make 1. a _lot_ faster by taking nginx,
Flask, SQLAlchemy and the database out of the equation. It replaces them
with Redis, which as an in-memory key/value store is a lot faster than
Postgres. There is still the overhead of going across the network to
talk to Redis, but the net improvement is vast.

This commit only caches the `GET /service` response, but is written in
such a way that we can easily expand to caching other responses down the
line.

The tradeoff here is that our code is more complex, and we risk
introducing edge cases where a cache becomes stale. The mitigations
against this are:
- invalidating all caches after 24h so a stale cache doesn’t remain
  around indefinitely
- being careful when we add new stuff to the service response

---

Some indicative numbers, based on:
- `GET http://localhost:6012/services/<service_id>/template/<template_id>`
- with the admin app running locally
- talking to Redis running locally
- also talking to the API running locally, itself talking to a local
  Postgres instance
- times measured with Chrome web inspector, average of 10 requests

╲ | No cache | Cache service | Cache service and user | Cache service, user and template
-- | -- | -- | -- | --
**Request time** | 136ms | 97ms | 73ms | 37ms
**Improvement** | 0% | 41% | 88% | 265%

---

Estimates of how much storage this requires:

- Services: 1,942 on production × 2kb = 4Mb
- Users: 4,534 on production × 2kb = 9Mb
- Templates: 7,079 on production × 4kb = 28Mb
2018-04-10 12:58:35 +01:00
pyup-bot
a6e8e4979f Update pytz from 2018.3 to 2018.4 2018-04-10 11:56:30 +01:00
Chris Hill-Scott
53556ee56b Bump utils to 25.2.3 2018-04-03 12:08:59 +01:00
Chris Hill-Scott
f1d609f2ab Merge pull request #1988 from alphagov/pyup-update-pyexcel-xlsx-0.5.5-to-0.5.6
Update pyexcel-xlsx to 0.5.6
2018-03-28 09:55:08 +01:00
pyup-bot
c5dae849db Update pyexcel-xlsx from 0.5.5 to 0.5.6 2018-03-26 23:41:09 +01:00
pyup-bot
a5b4fe42a3 Update pyexcel from 0.5.7 to 0.5.8 2018-03-26 22:40:04 +01:00
Chris Hill-Scott
4b2641d977 Merge pull request #1962 from alphagov/pyup-update-notifications-python-client-4.7.2-to-4.8.1
Update notifications-python-client to 4.8.1
2018-03-21 14:34:28 +00:00
pyup-bot
3b95a52ea4 Update notifications-python-client from 4.7.2 to 4.8.1 2018-03-16 14:54:33 +00:00
pyup-bot
b9420dcb8b Update pyexcel-xls from 0.5.5 to 0.5.6 2018-03-15 20:09:40 +00:00
Chris Hill-Scott
f6f5faa361 Bring in refactored CSV processing
Shouldn’t be any functional changes here, just things being named more
clearly.
2018-03-08 13:30:20 +00:00
Chris Hill-Scott
1391f12239 Remove anything to do with DVLA format letters 2018-03-02 14:30:45 +00:00
Chris Hill-Scott
a4424e999f Catch duplicate recipient columns in spreadsheets
If someone has duplicate recipient columns in their file we don’t know
which one to use. This commit adds an error message which should help
them fix the duplication.

This commit doesn’t go to the extra effort to actually show the
correct values for duplication in the preview. Don’t think it’s worth
the effort/complexity for how infrequently we’ve seen this error.

Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/376
2018-03-02 13:18:04 +00:00
Chris Hill-Scott
0934843815 Add original file data to job downloads
When downloading a report of a which messages from a job have been
delivered and which have failed we currently only include the Notify
data. This makes it hard to reconcile or do analysis on these reports,
because often the thing that people want to reconcile on is in the data
they’ve uploaded (eg a reference number).

Here’s an example of a user talking about this problem:

> It would also be helpful if the format of the delivery and failure
> reports could include the fields from the recipient's file. While I
> can, of course,  cross-reference one report with the other it would be
> easier if I did not have to. We send emails to individuals within
> organisations and it is not always easy to establish the organisation
> from a recipient's email address. This is particularly important when
> emails fail to be delivered as we need to contact the organisation to
> establish a new contact.

– ticket 677

We’ve also seen it when doing research with a local council.

This commit takes the original file, the data from the API, and munges
them together.
2018-02-28 10:51:13 +00:00
Chris Hill-Scott
b731690736 Rremove awscli and boto3 from requirements
They're both brought in by utils, and are generating a lot of PR noise
by being on every repo.
2018-02-27 15:20:06 +00:00
pyup-bot
29643231f9 Update eventlet from 0.22 to 0.22.1 2018-02-17 18:24:25 +00:00
Leo Hemsted
9716983f83 Update requirements.txt
email validation
2018-02-14 11:31:29 +00:00
Chris Hill-Scott
01a2852a69 Merge pull request #1849 from alphagov/pyup-update-pytz-2017.3-to-2018.3
Update pytz to 2018.3
2018-02-12 15:07:16 +00:00
pyup-bot
6c22cd0446 Update pytz from 2017.3 to 2018.3 2018-02-09 08:18:09 +00:00
pyup-bot
04b6d6eda3 Update notifications-python-client from 4.7.1 to 4.7.2 2018-02-01 16:23:57 +00:00
Leo Hemsted
31112c9ecf run gunicorn with eventlet
this massively increases the horizontal parallellability by using async workers
2018-02-01 14:56:52 +00:00