Commit Graph

508 Commits

Author SHA1 Message Date
Leo Hemsted
ee2bec2f72 pin marshmallow-sqlalchemy
to keep marshmallow <=3.0 dep
2020-12-31 13:56:18 +00:00
Leo Hemsted
156c7aa32a bump python client
brings in jwt2.0 compat
2020-12-31 13:56:04 +00:00
Leo Hemsted
1da16eda23 freeze reqs 2020-12-31 13:55:37 +00:00
Chris Hill-Scott
b6734d25d0 Bump utils to 43.5.9
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.8...43.5.9
2020-12-18 15:37:15 +00:00
Chris Hill-Scott
4e009af2f7 Bump utils to 43.5.8
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.7...43.5.8
2020-12-18 14:35:16 +00:00
Pea Tyczynska
4fc3f95c41 Increase email size limit to 2MBby pulling in new utils
This is because GOV.UK has hit the email size limit with their
weekly digest email.
2020-12-16 15:59:49 +00:00
Chris Hill-Scott
2165cbaf76 Bump utils to 43.5.6
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.4...43.5.6
2020-12-11 10:56:06 +00:00
Leo Hemsted
dc881b262e bump utils
this is to fix pip errors due to bad requirements
2020-12-07 14:35:06 +00:00
Chris Hill-Scott
a497788740 Bump utils to 43.5.2
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/808/files

Changes:
- https://github.com/alphagov/notifications-utils/compare/43.5.1...43.5.2
2020-11-30 10:52:48 +00:00
Tom Byers
2021555a07 Bump utils to 43.5.1
Brings in
https://github.com/alphagov/notifications-utils/pull/807
which removes a hack we had in our email template
to deal with this bug:

https://www.pivotaltracker.com/story/show/161183433

This behaviour is no longer happening so this
removes the hack.

See
https://www.pivotaltracker.com/story/show/161183433/comments/219297211
for evidence of the change in behaviour.
2020-11-18 16:43:22 +00:00
Katie Smith
47e427d0a9 Bump notifications-utils to 43.5.0
This version changes the `.fragment_count` method of the
`BaseSMSTemplate` class to take extended GSM characters into account.
2020-11-17 09:46:26 +00:00
Rebecca Law
2e114b7404 Bump utils requirement 2020-11-16 14:04:37 +00:00
Rebecca Law
171bc74c69 Rename check_character_count method to check_is_message_to_long.
Add different error message for email and text if content is too long.
Use utils version with is_message_too_long method implemented for email templates.
2020-11-09 16:06:57 +00:00
Katie Smith
4582433fdf Freeze requirements 2020-11-06 10:56:52 +00:00
Katie Smith
c4075f1fc0 Revert "Tailor message-too-long error message depending on the notification type" 2020-11-03 10:55:15 +00:00
Pea Tyczynska
9708b09ba3 Tailor message-too-long error message
depending on the notification type.

Up until now, only sms messages could get message-too-long error,
but now we also need to validate the size of email messages, so
the message content needs to be tailored to the notification type.
2020-10-29 14:07:48 +00:00
Chris Hill-Scott
28f01bd776 Use utils template to format broadcast content
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/801

Formats the content of the template at the time of creating the event.
This means that any downstream code (eg Celery tasks) can assume the
content is already formatted correctly.

Also, these downstream tasks don’t  know which template the broadcast
was created from, so if we support personalisation in the future this is
the most sensible place to bring together the template and the
personalisation.

---

I had to re-create some of the deleted code from utils for stuff like
formatting the timestamp to the CAP standard.
2020-10-27 10:55:26 +00:00
Chris Hill-Scott
29ff625a4b Bump utils to 42.2.1
Changes: https://github.com/alphagov/notifications-utils/compare/42.2.0...42.2.1
2020-09-29 12:34:44 +01:00
Chris Hill-Scott
379a227a1d Bump utils to 42.2.0
Increases CSV row limit from 50,000 to 100,000

