Commit Graph

445 Commits

Author SHA1 Message Date
Leo Hemsted
7f9b64d3df bump utils (inc redis bump) 2019-01-08 15:02:09 +00:00
Alexey Bezhan
47c403f6ab Don't return pagination links for API Message log requests
Flask-SQLAlchemy paginate function issues a separate query to get
the total count of rows for a given filter. This query (with
filters used by the API integration Message log page) is slow for
services with large number of notifications.

Since Message log page doesn't actually allow users to paginate
through the response (it only shows the last 50 messages) we can
use limit instead of paginate, which requires passing in another
flag from admin to the dao method.

`count` flag has been added to `paginate` in March 2018, however
there was no release of flask-sqlalchemy since then, so we need
to pull the dev version of the package from Github.
2019-01-08 13:22:27 +00:00
Leo Hemsted
40a17a0e93 pin redis to 2.x
while we sort out v3 compatibility
2019-01-07 11:14:25 +00:00
Leo Hemsted
2e53ba1e3e bump utils
brings in https://github.com/alphagov/notifications-utils/pull/563
2019-01-04 16:17:52 +00:00
Chris Hill-Scott
98e501c4c4 Bump utils to 30.7.2 2019-01-02 15:45:06 +00:00
Alexey Bezhan
e7a2f4c151 Update utils to 30.7.1 to silence 'Header missing' warnings
Brings in changes from https://github.com/alphagov/notifications-utils/pull/553
2018-11-27 15:50:33 +00:00
Katie Smith
ff06d120e8 Bump notifications-utils to 3.7.0
Bumped notifications-utils to 3.7.0. Version 3.7.0 includes the
`convert_utc_to_bst` and `convert_bst_to_utc` functions and the
`LETTER_PROCESSING_DEADLINE` constant, so these have been removed from
this repo and anywhere using these has now been updated to get these
from `notifications-utils`.

Also bumped pytest by a patch version to bring in a bug fix.
2018-11-26 12:53:39 +00:00
Rebecca Law
0163a6d9b7 Update marshmallow and SqlAlchemy dependencies 2018-11-13 14:19:53 +00:00
Rebecca Law
f5de80f195 Fix conflict 2018-11-07 16:39:04 +00:00
Rebecca Law
39198ed67e Using jsonschema for create_template.
Updated jsonschema to Draft7, this allowed a conditional validation on subject, if template_type == 'email' or 'letter' then subject is required.
This version is backward compatible with Draft4.
When creating TempalteRedacted, I've built the dict depending on if the created_by or created_by_id exists.
2018-11-07 16:17:08 +00:00
Leo Hemsted
267c4fc07b bump requirements, fix pyflake8 things, unpin botocore/awscli 2018-11-07 13:39:08 +00:00
Katie Smith
9ccffb6980 Update notifications-utils to 30.5.6
This brings in the change to email validation which removes obsure white
space from email addresses.
2018-10-29 09:33:55 +00:00
Leo Hemsted
58cd349194 pin itsdangerous to v0.24
itsdangerous v1 uses sha512 instead of sha1 to sign and unsign its
strings. Pin to 0.24 until we figure a migration plan, since it's
used in a few places (In the DB, in email tokens, and sending blobs
to celery at least).
2018-10-22 17:00:04 +01:00
Leo Hemsted
29ea2e51d6 bump requirements
also pyup ignore awscli and botocore because that complex mesh of
dependency hell doesn't play will with pyup opening a new PR every time
that botocore/awscli update (every few days)
2018-10-22 14:43:08 +01:00
Tom Byers
228802ab5a Bump utils to 3.5.5 2018-10-16 12:41:33 +01:00
Chris Hill-Scott
8af5cbab86 Bump utils to 30.5.4 2018-10-09 15:08:54 +01:00
Leo Hemsted
2ed50e760f Revert "Celery 4" 2018-10-09 13:27:49 +01:00
Chris Hill-Scott
72358899ad Merge pull request #2136 from alphagov/bump-utils-30.5.3
Bump utils to 30.5.3
2018-10-05 16:15:25 +01:00
Leo Hemsted
ba7cf10393 Merge pull request #2131 from alphagov/celery4
Celery 4
2018-10-05 16:03:44 +01:00
Chris Hill-Scott
a1a4bad0e6 Bump utils to 30.5.3 2018-10-05 15:30:03 +01:00
Chris Hill-Scott
2708515f18 Bump utils to 30.5.2 2018-10-05 13:43:17 +01:00
Leo Hemsted
2edb7f39e6 fix reqs file 2018-10-05 10:28:12 +01:00
Leo Hemsted
640f00b0e8 install celery with sqs support
you need to `pip install celery[sqs]` to get the additional
dependencies that celery needs to use SQS queues - there are two libs -
boto3 and pycurl.

