Commit Graph

5990 Commits

Author SHA1 Message Date
Pea (Malgorzata Tyczynska)
da36de4e38 Merge pull request #2341 from alphagov/migrate_postage_template_history
Migrate postage into templates_history table
2019-02-05 16:49:12 +00:00
Pea Tyczynska
ab5fd972b0 Migrate postage into templates_history table 2019-02-05 15:00:53 +00:00
Leo Hemsted
26a90f72fa Merge pull request #2326 from alphagov/error-downgrade
downgrade error to info for notification not found for callback
2019-02-05 14:51:12 +00:00
Leo Hemsted
0065afad11 downgrade error to info for notification not found for callback
When we get a callback from SES, we identify the notification by the
SES reference that we set on the notification after sending. When we
wrote the log message, we assumed that we'd always have a notification
for every callback, so if one couldn't be found we would raise an error
log. This isn't the case for a few reasons:

* We might receive a callback before the sender worker has persisted
  the reference to the database.
* We might have deleted the notification, especially if the service has
  a short data retention period
* We sometimes receive callbacks for references that we have no record
  of whatsoever (this is quite alarming but we have no way of knowing
  why this happens)

The error logs were happening pretty frequently, and we don't have a
real way to solve them at the moment, so lets cut down on noise and
downgrade them to info level for now.
2019-02-05 14:44:51 +00:00
Chris Hill-Scott
f6d3e87de5 Merge pull request #2286 from alphagov/folders-for-all-services
Give folders to all existing services
2019-02-01 15:19:35 +00:00
Chris Hill-Scott
cf2d88c87e Squeeze in some letter logos too 2019-02-01 15:11:51 +00:00
Chris Hill-Scott
a04f41d4d8 Give folders to all existing services
Step 2 of 2 of shipping folders.
2019-02-01 15:04:27 +00:00
Pea (Malgorzata Tyczynska)
e46f20757e Merge pull request #2333 from alphagov/postage_on_template_not_on_service
Set postage for existing and new templates
2019-02-01 13:07:52 +00:00
Pea Tyczynska
c32fdfa008 Set postage for all existing templates to service default 2019-02-01 12:57:38 +00:00
Pea (Malgorzata Tyczynska)
6c63339025 Merge pull request #2334 from alphagov/set_postage_on_new_templates
Set postage to second class when creating new letter template
2019-02-01 12:17:03 +00:00
Chris Hill-Scott
679a7df9dd Merge pull request #2285 from alphagov/folders-for-new-services
Give folders to new services by default
2019-02-01 10:57:39 +00:00
Chris Hill-Scott
09ffe4caef Merge pull request #2336 from alphagov/bump-utils-govuk-blue
Bump utils to 30.7.5
2019-02-01 10:53:54 +00:00
Chris Hill-Scott
ea678a630c Merge pull request #2335 from alphagov/pyup-update-flake8-3.7.3-to-3.7.4
Update flake8 to 3.7.4
2019-02-01 09:50:05 +00:00
Chris Hill-Scott
0e1897473f Merge pull request #2325 from alphagov/remove-outdated-folder
Remove outdated folder
2019-02-01 09:41:23 +00:00
Chris Hill-Scott
406496c2a1 Bump utils to 30.7.5
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/572
2019-02-01 09:35:42 +00:00
pyup-bot
862cdb6151 Update flake8 from 3.7.3 to 3.7.4 2019-02-01 05:41:24 +00:00
Pea (Malgorzata Tyczynska)
1ee951b0a1 Merge pull request #2332 from alphagov/pyup-update-flake8-3.6.0-to-3.7.3
Update flake8 to 3.7.3
2019-01-31 15:27:47 +00:00
Pea Tyczynska
821a7ccbac Update requirements with flake8 and subdependencies and fix over-indents 2019-01-31 15:08:23 +00:00
pyup-bot
a4bb47d55e Update flake8 from 3.6.0 to 3.7.3 2019-01-31 05:41:30 +00:00
Pea Tyczynska
ccd5a758f0 Set postage to second class when creating new letter template
Also get rid of checks for CHOOSE_POSTAGE permission when creating
and updating a template.
2019-01-30 16:26:49 +00:00
Chris Hill-Scott
4b1336b405 Give folders to new services by default
Step 1 of 2 of turning on folders for all services.

We think it’s a feature which will be useful for the majority of
services, and we think we’ve done enough research to know that it’s
mature enough to release to all services.
2019-01-29 12:30:41 +00:00
Chris Hill-Scott
c3b21fd2b2 Remove outdated folder
I don’t think this is still current. It hasn’t been updated in 2 years.
2019-01-29 12:27:12 +00:00
Leo Hemsted
208af8a508 Merge pull request #2318 from alphagov/letter-branding
Letter branding
2019-01-29 10:59:55 +00:00
Leo Hemsted
1cd498dd39 make integrity check more restrictive
previously, it was too loose - checking `"name" in str(exc)` returns
false positives.

