Commit Graph

6163 Commits

Author SHA1 Message Date
Rebecca Law
fb398876ee Merge branch 'master' into fix-date-bug-for-performance-platform 2019-04-01 12:05:48 +01:00
Rebecca Law
1456aa7789 Fix for performance platform updates.
Changed the query to get the performance platform stats from ft_notification_status. But the date used for the query needed to be a date, not datetime so the equality worked.
2019-04-01 12:03:57 +01:00
Rebecca Law
814d9bee99 Merge pull request #2426 from alphagov/fix-platfom-admin-bug
Fix BST date bug for platform admin summary page.
2019-04-01 11:58:36 +01:00
Rebecca Law
a47ecf0711 Fix test where the year was static
Remove print
2019-04-01 11:43:02 +01:00
Rebecca Law
d83ee6171e Fix codestyle 2019-04-01 11:02:02 +01:00
Rebecca Law
b9b81bca8f Fix BST date bug for platform admin summary page.
Added test for that.
2019-04-01 10:56:55 +01:00
Rebecca Law
0561fe5e11 Merge pull request #2424 from alphagov/use-ft_notification_status-for-perf-platform-updates
Use ft_notification_status instead of notification_history
2019-03-29 16:08:14 +00:00
Rebecca Law
fe30d2879a Fix test 2019-03-29 15:46:36 +00:00
Rebecca Law
e9607f227d Remove query that's no longer needed. 2019-03-29 15:38:48 +00:00
Rebecca Law
1806f092f3 Update the nightly task that send performance platform statistics to use ft_notification_status rather than notification_history.
The previous query was including all notifications regardless of notification_status. I don't think that's right, it shouldn't include things like technical-failure or validation-failed. Thoughts?

I also need to remove the query that's no longer being used.
2019-03-29 14:21:05 +00:00
Alexey Bezhan
4254721cc4 Merge pull request #2422 from alphagov/increase-db-conn-pool-size
Increase DB connection pool size for API instances
2019-03-29 10:06:15 +00:00
Leo Hemsted
29df5730cb Merge pull request #2423 from alphagov/more-retention
combine post + get inbound, and make them respect data retention
2019-03-28 15:58:12 +00:00
Leo Hemsted
ff328eb594 add test for different retention lengths 2019-03-28 15:55:07 +00:00
Leo Hemsted
cf248a2af3 combine post + get inbound, and make them respect data retention
also removed the limit/limit_days args as they're not used by admin
2019-03-28 15:38:26 +00:00
Alexey Bezhan
1425d6e225 Increase DB connection pool size for API instances
We've seen the SQLAlchemy "could not acquire connection" error in
production during heavy traffic. Since we have more gunicorn eventlet
workers than we have DB connections available some workers need to
wait for a DB connection to become available before they can proceed
with the request. There's a timeout set on how long a worker would
wait and if that timeout is exceeded the above exception is raised.

Currently, we're using at most 1000 out of 5000 max DB connections,
40% peak CPU usage on the DB instance and an average of 60% CPU on
API instances during heavy load. The number of DB connections is
proportionally similar in preview and staging.

This slightly increases the number of max DB connections per API
instance. This should improve our utilization of API instances by
increasing the number of workers that can communicate with the DB
concurrently while staying well within the max DB connections limit.
2019-03-28 15:02:37 +00:00
Leo Hemsted
329fa9ba0d Merge pull request #2421 from alphagov/inbound-retention
make inbound sms page respect data retention
2019-03-28 14:28:54 +00:00
Leo Hemsted
493da7ef88 add test for inbound sms older than a week 2019-03-28 14:00:10 +00:00
Leo Hemsted
97110e293b make inbound sms page respect data retention
also, it should default to last 7 days, not last 6 days. also change
count_inbound_sms to have the days passed in, so that it's more
explicit at the endpoint that we only return 7 days regardless of your
service's data retention
2019-03-27 17:47:26 +00:00
Rebecca Law
b764eae738 Merge pull request #2420 from alphagov/change-pyup-to-create-weekly-updates
Add pyup configuration so that we only get one PR per week.
2019-03-27 15:26:47 +00:00
Rebecca Law
818ffe11b9 Merge pull request #2419 from alphagov/split-task
Split task for updating letters
2019-03-27 15:26:34 +00:00
Rebecca Law
b75b3e21f9 Add pyup configuration so that we only get one PR per week. 2019-03-27 14:58:13 +00:00
Rebecca Law
cb94f949a1 New command to iterate through the files on S3 and call record_daily_sorted_counts.
There are many files from early on that have not had the sorted counts recorded.
2019-03-26 15:49:21 +00:00
Chris Hill-Scott
a469bfd892 Merge pull request #2418 from alphagov/retry-migration-283
Retry making services created by platform admin users not counted in the list of live services
2019-03-26 13:32:25 +00:00
Chris Hill-Scott
6c20e510e8 Merge pull request #2416 from alphagov/pyup-update-pytest-mock-1.10.1-to-1.10.2
Update pytest-mock to 1.10.2
2019-03-26 09:37:37 +00:00
Chris Hill-Scott
b26c835818 Merge pull request #2406 from alphagov/pyup-update-coveralls-1.6.0-to-1.7.0
Update coveralls to 1.7.0
2019-03-26 09:37:30 +00:00
Chris Hill-Scott
853314efe9 Retry making services created by platform admin users not counted in the list of live services
The previous migration didn’t work because the `created_by_id` column
in services references the user who created the _version_ of the
service, not who created the service originally.

