Commit Graph
520 Commits
Author SHA1 Message Date
Chris Hill-Scott 1802c84b8a Add handling for data types other than list/string
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/135

Also adds extra tests for:
- the exact issue that we saw in production when #867 was deployed
- what happens when `None` is passed as a placeholder value, because
  this should never get as far as the relevant bit of utils
2017-04-05 09:28:17 +01:00
Chris Hill-Scott 7943b6819b Revert "Revert "Bump utils to allow lists as placeholder values"" 2017-04-05 09:18:58 +01:00
Chris Hill-Scott cb208473c6 Revert "Bump utils to allow lists as placeholder values" 2017-04-04 15:19:53 +01:00
Chris Hill-Scott b19486ec99 Include fixes for heading spacing
Brings in
- [x] https://github.com/alphagov/notifications-utils/pull/134
2017-04-03 17:22:34 +01:00
Chris Hill-Scott 585ef8e66a Bump utils to allow lists as placeholder values
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/128

Also adds a test to make sure that passing a dictionary as a value in
the `personalisation` argument works.
2017-03-31 17:02:54 +01:00
Rebecca Law 31979c3272 Use 500 for org id 2017-03-27 17:49:09 +01:00
Rebecca Law 0705cf2f7c Update requirements.txt
pin version of six to resolve deployment issues
2017-03-27 11:12:39 +01:00
Rebecca Law 37a5ce601a Update the version of notifications-utils.
There was a problem with the address block for the DVLATemplate.

Added a countdown to the build_dvla_file.
2017-03-24 15:25:02 +00:00
Imdad Ahad 9ab6d4c68b Update boto3 2017-02-23 17:21:15 +00:00
Leo Hemsted 90dab2a32a bump utils to 13.8.0
brings in character downgrading in SMS previews
2017-02-20 11:56:32 +00:00
Chris Hill-Scott 43173870cb Bump utils to turn off Markdown links 2017-02-17 10:18:52 +00:00
bandesz 72dc93c6db Add awslogs logging for PaaS 2017-02-16 17:38:30 +00:00
Chris Hill-Scott b2267ae5fc Merge pull request #823 from alphagov/bump-utils-markdown-links
Bump utils to turn on Markdown links
2017-02-13 12:44:19 +00:00
Chris Hill-Scott 6c37686f71 Bump utils to turn on Markdown links 2017-02-08 17:01:44 +00:00
Martyn Inglis 5d0bc0abe8 Add a stop celery script into the scripts folder.
Stopping celery via upstart issues a TERM signal to the whole process group, which immediately kills the worker threads. This can lead to inconsistentcy in the state of a notification as an API call, for example, can take several seconds consequently the likelihood of the call being lost due to a restart is relatively high.

We need to ensure that we stop cleanly to ensure code deploys and autoscale events do not cause issues.

this script is called as part of a pre-stop hook in upstart, which passes a pid file location to the script. The script will then issues the TERM signal to only the master celery process. which will cleanly shut down the workers and exit.

the script will loop based on the existence of a /proc/{pid} for the celery master process. Once the file is gone the script will exit. Upstart blocks on this script before issuing kill on whatever processes may be left hanging around.

the length of the loop is a maximum 15 minutes - which is the tested max time a task may take. In reality it will exit much quicker.
2017-02-08 16:17:50 +00:00
Chris Hill-Scott 6e6d471cda Don’t strip HTML when saving templates
Right now we strip HTML from templates at the point of saving them. This
also converts stuff like ampersands to their entity form (eg &) and
this is what we save in the database.

This is a bad idea when you’re sending a text message or a letter, in
which an HTML entity makes no sense. But we still need to encode HTML in
the body of HTML emails.

The right place to do this is when rendering the templates. The code to
do this is now in utils. So this commit:
- pull in this new utils code
- removes the old
- adds some integration tests to make sure that everything is working
  as expected (more thorough unit tests are happening in utils)
2017-01-19 12:05:28 +00:00
bandesz fd66fbd719 Run API on Paas 2017-01-13 10:24:13 +00:00
Leo Hemsted 501187a9f4 bump utils to 13.0.1
brings in a fix to InvalidEmail/Phone/AddressExceptions not being
instantiated correctly. `exception.message` is not a python standard,
so we shouldn't be relying on it to transmit exception reasons -
rather we should be using `str(exception)` instead. This involved a
handful of small changes to the schema validation
2017-01-09 16:37:58 +00:00
Leo Hemsted bf0abce4a3 update python-client version
also unpin the patch version, since it shouldn't matter what patch
we're on provided that the function signatures are the same
2016-12-22 13:53:33 +00:00
Leo Hemsted 5cbe4eb5b2 use cloudfront instead of flask to serve static images
branding in emails was previously hosted from admin app - this changes
the url to be static.{domain}/images instead of {domain}/static/images,
which redirects to cloudfront.

some manipulation of the URL was required to make sure it still serves
locally rather than returning "static.localhost:6012" for example.

(if ADMIN_BASE_URL is localhost it just returns the old /static/
path)

also was able to remove DB interaction from a test. woo!
2016-12-21 16:35:16 +00:00
Chris Hill-Scott 0cc94bc87b Include content count fix
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/102
2016-12-14 15:51:59 +00:00
Chris Hill-Scott 59af44d7ab Update utils to 12.0.0
Includes:

- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
      changes which are responsible for all the changes to the API in
      this PR)

