Commit Graph

5411 Commits

Author SHA1 Message Date
Rebecca Law
78f8c17fe8 Merge pull request #1965 from alphagov/check-data-retention-before-purging-notifications
Purge notifications for configured days of retention
2018-08-03 13:49:49 +01:00
Rebecca Law
5c52679685 Merge pull request #1989 from alphagov/email_branding_name_and_text
Email branding name and text
2018-08-02 16:32:44 +01:00
Rebecca Law
c30e58eaad Instead of deleting the data in the name field just copy it to the text field.
The admin app still needs to use the name column.
Add the text field to the post data schemas.
If the text is not in the post data, then populate it with the data in the name field.
This should make the migration to text easier, and will work until we are able to update the admin app.
2018-08-02 15:55:45 +01:00
Sakis
b10ea754a1 Merge pull request #2024 from alphagov/celery-dev-null
Celery dev null
2018-08-01 13:41:59 +01:00
Athanasios Voutsadakis
56ba5d207b Refactor test fix 2018-08-01 11:31:53 +01:00
Pea Tyczynska
4345771547 Update migration file version number for email_branding update 2018-07-31 18:01:58 +01:00
Pea Tyczynska
d8d94b431f Find email_branding by name 2018-07-31 17:58:19 +01:00
Pea Tyczynska
f69bc50985 Move data back before dropping the column for downgrade 2018-07-31 17:58:19 +01:00
Pea Tyczynska
c5792f4d79 Migration file for email_branding fields update 2018-07-31 17:58:19 +01:00
Pea Tyczynska
c4bfd5479e Update EmailBranding model so it has separate name and text fields 2018-07-31 17:58:19 +01:00
Athanasios Voutsadakis
f14107b723 Fix test that checks queues 2018-07-31 17:26:33 +01:00
Athanasios Voutsadakis
63ffb01800 Bump python from 3.5.4 to 3.5.5 2018-07-31 17:09:14 +01:00
Athanasios Voutsadakis
0511fa70d0 Redirect stderr of workers to /dev/null
Celery prints its own stuff to stderr in a non-json format.

These get picked up by syslog drain and are shipped to
logstash together with the normal json-formatted logs resulting in
duplicate information and reducing the usability of the logs.
2018-07-31 17:09:14 +01:00
Pea (Malgorzata Tyczynska)
6cbf73b491 Merge pull request #2025 from alphagov/fix_migration_versioning
Fix migration version numbering
2018-07-31 16:49:49 +01:00
Pea Tyczynska
cf20cea81c Fix migration version numbering 2018-07-31 16:44:21 +01:00
Pea (Malgorzata Tyczynska)
ea28b65871 Merge pull request #1999 from alphagov/drop_monthly_billing_table
Drop monthly billing table
2018-07-31 16:35:48 +01:00
Rebecca Law
f419bf7bdb Merge pull request #2022 from alphagov/fix-letter-rate-bug
Handle zero as a letter page count in billing.
2018-07-31 14:18:52 +01:00
Rebecca Law
2f120b30e8 Fix codestyle 2018-07-31 14:13:15 +01:00
Rebecca Law
ab28691a70 Add number to migration file name 2018-07-31 14:06:29 +01:00
Rebecca Law
cc36209564 Fix file name for migration script 2018-07-31 14:00:18 +01:00
Rebecca Law
7378232353 Added migration script 2018-07-31 13:54:37 +01:00
Rebecca Law
19890412c9 Added a cancelled notification status so that we can cancel letters before they are sent. 2018-07-31 13:52:04 +01:00
Pea Tyczynska
885ed1e8e3 Remove monthly_billing table from the database 2018-07-31 11:47:13 +01:00
Rebecca Law
67639bf49c Merge branch 'master' into check-data-retention-before-purging-notifications 2018-07-31 11:40:58 +01:00
Chris Hill-Scott
c8f307e838 Merge pull request #2016 from alphagov/quis-patch-1
Fix broken Markdown headings in README
2018-07-31 11:08:32 +01:00
Rebecca Law
ff2334937c Last night we had some letter notifications that were in permanent failure and had page count = 0.
This causes the create-nighlty-billing task to fail.
This will make sure that 0 is returned in this case.
2018-07-31 11:04:48 +01:00
Alexey Bezhan
536154d79f Merge pull request #2017 from alphagov/pyup-ignore-requirements-txt
Make pyup ignore requirements.txt
2018-07-31 11:01:12 +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
Chris Hill-Scott
b8913b62ec Fix broken Markdown headings in README 2018-07-30 15:25:48 +01:00
Pea (Malgorzata Tyczynska)
018585eccc Merge pull request #1981 from alphagov/get_rid_of_monthly_billing
Remove monthly_billing table and all references to it
2018-07-30 11:48:34 +01:00
Pea Tyczynska
b28ec8beda Use old monthly_billing-related routes for new functions 2018-07-30 11:33:15 +01:00
Pea Tyczynska
4e49df2479 Delete MonthlyBilling model 2018-07-30 11:07:42 +01:00
Pea Tyczynska
ca2b350a99 Remove references to monthly_billing table from api 2018-07-30 11:07:42 +01:00
Pea Tyczynska
c0f309a2a6 Delete scheduled task to populate monthly_billing 2018-07-30 11:06:04 +01:00
Leo Hemsted
1d2e086109 Merge pull request #1994 from alphagov/fix-billing-update
make rebuild-ft-billing-for-day remove unused rows
2018-07-30 09:58:29 +01:00
Leo Hemsted
a826f6e924 make rebuild-ft-billing-for-day remove unused rows
if the billing data was incorrect and needs to be rebuilt, we should
remove old rows. Previously we were only upserting new rows, but old
no-longer-relevant rows were staying in the database. This commit
makes the flask command remove *all* rows for that service and day,
before inserting the rows from the original notification data after.