By changing from three if statements to a loop we can cut down on
unnecessary code (and ensure that the returned objects are consistent),
and by using the full check constraint name we can be sure that we're
only capturing exactly the right errors. Additionally, don't return
the original data in the error message - it's obvious what the name is
because it'll be populated in the form you just filled in.
2019-01-28 17:01:13 +00:00
Sakis
b42a134133 Merge pull request #2324 from alphagov/bump-disk-space
Bump available disk space for API, sender and receipts workers
2019-01-28 11:36:26 +00:00
Athanasios Voutsadakis
97c0f90804 Bump available disk space for API, sender and receipts workers
They are the busiest services and if we don't deploy often to rotate
them they tend to fill their disk space.
2019-01-28 11:28:11 +00:00
Pea (Malgorzata Tyczynska)
29c1a39016 Merge pull request #2316 from alphagov/pyup-update-psycopg2-binary-2.7.5-to-2.7.7
Update psycopg2-binary to 2.7.7
2019-01-25 18:44:20 +00:00
Pea Tyczynska
3f984ecbf6 Update requirements.txt with new version of psycopg2-binary
also auto-bumped sub-dependencies.
2019-01-25 18:36:10 +00:00
Pea (Malgorzata Tyczynska)
8995db0e99 Merge pull request #2297 from alphagov/pyup-update-sqlalchemy-1.2.14-to-1.2.16
Update sqlalchemy to 1.2.16
2019-01-25 18:08:51 +00:00
Pea Tyczynska
aacd8c7c24 Update requirements.txt version of SQLAlchemy and subdependencies 2019-01-25 18:03:07 +00:00
Pea (Malgorzata Tyczynska)
c4fb5c04de Merge pull request #2241 from alphagov/pyup-update-flask-migrate-2.3.0-to-2.3.1
Update flask-migrate to 2.3.1
2019-01-25 17:43:35 +00:00
Pea Tyczynska
eca0afe1ff Update requirements.txt with new version of Flask-Migrate and subdependencies 2019-01-25 17:17:58 +00:00
Pea (Malgorzata Tyczynska)
b3bb7ea9ba Merge branch 'master' into pyup-update-flask-migrate-2.3.0-to-2.3.1 2019-01-25 16:49:26 +00:00
Pea (Malgorzata Tyczynska)
d562ba3fa3 Merge pull request #2299 from alphagov/pyup-update-pytest-xdist-1.24.1-to-1.26.0
Update pytest-xdist to 1.26.0
2019-01-25 16:48:15 +00:00
Pea (Malgorzata Tyczynska)
7d35f5d6a6 Merge branch 'master' into pyup-update-pytest-xdist-1.24.1-to-1.26.0 2019-01-25 16:39:04 +00:00
Pea (Malgorzata Tyczynska)
d15853a287 Merge pull request #2279 from alphagov/pyup-update-pytest-cov-2.6.0-to-2.6.1
Update pytest-cov to 2.6.1
2019-01-25 16:34:12 +00:00
Rebecca Law
4dbb54b5e7 Added an endpoint to get letter-branding by id. 2019-01-25 16:05:55 +00:00
Rebecca Law
e030c2be88 Removing platform_default as a concept. No service actually wants to send letters with the default hm-government logo so we are going to remove it as a constraint.
However, until we can create a letter without a logo, we will still default to hm-government, because the dvla_organisation is set on the service.
This does simplify the code.
Also removed the inserts to letter_branding in the data migration file, because we can deploy this before the rest of the work is finished. But we will need to do it later.
2019-01-25 15:03:01 +00:00
Rebecca Law
7ee1d67df7 Added endpoints for letter-branding. 2019-01-24 17:39:48 +00:00
Rebecca Law
0b7fca4167 Merge branch 'master' into letter-branding 2019-01-24 16:39:30 +00:00
Rebecca Law
f8eb72a537 Adding rest endpoints for letter-branding 2019-01-24 16:38:52 +00:00
Rebecca Law
c2272f7d23 Fix mock in unit test. Not sure why it passed locally with previous mock. 2019-01-24 11:24:00 +00:00
Rebecca Law
a66b078065 Change the mock 2019-01-24 11:13:50 +00:00
Sakis
65c574a49c Merge pull request #2317 from alphagov/fix-run-multiworker
Exit if celery processes are not running
2019-01-23 17:10:53 +00:00
Athanasios Voutsadakis
3528aab25b Kill the other processes started by the script
We use exec to start awslogs_agent and then a tail to print logs to
stdout. CF docs[1] recommend to use exec to start processes which seems
to imply that as long as there are commands running the container will
remain up and running.

This commit ensures that if there are no celery tasks running we will
kill any other processes that we have started, so that the container will
no longer be considered healthy by cloudfoundry and will be replaced.

1: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#start-commands
2019-01-23 16:23:58 +00:00
Athanasios Voutsadakis
fa4cff5eb7 Bump sender memory to 3GB 2019-01-23 16:00:00 +00:00
Toby Lorne
afcdf1f9a1 Exit if celery processes are not running
In 4427827b2f and celery monitoring was
changed from using PID files to actually looking at processes.

If celery workers get OOM killed (for instance) the container init
script would not restart them, this is because `get_celery_pids` would
not contain any processes that contained the string celery. This would
cause the pipe to fail (-o pipefail). APP_PIDS would not get updated but
the script would continue to run. This caused the script to not restart
the celery processes.

We think the correct behaviour when celery processes are killed (i.e.
there are no more celery processes running in a container) is to kill
the container. The PaaS should then schedule new ones which may
remediate the cause of the celery processes being killed.

Upon detection of no celery processes running, some diagnostic
information from the environment is sent to the logs, e.g.:

```
CF_INSTANCE_ADDR=10.0.32.4:61012
CF_INSTANCE_INTERNAL_IP=10.255.184.9
CF_INSTANCE_GUID=81c57dbc-e706-411e-6a5f-2013
CF_INSTANCE_PORT=61012
CF_INSTANCE_IP=10.0.32.4
```

Then the script (which is the container entrypoint) exits 1.

Co-author: @servingupaces @tlwr
2019-01-23 14:28:53 +00:00
Rebecca Law
e4ea208d06 Use the letter_branding logo if it exists otherwise fall back to the dvla_organisation logo. 2019-01-23 12:51:09 +00:00
pyup-bot
ca48665778 Update psycopg2-binary from 2.7.5 to 2.7.7 2019-01-22 18:16:07 +00:00
Rebecca Law
f11aa55e0b Adding new data models for letter branding. 2019-01-22 17:27:00 +00:00