The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:

https://github.com/alphagov/notifications-utils/blob/ac20f7e99ece4935fccf39ed9d5c0fb40e45bfbc/tests/test_base_template.py#L140-L159
2016-12-13 10:57:01 +00:00
Martyn Inglis 869cf48eff Latest version 2016-12-06 16:51:46 +00:00
Chris Hill-Scott 1e4274655a Bump utils version to really bring in latest changes 2016-12-06 09:45:39 +00:00
Martyn Inglis 3342ca2993 Bumped version 2016-12-02 16:56:23 +00:00
Martyn Inglis 9fb378021c Bumped version to use latest utils
- note this is not yet published so will break.....
- sorts out an issue with service id logging
2016-12-01 17:24:23 +00:00
Martyn Inglis 9667d42008 Minor bump of utils 2016-12-01 12:47:33 +00:00
Martyn Inglis 5ae21bf1d5 Bumped requirements version 2016-12-01 11:34:38 +00:00
minglis 2e1578656b Merge pull request #735 from alphagov/caching-with-redis
Caching with redis
2016-11-25 09:06:12 +00:00
Rebecca Law 8cf324de85 Update python client from version 2.0.0 to 3.0.0 2016-11-22 14:59:14 +00:00
Martyn Inglis 7cfc58c994 Merge branch 'master' into caching-with-redis
Conflicts:
	app/celery/tasks.py
	tests/app/celery/test_tasks.py
2016-11-21 13:10:22 +00:00
Chris Hill-Scott d51c63cb6b Merge pull request #722 from alphagov/whitepace-in-personalisation
Ignore case and whitespace in personalisation keys
2016-11-11 11:33:37 +01:00
Chris Hill-Scott 8474344c9a Ignore case and whitespace in personalisation keys
From a support ticket:

> it's possible to add a personalisation token with trailing whitespace
> (eg. "key " rather than "key"). Can this be trimmed in the UI to guard
> against this? (one of our devs copied and pasted it from a document
> and inadvertently included the space)

> Nothing major but caused a few hours of investigations!

Rather than trim the placeholder in the template, we should treat
placeholders in API calls the same way we do with CSV files, ie we
ignore case and spacing in the name of the placeholder. So
`(( First Name))` is equivalent to `((first_name))`, and both would be
populated with a dictionary like `{'firstName': 'Chris'}`.

Depends on:
- [x] https://github.com/alphagov/notifications-utils/pull/77
2016-11-10 11:40:00 +00:00
Martyn Inglis eb94fe6c0a Adding Flask-Redis to the project.
[https://pypi.python.org/pypi/Flask-Redis/0.1.0](https://pypi.python.org/pypi/Flask-Redis/0.1.0)

Initial addition as we think about redis as cache.
2016-11-10 11:27:57 +00:00
Martyn Inglis aea2356ae1 Initial SPIKE into redis for cache 2016-11-07 11:55:59 +00:00
Leo Hemsted f089b75129 update python client to 2.0.0
this is to prevent 500 errors because <2.0.0 raised AssertionError
if supplied JWT tokens were incorrectly formatted

tests added
2016-11-03 17:05:25 +00:00
bandesz edf22860e1 Bump boto version to 2.43.0-patch3 2016-11-02 17:59:09 +00:00
Rebecca Law 83f3c92c24 Move jsonschema to requirements.txt to missing dependency 2016-11-02 14:02:06 +00:00
Chris Hill-Scott 9192ff137f Bump utils
Includes:
- [ ] https://github.com/alphagov/notifications-utils/pull/75
2016-10-31 09:21:18 +00:00
bandesz a675509b5e Bump up boto version to 2.42.0-patch2 2016-10-17 18:10:16 +01:00
bandesz cffedb1a05 Use custom patched boto: 2.42.0-patch1 2016-10-17 16:42:41 +01:00
Leo Hemsted 8aaa444489 bump notification-utils to 9.0.5
includes improved email validation regex
2016-10-11 17:04:42 +01:00
Chris Hill-Scott 210ed6b912 Fix HTML lists in Microsoft Outlook
Depends on:
- [x] https://github.com/alphagov/notifications-utils/pull/69
2016-09-15 11:10:50 +01:00
Chris Hill-Scott e3af4b48da Bump utils version
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/68
2016-09-14 10:29:45 +01:00
Chris Hill-Scott 1e235fc0cf Update Python client
Just so that nobody else has to do it.

Implements:
- [x] https://github.com/alphagov/notifications-python-client/pull/29

Which is a breaking change requiring the renaming of method arguments.
2016-09-08 16:08:30 +01:00
Rebecca Law 727c00af21 Merge pull request #659 from alphagov/update-requirements
Update requirements
2016-09-06 14:16:31 +01:00
Chris Hill-Scott 3b6905b98d Update requirements
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/67
2016-09-06 10:53:34 +01:00
Rebecca Law 96a1d1a135 Update celery requirement 2016-09-05 17:00:16 +01:00
Rebecca Law 4d1c34fcce A little bit of clean up.
- Remove the deploy to staging | live links in the README
- Update most of the outdated requirements. Left Flask update out for now.
2016-09-05 16:45:54 +01:00
Leo Hemsted 95e3f39c6f Merge pull request #632 from alphagov/readme-cleanup
cleaned up readme + environment file
2016-08-31 17:08:49 +01:00