This commit runs another migration to wipe all the data, and replace it
using an operation that looks at the first version of the service in the
history table, which will reference the user who actually created the
service.
2019-03-25 17:31:52 +00:00
Chris Hill-Scott
133db85bc1 Merge pull request #2417 from alphagov/add-count-as-live-flag
Allow excluding services from live services count
2019-03-25 15:45:33 +00:00
Rebecca Law
4105f6638e Split the update letter statuses from counting the daily sorted/unsorted numbers.
We need to back fill the daily_sorted_count tables, so we need to iterate through all the files. No need to update the notification status. So this task has been separated out.
2019-03-25 15:30:48 +00:00
Chris Hill-Scott
1f12da3d04 Migrate existing platform admin services to not be counted
If a service has been created by someone on our team, it’s probably a
test service, which shouldn’t be included in the count of live services.

This commit adds a migration to do this for existing services.
2019-03-25 13:30:54 +00:00
Chris Hill-Scott
eb41ce7304 Make service created by platform admin non-counted
If a service has been created by someone on our team, it’s probably a
test service, which shouldn’t be included in the count of live services.
2019-03-25 13:30:13 +00:00
Chris Hill-Scott
b3008ee210 Allow excluding services from live services count
Sometimes we have to make a few services for what really is one
service, for example GOV.UK Pay and GOV.UK Pay Direct Debit. We also
have our own test services which aren’t included in the count of live
services. We currently count these as one service by not including them
in the beta partners spreadsheet.

This adds a column to mark such services as ‘not counted’, which can
later be used to exclude them from reporting.
2019-03-25 13:28:31 +00:00
pyup-bot
528275546a Update pytest-mock from 1.10.1 to 1.10.2 2019-03-25 12:28:14 +00:00
Chris Hill-Scott
0927a2e731 Merge branch 'master' into pyup-update-coveralls-1.6.0-to-1.7.0 2019-03-25 11:27:36 +00:00
Chris Hill-Scott
34bcb806ff Merge pull request #2415 from alphagov/fix-branding-association
Fix automatic inheritance of org’s branding
2019-03-22 16:07:21 +00:00
Chris Hill-Scott
6dff916e95 Merge pull request #2407 from alphagov/return-domains-for-org
Return an organisation’s domains and fix a bug where the domains were getting wiped when updating other attributes
2019-03-22 16:07:15 +00:00
Chris Hill-Scott
ef515400f3 Fix automatic inheritance of org’s branding
When creating a service it should inherit it’s organisation’s branding,
if that organisation has branding.

This wasn’t working because we were referring to the ID of the branding
when making the association, not the branding itself.
2019-03-22 15:57:20 +00:00
Katie Smith
9866a38133 Merge pull request #2409 from alphagov/update-dependencies
Update dependencies
2019-03-22 15:00:10 +00:00
Katie Smith
e15884f633 Merge pull request #2413 from alphagov/make-invited-users-folder-permissions-non-nullable
Make invited_users folder_permissions column non-nullable
2019-03-22 15:00:01 +00:00
Leo Hemsted
b4deedd8a9 Merge pull request #2414 from alphagov/unsorted-case
ignore case in the cost_threshold in dvla response files
2019-03-22 14:12:46 +00:00
Leo Hemsted
9da9968028 downgrade error to info 2019-03-22 14:06:45 +00:00
Katie Smith
9b739aaa1c Upgrade flask-marshmallow from 0.9.0 to 0.10.0 2019-03-22 13:43:36 +00:00
Katie Smith
60be63133c Upgrade marshmallow from 2.18.1 to 2.19.1 2019-03-22 13:43:36 +00:00
Katie Smith
5d03b92993 Upgrade marshmallow-sqlalchemy from 0.16.0 to 0.16.1 2019-03-22 13:43:36 +00:00
Katie Smith
05ab6ceeef Upgrade jsonschema from 3.0.0b3 to 3.0.1
Running `make freeze-requirements` causes Werkzeug to be updated from
0.14.1 to 0.15.1, which means that we need to change the message of 1
test.
2019-03-22 13:43:26 +00:00
Leo Hemsted
6fa7f0290d ignore case in the cost_threshold in dvla response files
we failed when we received UNSORTED instead of Unsorted
2019-03-22 12:07:08 +00:00
Katie Smith
8f5b5d636e Make invited_users folder_permissions column non-nullable
Now that notifications-admin is always sending through
folder_permissions, the folder_permissions column of the invited_user
table can be made non-nullable. The migration also backfills the column
(to []) to account for existing null values.
2019-03-22 10:49:45 +00:00
Katie Smith
8eb3e6d4b1 Merge pull request #2398 from alphagov/add-folder-permissions-to-invited-users
Add folder permissions to invited users
2019-03-22 10:48:07 +00:00
Katie Smith
dc5f1035ed Merge pull request #2411 from alphagov/pyup-update-pytest-xdist-1.26.1-to-1.27.0
Update pytest-xdist to 1.27.0
2019-03-22 10:47:35 +00:00
Katie Smith
2aa14bc41c Set folder permissions when adding a user to a service
This sets the folder permissions for a user when adding them to a
service. If a user is being added to a service after accepting an
invite, we need to account for the possibility that the folders we are
trying to add them to have been deleted before they accepted the invite.
2019-03-22 09:30:39 +00:00
Katie Smith
b0d3bd9046 Update add_user_to_service endoint to only handle new data format
Updated the add_user_to_service endpoint to only handle data in the
'new' format (`{"permissions": [...]}` instead of `[permission_1, permission_2]`)
since Admin has been updated to send data the new way.

This change means that we no longer need the Marshmallow Permission
schema, so it can be deleted.
2019-03-22 09:30:39 +00:00