Changes: https://github.com/alphagov/notifications-utils/compare/42.0.0...42.2.0
2020-09-25 18:16:14 +01:00
David McDonald
5b2dee5ddb Bump utils to 42.0.0
Requires unit test updating as we now expect broadcast event areas to
be a dict containing a list of areas and simple polygons.
2020-09-14 15:21:55 +01:00
David McDonald
288e3ae811 Bring in latest version of utils to fix link breaking bug
Fixes https://github.com/alphagov/notifications-utils/pull/784

Note, also is a breaking change of the utils, see
https://github.com/alphagov/notifications-utils/pull/769
but I don't believe it requires any changes on the API because of this
2020-09-10 14:32:02 +01:00
David McDonald
86565fcee9 make freeze 2020-09-07 14:24:13 +01:00
David McDonald
1b36a75927 Dont upgrade flask marshmallow as breaks things 2020-08-18 12:04:48 +01:00
David McDonald
bc5a5cf1ab make freeze requirements 2020-08-18 10:00:58 +01:00
Leo Hemsted
1c48e2efb2 reqs bump 2020-08-14 10:47:28 +01:00
Katie Smith
baebc5bdaf Bump eventlet
dnspython had been changed from 1.16.0 to 2.0.0 in a previous commit,
but this was not compatible with eventlet 0.25.2. This bumps eventlet to
a later version, which has the effect of downgrading dnspython again.
2020-07-31 10:36:09 +01:00
Katie Smith
4931fc396c Bump utils to 40.6.0
This brings in validation for invalid characters in address lines.
2020-07-31 08:58:56 +01:00
David McDonald
34538bcad8 Fix risk of uncaught exceptions due to gds metrics
Similar to https://github.com/alphagov/notifications-admin/pull/3510

Because of https://github.com/alphagov/gds_metrics_python/pull/8
2020-07-10 10:37:09 +01:00
Leo Hemsted
61a5730596 add more friendly datetime validator to jsonschema
add `datetime` format (note, not the built-in `date-time`) to our json
schemas. this uses the iso8601 library to try and parse the string.

