Commit Graph

6387 Commits

Author SHA1 Message Date
Andy Paine
b0baf10229 Merge pull request #2522 from alphagov/use-port-health-checks-for-api
BAU: Use port health checks for API
2019-05-30 14:58:27 +01:00
Rebecca Law
a57648d789 Merge pull request #2521 from alphagov/fix-reference-bug
Add missing reference to the update statement.
2019-05-30 12:16:12 +01:00
Andy Paine
adf81ef689 BAU: Use port health checks for API
- We've been seeing an issue when traffic spikes of the http health
  checks taking over 1s and PaaS killing the app
- Port health checks won't care about being stuck in a queue so should
  continue to work even at high loads
- We have functional tests to catch if a deployment brings up the app
  (and so passes port health check) but then doesn't work
2019-05-30 11:56:19 +01:00
Rebecca Law
4154251970 Addd missing reference to the update statement. 2019-05-30 10:54:47 +01:00
Pea (Malgorzata Tyczynska)
82e27c4064 Merge pull request #2511 from alphagov/verify_new_reply_to_address
Verify new reply to address
2019-05-28 16:16:06 +01:00
Pea Tyczynska
c4d20667a6 Add notification deletion to downgrade to respect foreign key constraints 2019-05-28 15:25:06 +01:00
Pea Tyczynska
5f1f688c7b Create template to verify service email reply-to addresses
So that template with the same ID is present on all environments
2019-05-28 15:14:09 +01:00
Rebecca Law
1490c8e377 Merge pull request #2520 from alphagov/fix-bug
Fix a bug introduced when refactoring some code.
2019-05-23 17:12:21 +01:00
Rebecca Law
2844fa530b Fix a bug introduced when refactoring some code. The notification status happened in the wrong order - this resolved that.
This meant notifications sent with a test key never got a 'delivered' status.
2019-05-23 17:04:55 +01:00
Pea Tyczynska
5692a8596d Code refactors and corrections, details below:
Change method name to be more relevant

Check if verification notification we send is a correct one

pass in notify db session for tests instead of sample_user

Refactor tests by using admin_request instead of client

Refactor all tests for affected reply-to endpoints for good measure

Allow overwriting reply-to address with the same address

Skip checking for duplicates if it's an reply-to email update

Fix refactored tests

Verify duplicates exception not needed
2019-05-23 15:36:09 +01:00
Pea Tyczynska
3c3dde635b Prevent service from adding duplicate reply-to addresses
Check for duplicate reply-to email address has been added on:
-verification endpoint, so we do not send the verifying notification
needlessly
- add reply-to email address and update reply-to email address
endpoints, as those can be hit multiple times after the email address
has been verified (so the same email address could end up being added
multiple times). EDIT: this has now been prevented on admin app,
but it's better to retain double-check for safety.
2019-05-23 15:36:09 +01:00
Pea Tyczynska
615ea6a98a Send verifcation email to a new reply-to email address 2019-05-23 15:36:09 +01:00
Andy Paine
c8a8a614a6 Merge pull request #2519 from alphagov/internal-app-statsd
AUTO-413: Use an internal app for statsd preview
2019-05-23 14:55:14 +01:00
Andy Paine
655d5a4e16 AUTO-413: Use an internal app for statsd preview
- We are running statsd exporter as an app with a public route for
  Prometheus to scrape
- This updates preview to send statsd metrics over the CF internal
  networking to the statsd exporter
- Removes the sidecar statsd exporters too
2019-05-23 11:10:33 +01:00
Leo Hemsted
73cc30a562 Merge pull request #2518 from alphagov/revert-2516-internal-app-statsd
Revert "AUTO-413: Use an internal app for statsd preview"
2019-05-22 17:15:14 +01:00
Leo Hemsted
21071b2908 Revert "AUTO-413: Use an internal app for statsd preview" 2019-05-22 17:06:43 +01:00
Andy Paine
a0ec27acfb Merge pull request #2516 from alphagov/internal-app-statsd
AUTO-413: Use an internal app for statsd preview
2019-05-22 16:02:57 +01:00
Andy Paine
b8145e7526 AUTO-413: Use an internal app for statsd preview
- We are running statsd exporter as an app with a public route for
  Prometheus to scrape
- This updates preview to send statsd metrics over the CF internal
  networking to the statsd exporter