pycurl is a bunch of python handles around curl, so needs to be
installed from source so it can link to your curl/ssl libs. On paas and
in docker this works fine (needed to add `libcurl4-openssl-dev` to the
docker container), but on macos it can't find openssl. We need to pass
a couple of flags in:

* set the environment variable PYCURL_SSL_LIBRARY=openssl
* pass in the global options `build_ext` and `-I{openssl_headers_path}`.

As shown here:
https://github.com/pycurl/pycurl/issues/530#issuecomment-395403253

Env var is no biggie, but using any install-option flags disables
wheels for the whole pip install run. (See
https://github.com/pypa/pip/issues/2677 and
https://github.com/pypa/pip/issues/4118 for more context on the
install-options flags). A whole bunch of our dependencies don't
install nicely from source (but do from wheel), so this commit installs
pycurl separately as an initial step, with the requisite flags, and
then installs the rest of the requirements as before.

I've updated the makefile and bootstrap.sh files to reflect this, but
if you run `pip install -r requirements.txt` from scratch you will run
into issues.
2018-10-03 14:11:30 +01:00
Leo Hemsted
4b7ed9db2f upgrade celery to 4.2.0
celery 4.2.0 no longer requires boto2, so we can get rid of that
patched version.
2018-10-03 14:11:18 +01:00
Rebecca Law
d5d84eb5ee Update requirements 2018-09-28 16:37:40 +01:00
Leo Hemsted
78b4231915 fix awscli botocore dependency
awscli has a requirement of a new version of botocore

moto has a requirement of an old version of boto3, which requires an
old version of botocore

We had to pin boto to an older version, because of the moto issues.
this commit pins awscli to the version currently deployed on prod, so
that it plays nice with that older version of boto/botocore
2018-09-28 11:25:55 +01:00
Tom Byers
78cc503a91 Bump utils to 30.4.0
Brings in changes to allow letter timings to
include 1st class letters.

https://github.com/alphagov/notifications-utils/pull/533
2018-09-28 10:02:16 +01:00
Tom Byers
c126859efc Lock botocore library to <1.11.0
Using version 1.11.0 or above causes an error with
the moto library where it makes real HTTP requests
instead of mocking them:

https://github.com/spulec/moto/issues/1793

Until this is resolved, botocore needs to be
locked. This copies the approach the Digital
Marketplace team took to the same problem:

https://github.com/alphagov/digitalmarketplace-utils/pull/452
2018-09-27 14:38:29 +01:00
Tom Byers
8b86257a8b Bump utils to 30.3.1
Brings in stripping of the line separator
character from emails.

https://github.com/alphagov/notifications-utils/pull/531
2018-09-26 10:23:14 +01:00
Katie Smith
ae1ee85d12 Merge pull request #2049 from alphagov/pyup-update-sqlalchemy-1.2.10-to-1.2.11
Update sqlalchemy to 1.2.11
2018-09-12 11:24:28 +01:00
Chris Hill-Scott
33f1c9a41b Bump utils to start sending email preheaders
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/523/files

Changes: https://github.com/alphagov/notifications-utils/compare/30.1.1...email-preheader
2018-09-03 17:48:27 +01:00
Chris Hill-Scott
fc337a7d5a Freeze requirements 2018-08-21 11:38:53 +01:00
Rebecca Law
d055fabf17 Bump the utils requirement.
This helped with some of the dependency warnings but not all.
2018-08-20 10:33:15 +01:00
Katie Smith
85af1e7fe8 Bump utils to version 30.1.0
Bumped notifications-utils to bring in the new value for
`SMS_CHAR_COUNT_LIMIT`
2018-08-16 15:59:51 +01:00
Tom Byers
a5eefe00b8 Bump utils to 29.3.6
Brings in the changes from:

https://github.com/alphagov/notifications-utils/pull/513
2018-08-13 11:48:53 +01:00
Leo Hemsted
ef447931fd bump utils 2018-08-09 16:49:30 +01:00
Leo Hemsted
804f489b51 bump requirements 2018-08-09 16:47:35 +01:00
Chris Hill-Scott
1ad6984bdd Bump utils to 29.3.4
https://github.com/alphagov/notifications-utils/compare/29.3.3...bullet-for-bullet
2018-08-03 13:25:43 +01:00
Alexey Bezhan
ce5bb1f762 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:26:10 +01:00
Tom Byers
d6603a0541 Brings in spacing changes to the email template 2018-07-25 15:28:23 +01:00
Chris Hill-Scott
222dc3fe95 Use debian jessie instead of stretch until npm is installed differently 2018-07-17 11:59:48 +01:00
Alexey Bezhan
75940c9566 Pin all application 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.

This is based on alphagov/digitalmarketplace-api#615, so rationale
from that PR applies here.

We had a problem with unpinned packages on new deployments leading
to failed tests (e.g. alphagov/notifications-admin#2144) which is
why we're implementing this now.

After re-evaluating pipenv again, this still seems like the least
disruptive approach:

* pyup.io has experimental support for Pipfile, but doesn't respect
  version ranges or updating hashes in the lock file
* CloudFoundry buildpack recognizes and supports Pipfiles out of the
  box, but the support is relatively new. For example until recently
  CF would install dev packages during deployment. It's also based on
  generating a requirements file from the Pipfile, which doesn't
  properly support pinning VCS dependencies (eg it doesn't set the
  #egg= version, meaning pip will not upgrade the package if it's
  already installed).
* pipenv has a strict dependency resolution algorithm, which doesn't
  appear to be well documented and can cause some unexpected failures.
  For example, pipenv doesn't seem to be able to install `awscli-cwlogs`
  package at all, believing it to have a version conflict for `botocore`
  (which it doesn't list as a direct dependency) while neither `pip` nor
  `pip-tools` highlight any issues with it.
* While trying out `pipenv install` on our list of dependencies it would
  regularly fail to install utils with a "Will try again." message.
  While the installation succeeds after a retry, this doesn't inspire
  confidence.
* The switch to Pipfile and pipenv-managed virtualenvs requires a series
  of changes to `make` targets and scripts - replacing `pip install` with
  `pipenv`, removing references to requirements files and prefixing
  commands with `pipenv run`. While it's likely to simplify the overall
  process of managing dependencies, it would require time to properly
  implement across our applications and environments (Jenkins, PaaS,
  docker containers, and dev machines).
2018-07-10 14:59:04 +01:00
Leo Hemsted
3b5eefdd3d Merge pull request #1923 from alphagov/pyup-update-sqlalchemy-1.2.8-to-1.2.9
Update sqlalchemy to 1.2.9
2018-07-02 14:30:42 +01:00
Rebecca Law
08dcc920a2 Updated notifications-util to the latest version.
There has been an update to the email validation code.
Added an extra test for email validation.
2018-07-02 13:48:40 +01:00
pyup-bot
cb0971dcce Update sqlalchemy from 1.2.8 to 1.2.9 2018-06-29 19:09:51 +01:00
Leo Hemsted
1f2f12238c Merge pull request #1909 from alphagov/pyup-update-flask-migrate-2.2.0-to-2.2.1
Update flask-migrate to 2.2.1
2018-06-26 16:07:10 +01:00
pyup-bot
ffcaded795 Update flask-migrate from 2.2.0 to 2.2.1 2018-06-18 15:29:31 +01:00
pyup-bot
410040461f Update psycopg2-binary from 2.7.4 to 2.7.5 2018-06-17 19:32:28 +01:00
pyup-bot
3e3d71937a Update sqlalchemy from 1.2.7 to 1.2.8 2018-06-14 13:24:39 +01:00
Chris Hill-Scott
60ec5777be Merge pull request #1904 from alphagov/pyup-update-flask-migrate-2.1.1-to-2.2.0
Update flask-migrate to 2.2.0
2018-06-14 13:24:11 +01:00