also, move `strict-rfc3339` and `rfc3987` (used by jsonschema to
validate `date-time` and `uri` formats respectively from test
requirements to regular requirements. if they're not installed,
validation silently succeeds, so validation wouldnt reject anything bad
on prod, only in unit tests.
2020-07-09 14:19:58 +01:00
Chris Hill-Scott
e9dfbeca37 Bump utils to 40.2.1
Changes: https://github.com/alphagov/notifications-utils/compare/40.0.0...40.2.1
2020-07-03 14:27:28 +01:00
David McDonald
12f460adc5 Turn off statsd wrapper for synchronous statsd calls during POSTs
This commit turns off StatsD metrics for the following
- the `dao_create_notification` function
- the `user-agent` metric
- the response times and response codes per flask endpoint

This has been done with the purpose of not having the creation of text
messages or emails call out to StatsD during the request process. These
are the three current metrics that are currently called during the
processing of one of those requests and so have been removed from the
API.

The reason for removing the calls out to StatsD when processing a
request to send a notification is that we have seen two incidents
recently affected by DNS resolution for StatsD (either by a slow down in
resolution time or a failure to resolve). These POST requests are our
most critical code path and we don't want them to be affected by any
potential unforeseen trouble with StatsD DNS resolution.

We are not going to miss the removal of these metrics.
- the `dao_create_notification` metric is rarely/never looked at
- the `user-agent` metric is rarely/never looked at and can be got from
  our logs if we want it
- the response times and response codes per flask endpoint are already
  exposed using the gds metrics python library

I did not remove the statsd metrics from any other parts of the API
because
- As the POST notification endpoints are the main source of web traffic,
  we should have already removed most calls to StatsD which should
  greatly reduce the chance of their being any further issues with
  DNS resolution
- Some of the other metrics still provide value so no point deleting
  them if we don't need to
- The metrics on celery tasks will not affect any HTTP requests from
  users as they are async and also we do not currently have the
  infrastructure set up to replace them with a prometheus HTTP endpoint that
  can be scraped so this would require more work
2020-06-29 12:40:22 +01:00
Chris Hill-Scott
3ffdb3093b Revert "Revert "Merge pull request #2887 from alphagov/cache-the-serialised-things""
This reverts commit 7e85e37e1d.
2020-06-26 14:10:12 +01:00
Chris Hill-Scott
7e85e37e1d Revert "Merge pull request #2887 from alphagov/cache-the-serialised-things"
This reverts commit b8c2c6b291, reversing
changes made to 351aca2c5a.
2020-06-26 13:42:44 +01:00
Chris Hill-Scott
6a9818b5fd Cache services and API keys in memory
Same as we’ve done for templates.

For high volume services this should mean avoiding calls to external
services, either the database or Redis.

TTL is set to 2 seconds, so that’s the maximum time it will take for
revoking an API key or renaming a service to propagate.

Some of the tests created services with the same service ID. This
caused intermittent failures because the cache relies on unique service
IDs (like we have in the real world) to key itself.
2020-06-24 08:46:13 +01:00
Pea Tyczynska
7a4f5a4bff Refactor crown dependency check 2020-06-22 18:14:22 +01:00
Pea Tyczynska
ef9f3c1e5f Make sure we check if a service can send to number harmoniously
We were checking this separately in two places in the code. Now
we will have this logic in one place, in validators.

Also pull in utils version that recognises crown depenency numbers
as international.
2020-06-19 15:59:15 +01:00
Leo Hemsted
728e5eee24 re-enable statsd (and cache statsd DNS lookup)
see https://github.com/alphagov/notifications-utils/pull/752 for
implementation details. Cache DNS for 15 seconds. Note: This cache is
per eventlet, so concurrent requests will handle their requests
separately, but the cache does persist between sequential requests.

re-enable statsd for all environments.
2020-06-18 11:20:00 +01:00
Leo Hemsted
faa8faa0c4 bump prometheus-client to 0.7.1
there's multiple performance improvements from prometheus-client 0.2.0.
pin this bump while we wait for gds metrics client to increase its
dependency
2020-06-12 14:52:22 +01:00
Leo Hemsted
bd433ad24f bump utils to fix statsd timing bug
statsd timing should always be in seconds, not milliseconds
2020-06-11 15:01:15 +01:00
Chris Hill-Scott
0f353739f5 Bump utils to 39.4.3
Brings in a bug fix for when a personalisation value is an empty list.
2020-06-09 10:45:09 +01:00
David McDonald
a497f1b945 Bump utils to 39.4.2 to fix whitespace strip bug
https://github.com/alphagov/notifications-utils/pull/742

We had been seeing phone numbers making it through in jobs containing
this no-break space which were then causing errors as we could not
process the job as it thought it was an invalid number. This should
solve the problem and strip that special character.
2020-06-01 11:12:05 +01:00
Chris Hill-Scott
cac24bfc5e Bump utils to 39.4.1 2020-05-26 11:20:15 +01:00
Chris Hill-Scott
14d5db58f4 Bump utils to 39.4.0
Adds delivery estimates for letters posted to Europe or the rest of the
world.
2020-05-26 11:20:14 +01:00
Katie Smith
e770108ec4 Update sqlalchemy from 1.3.13 to 1.3.17 2020-05-22 10:43:29 +01:00
Katie Smith
20e97bf78a Update psycopg2-binary from 2.8.4 to 2.8.5 2020-05-22 10:41:16 +01:00
Katie Smith
ba38a2d5dd Update marshmallow from 2.20.5 to 2.21.0 2020-05-22 10:38:27 +01:00
Katie Smith
8c72dabbe8 Update marshmallow-sqlalchemy from 0.22.3 to 0.23.0 2020-05-22 10:36:21 +01:00
Katie Smith
bd0ba67889 Update eventlet from 0.25.1 to 0.25.2 2020-05-22 10:34:13 +01:00
Katie Smith
eae99f7504 Update flask from 1.1.1 to 1.1.2 2020-05-22 10:31:15 +01:00
Katie Smith
d06c7adb82 Update flask-migrate from 2.5.2 to 2.5.3 2020-05-22 10:29:16 +01:00