Commit Graph

4457 Commits

Author SHA1 Message Date
Leo Hemsted
3c3de0ca1f Merge pull request #1571 from alphagov/pyup-update-sqlalchemy-1.2.0-to-1.2.1
Update sqlalchemy to 1.2.1
2018-01-16 12:16:45 +00:00
Leo Hemsted
a1ebcc436e Merge branch 'master' into pyup-update-sqlalchemy-1.2.0-to-1.2.1 2018-01-16 12:00:27 +00:00
Leo Hemsted
3f574f2853 Merge pull request #1573 from alphagov/pyup-update-boto3-1.5.6-to-1.5.15
Update boto3 to 1.5.15
2018-01-16 12:00:06 +00:00
Leo Hemsted
bda70b99f7 Merge branch 'master' into pyup-update-boto3-1.5.6-to-1.5.15 2018-01-16 11:35:17 +00:00
Leo Hemsted
77cc0d1241 Merge pull request #1574 from alphagov/pyup-update-awscli-1.14.16-to-1.14.25
Update awscli to 1.14.25
2018-01-16 11:34:59 +00:00
Leo Hemsted
bcee0af4eb Merge branch 'master' into pyup-update-awscli-1.14.16-to-1.14.25 2018-01-16 11:17:51 +00:00
Leo Hemsted
0bf0a95b76 Merge pull request #1563 from alphagov/pyup-update-pytest-xdist-1.21.0-to-1.22.0
Update pytest-xdist to 1.22.0
2018-01-16 11:17:35 +00:00
Leo Hemsted
1369186797 Merge branch 'master' into pyup-update-pytest-xdist-1.21.0-to-1.22.0 2018-01-16 11:00:39 +00:00
Leo Hemsted
7533300967 Merge pull request #1572 from alphagov/only-collate-created
only send letters in created state to ftp app for zipping
2018-01-16 11:00:30 +00:00
pyup-bot
a2cf254a17 Update awscli from 1.14.16 to 1.14.25 2018-01-16 02:54:36 +00:00
pyup-bot
afcbfda566 Update boto3 from 1.5.6 to 1.5.15 2018-01-16 02:54:27 +00:00
Leo Hemsted
218fc5e14d only send letters in created state to ftp app for zipping
this means if we end up with some notifications sending and others not,
due to problems with the ftp connectivity for example, we don't re-send
those that worked.

As a reminder, letter pdf notifications start as created and stay that
way until we have sent the zip file to DVLA, at which point they are
updated to sending
 #
2018-01-15 17:00:00 +00:00
pyup-bot
0e6b18854b Update sqlalchemy from 1.2.0 to 1.2.1 2018-01-15 15:00:27 +00:00
Katie Smith
2f2fc712df Merge pull request #1562 from alphagov/fix-phone-validator-bug
Add validation to check that sms recipient is not None
2018-01-15 11:00:33 +00:00
Katie Smith
7b4abd076b Add validation to check that sms recipient is not None
Previously, if the SMS recipient was None there would be a 500 error
with no message displayed to the user. We now check if the recipient is
None and raise a BadRequestError if this is the case.
2018-01-15 09:20:46 +00:00
pyup-bot
a997fe94a8 Update pytest-xdist from 1.21.0 to 1.22.0 2018-01-11 20:27:25 +00:00
Chris Waszczuk
f206c5d032 Merge pull request #1561 from gov-cjwaszczuk/master
bumped utils version
2018-01-11 16:13:15 +00:00
chrisw
ccdbcf8499 bumped utils version 2018-01-11 16:03:07 +00:00
Katie Smith
79a7355da7 Merge pull request #1555 from alphagov/drop-rate-limit-database-default
Drop rate limit database default
2018-01-11 15:15:58 +00:00
Katie Smith
f6ef0ebbd7 Remove database default on rate_limit column
The default for the rate_limit column in the services and
services_history model is now set in the model, so we can remove the
default from the database.

Pivotal story: https://www.pivotaltracker.com/story/show/153992529
2018-01-11 10:37:26 +00:00
Katie Smith
e8fb9ee01e Merge pull request #1554 from alphagov/use-service-rate-limit-column
Get rate limit from service.rate_limit column (not config)
2018-01-11 10:36:43 +00:00
Katie Smith
b07db16cd1 Get rate limit from service.rate_limit column (not config)
PR #1550 added the rate_limit column to the Service table.

This PR removes the rate limits from the config and uses rate_limit from
the Service model instead. Rate limits are still separated into 'team',
'normal' and 'test', but these values are the same for a service.

Pivotal story https://www.pivotaltracker.com/story/show/153992529
2018-01-11 10:28:11 +00:00
Rebecca Law
f45469c98e Merge pull request #1556 from alphagov/template_default_address
Fix the template history when updating the reply_to for a template.
2018-01-10 13:45:35 +00:00
Rebecca Law
03deb804b0 -Fix typo
- return template from dao not the history
2018-01-10 13:32:54 +00:00
Rebecca Law
e59d6d470e Fix the problem with updating the reply_to or service_letter_contact_id for templates.
The history was not being updated properly, we think this is because the declaritive attribute is not being set propery by the property.
When reply_to: None it will update the service_letter_contact_id, but not the service_letter_contact, we think when the history_meta is build the history class and checking if the value is updated it depends which attribute it is checking first.

In order to fix this issue, there is a new dao method to update the reply_to on the Template and insert a new Template history.
2018-01-10 12:40:14 +00:00
Rebecca Law
cc839562da Fix the template history when updating the reply_to for a template.
It seems selecting the service_letter_contact in the validation method was causing SQLAlchemy to persist the object. When the dao was called to save the object nothing was different so we didn't persist the history object.