This commit doesn't change the existing nightly task, nor does it
change the upsert that happens upon viewing the usage page. In normal
usage, there should never be a case where the number of billable units
for a rate decreases. It should only ever increase, thus, never need to
be deleted
2018-07-26 19:10:30 +01:00
Tom Byers
f16c83954c Merge pull request #1988 from alphagov/add-spacing-changes-to-email-template
Brings in spacing changes to the email template
2018-07-25 15:48:07 +01:00
Tom Byers
d6603a0541 Brings in spacing changes to the email template 2018-07-25 15:28:23 +01:00
Rebecca Law
3a75a58c97 Merge pull request #1987 from alphagov/fix-unique-key-service_callback_api
Fix unique constraint on ServiceCallbackApi
2018-07-25 14:24:52 +01:00
Rebecca Law
2b0ec9353e Added missing migration file 2018-07-25 14:16:36 +01:00
Rebecca Law
a812060915 The unique constraint on SeviceCallbackApi was on service_id only.
Now that we have 2 types of api callbacks the constraint to be on service_id + callback_type.
2018-07-25 14:12:13 +01:00
Rebecca Law
e4bef01ae1 Merge pull request #1983 from alphagov/increase-days-to-calc-billing
Increase the number of days we calculate billing from 3 to 10 days.
2018-07-25 10:32:45 +01:00
Rebecca Law
4fc004b00a Increase the number of days we calculate billing from 3 to 10 days.
Log exception if the billing counts for letters are different in the dvla response file than what we collected.
2018-07-24 16:28:30 +01:00
Pea (Malgorzata Tyczynska)
1b21a12b83 Merge pull request #1971 from alphagov/add_task_to_send_complaints_on
Add and call task to send complaints on to service callback APIs
2018-07-24 15:07:09 +01:00
Rebecca Law
0675f09afb Need to be able to query the notification statistics for the right number of days.
If the request is for the big numbers on the activity page, then we need to use the number right number of days.
Added an end point to get the data retention for the service and notification type, which is needed on the activity page to say how long the report is available for.
2018-07-23 09:56:04 +01:00
Rebecca Law
dae29a1b61 Update the query for the notifications activity page to return the data for the days of retention if set. 2018-07-23 09:56:04 +01:00
Rebecca Law
9674005c71 Updated the function to delete notifications over a week old to look at ServiceDataRetention to only delete notifications specified number of days for the notification type. 2018-07-23 09:56:03 +01:00
Leo Hemsted
d61300accb Merge pull request #1944 from alphagov/research-letter-time
create fake letter response files with variables timestamps
2018-07-20 12:22:44 +01:00
Leo Hemsted
5c4f3e246c make test dvla response file timestamps in a random order
since there'll be a bunch of threads running functional test tasks at
the same time, there's no point always trying to start from the same
second and then stepping back to the same one-second-back file each
time. Also, this leads us to an increased risk of race conditions.

This change takes the same thirty second range, but shuffles it. The
tests, since they're no longer deterministic, now use a new Matcher
object (w/ credit to alexey) to match any filename from within that
thirty second range
2018-07-20 12:09:00 +01:00
Leo Hemsted
0cfed3f514 create fake letter response files with variables timestamps
when a test letter is created on dev or preview, we upload a file to
the dvla ftp response bucket, to test that our integration with s3
works. s3 triggers an sns notification, which we pick up, and then we
download the file and mark the letters it mentions as delivered.

However, if two tests run at the same time, they'll create the same
file on s3. One will just overwrite the next, and the first letter will
never move into delivered - this was causing functional tests to
intermittently fail.

This commit makes the test letter task check if the file exists - if it
does, it moves back one second and tries again. It tries this thirty
times before giving up.
2018-07-20 12:09:00 +01:00