- Removes the sidecar statsd exporters too
2019-05-22 13:53:05 +01:00
Rebecca Law
0a5d39f83d Merge pull request #2496 from alphagov/refactor-update-notifications
Refactor update notifications
2019-05-22 13:38:32 +01:00
Rebecca Law
231e5f4066 Merge pull request #2515 from alphagov/revert-logging
Revert the log message that was added to test inbound numbers
2019-05-22 13:37:47 +01:00
Rebecca Law
c98faa929a Revert the log message that was added to test inbound numbers 2019-05-22 13:21:19 +01:00
Rebecca Law
3bc2f4c621 Merge pull request #2514 from alphagov/dont-insert-notification-history
Look for notification in both tables for complaints
2019-05-22 10:21:17 +01:00
Rebecca Law
bb53793228 Merge pull request #2512 from alphagov/add-logging-if-inbound-number-not-associated-to-service
Add logging for inbound numbers not associated to a service.
2019-05-22 10:14:19 +01:00
Rebecca Law
e731dd96ed Added units test to make sure the complaints work if the notification doesn't exist or if the notification_history doesn't exist 2019-05-22 10:03:07 +01:00
Rebecca Law
0e6ef9fa57 This is probably a temporary log message, to make sure our new inbound numbers are working. 2019-05-21 16:39:45 +01:00
Rebecca Law
3374e03ce9 Prepare to stop inserting NotificationHistory at the time of inserting a notificaiton.
Need to remove foreign key to complaints.
Make sure if getting Notification.id we look to both tables.
2019-05-21 16:08:18 +01:00
Rebecca Law
bde1e751ad Merge pull request #2502 from alphagov/dont-update-notification-history-in-realtime
Stop updating NotificationHistory
2019-05-21 14:46:59 +01:00
Rebecca Law
a3f33b5cc3 Merge pull request #2504 from alphagov/reduce-number-of-billing-days-to-calculate
Reduce the number of days to recalculate billing.
2019-05-17 16:12:07 +01:00
Rebecca Law
56800c669d Added some better unit tests 2019-05-17 16:01:46 +01:00
Chris Hill-Scott
3e782c6dbc Merge pull request #2428 from alphagov/give-users-folder-permissions
Give existing users all folder permissions
2019-05-17 12:48:27 +01:00
Pea Tyczynska
67e3a7689a Give existing users all folder permissions
This will be done just before we turn on folder permissions
to all services to ensure that all users start with all the
permissions.
2019-05-17 10:33:05 +01:00
Leo Hemsted
961b548367 Merge pull request #2509 from alphagov/start-migrations
Can't use --no-start flag on migration
2019-05-16 17:49:13 +01:00
Leo Hemsted
1e4f98868c Merge pull request #2510 from alphagov/revert-2508-break-the-build
Revert "testing build failure"
2019-05-16 17:23:09 +01:00
Leo Hemsted
5d05a55857 Revert "testing build failure" 2019-05-16 17:06:34 +01:00
Leo Hemsted
42ffe673ae Merge pull request #2508 from alphagov/break-the-build
testing build failure
2019-05-16 16:22:33 +01:00
Leo Hemsted
652ccbb990 Can't use --no-start flag
--no-start doesn't actually stage, which we need to get the files containing the new migrations.
2019-05-16 16:20:15 +01:00
Leo Hemsted
e225c95bdc testing build failure
please don't deploy this to production
2019-05-16 15:53:41 +01:00
Leo Hemsted
cbe5c0d23b Merge pull request #2507 from alphagov/new-migration
remove unnecessary unique index
2019-05-16 15:52:42 +01:00
Leo Hemsted
9d415cd292 remove unnecessary unique index
primary key provides the same control. also catch the right exception
in the related command
2019-05-16 14:36:17 +01:00
Leo Hemsted
907e13da87 Merge pull request #2506 from alphagov/zdt-mk-2
update manifest file to use zdt-push
2019-05-16 12:03:39 +01:00
Leo Hemsted
05c9144a89 update manifest file to use zdt-push
this way we keep db bindings etc, and avoid accidentally dropping
connections.
2019-05-16 10:52:54 +01:00
Leo Hemsted
01844d4a56 Merge pull request #2505 from alphagov/healthcheck
add routes for all apps
2019-05-15 16:53:20 +01:00
Leo Hemsted
10a6f32a09 add routes for all apps
all apps get a route assigned when using v3-zdt-push.

> By default, the web process has a route and one instance. Other processes have zero instances by default.

([source](https://docs.cloudfoundry.org/devguide/multiple-processes.html))

When we push apps to multiple environments they need different routes
or the second push will fail, so this means that we need to define
routes ourselves for every app.

We're also manually flagging the health-check as either "http" or
"process" - http for the api, process for all others.

If not specified, healthcheck is set to `port` by cloudfoundry - we've
seen some issues with upgrading the deployment from v2 to v3 when using
port - it adds apps to load balancer when they're not ready, which can
result in 404s. by setting healthcheck to http it'll wait for the
/status endpoint to return 200, which will wait for flask to get
everything up and running properly
2019-05-15 16:01:28 +01:00
Rebecca Law
198fd21f7e Update Notification history if there is a mismatch in the number of notifications to be updated and the number actually updated. 2019-05-15 15:30:15 +01:00
Rebecca Law
82d8c7014d Merge branch 'master' into dont-update-notification-history-in-realtime 2019-05-15 15:15:26 +01:00
Katie Smith
3ae3b0e7af Merge pull request #2491 from alphagov/support-welsh-characters
Bump utils to bring in new fragment count for unicode SMS
2019-05-15 14:46:55 +01:00
Rebecca Law
e3ee99e70d Reduce the number of days to recalculate billing. It's not necessary to calculate longer than 4 days. 2019-05-15 14:40:53 +01:00
Katie Smith
1fac8e8e29 Bump utils to bring in new fragment count for unicode SMS
Version 32.0.0 of notifications-utils changes how SMS fragment count is
calculated. Certain Welsh characters will cause the SMS to be encoded in
unicode encoding (instead of GSM) so the fragment counts will be lower.
2019-05-15 14:02:07 +01:00
Leo Hemsted
b4b346c764 Merge pull request #2503 from alphagov/revert-2498-zdt-deploy
Revert "Zero downtime deploy"
2019-05-15 14:01:15 +01:00
Leo Hemsted
7a711cf314 Revert "Zero downtime deploy" 2019-05-15 13:48:40 +01:00