It may be time to take another look at how we version. :(
2018-01-09 16:41:58 +00:00
Alexey Bezhan
2a46ab62a3 Merge pull request #1553 from alphagov/fix-f-f-db-migration-push
Fix a typo in api-db-migration deployment make task
2018-01-09 11:53:56 +00:00
Alexey Bezhan
466166c8fb Fix a typo in api-db-migration deployment make task 2018-01-09 11:45:01 +00:00
Katie Smith
50210e5620 Merge pull request #1550 from alphagov/add-rate-limit-to-service
Add rate_limit column to service model
2018-01-09 11:32:43 +00:00
Katie Smith
649679d67f Add rate_limit column to service model
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.

Pivotal story: https://www.pivotaltracker.com/story/show/153992529
2018-01-09 11:20:52 +00:00
Alexey Bezhan
18c60c1418 Merge pull request #1543 from alphagov/generate-manifest-env
Replaces user-provided services with manifest environment variables
2018-01-09 11:02:16 +00:00
Alexey Bezhan
40c27c6e70 Don't parse AWS credentials from VCAP_SERVICES in run_app_paas
AWS credentials are provided in the environment variables directly,
so we don't need to parse them from VCAP_SERVICES
2018-01-09 10:45:03 +00:00
Alexey Bezhan
d82801fa5d Remove unused PERFORMANCE_PLATFORM_TOKEN config variable 2018-01-09 10:45:03 +00:00
Alexey Bezhan
f2e6018512 Use generated manifest when deploying apps to PaaS
Adds a new `make generate-manifest` target which is called by
deployment steps.
2018-01-09 10:45:03 +00:00
Alexey Bezhan
ff8373600d Replace manifest services with lists of env variables
Removes bindings to user provided services for new application
deployments and sets the expected environment variables to `null`.

Listing variables in the manifest allows us to only inject secrets
used by the app. `null` is not a valid value for a variable in a
CloudFoundry manifest, so if any of the keys don't have a match in
the credentials file `cf push` will return an error and stop the
deployment.
2018-01-09 10:45:03 +00:00
Alexey Bezhan
0ad5c184c2 Only update existing manifest variables when adding env secrets
Changes generate manifest script to parse variables file as YAML
and only add variables to the manifest if they're already listed
in the `env` section.

This allows us to use a single variables file for all applications
and avoid duplicating secrets across multiple files while adding
only the relevant secrets to the application manifest.
2018-01-09 10:45:03 +00:00
Alexey Bezhan
e02c8339e7 Remove cloudfoundry config parsing logic
By replacing user-provided services with manifest environment variables
we avoid the need to set the application environment variables from the
service data.

Most of the variable names already match the service JSON keys, but we
need to rename the ones that don't (eg MMG and Firetext `api_key`) this
is done in a separate credentials PR.
2018-01-09 10:45:03 +00:00
Alexey Bezhan
da1a7ceb0d Add a script to generate PaaS manifest with environment variables
`./scripts/generate_manifest.py` takes a path to a PaaS manifest file
and a list of variable files and prints a single CloudFoundry manifest.

The generated manifest replaces all `inherit` keys by loading the data
from parent manifests. This allows us to pipe the script output directly
to CF CLI, without saving it to disk, which minimises the risk of it
being accidentally included in the deployment artefact. The combined
manifest might differ from the results produced by CF CLI itself, so
the original manifest shouldn't normally be used on its own.

After combining the manifests the script will load and parse all listed
variable files and add them to the manifest's `env` by merging the files
together in the order they were listed (so in case of any key conflicts
the latest file overwrites previous values), upper-casing keys and
processing any list or dictionary values with `json.dumps`, so that they
can be set as environment variables.

This gives us a full list of environment variables that were previously
parsed from the CloudFoundry user services data.
2018-01-09 10:45:03 +00:00
Rebecca Law
d1da39c388 Merge pull request #1549 from alphagov/dont-use-service-default-address
Change for template default address
2018-01-08 17:22:52 +00:00
Rebecca Law
1634bfb7ad Use the default reply_to from template 2018-01-08 17:11:41 +00:00
Rebecca Law
a052020f84 - simplify if statement
- use the template.get_reply_to_text() in send_notification, it's already using the right thing.
2018-01-08 16:54:19 +00:00
Rebecca Law
d6683d9630 If template has a default address use that address ELSE the address is blank. 2018-01-08 15:54:58 +00:00
Rebecca Law
06197478e1 Merge pull request #1548 from alphagov/populate-default_on_letter_templates
Migration script for setting a default on the template.
2018-01-08 10:58:23 +00:00
Rebecca Law
7792c18efb Migration script to update the templates and templates_history (latest version only) with the service default letter contact block. 2018-01-05 17:34:51 +00:00
Rebecca Law
46ef58ab4d Merge pull request #1544 from alphagov/revert-is_letter_contact_blank
Revert adding the is_letter_contact_blank column.
2018-01-05 17:02:31 +00:00
Rebecca Law
884b8f3990 Merge branch 'master' into revert-is_letter_contact_blank 2018-01-05 16:20:50 +00:00
Rebecca Law
acc1842df7 Merge pull request #1545 from alphagov/revert_is_blank-code
Because life is difficult today...
2018-01-05 16:20:09 +00:00
Rebecca Law
f34a380f7f Fix file name 2018-01-05 16:00:29 +00:00
Rebecca Law
0bc42d1873 Forgot script 2018-01-05 15:58:13 +00:00
Rebecca Law
5be5e17e46 Because life is difficult today...
Need to alter the column to nullable and remove reference to the column in any code. Next PR will drop column
2018-01-05 15:55:02 +00:00