Commit Graph

25 Commits

Author SHA1 Message Date
Rebecca Law
f965322f25 Fixes to the delete letter notifications.
If there are no files to delete we won't get an excpetion.
Wrap the delete file in a try/except to avoid stopping the entire task.
Fix the missing slash for the file name.
2018-08-13 14:09:51 +01:00
Rebecca Law
eb2c878edd Fix bug with deleting the S3 file.
Removed the duplicate method.
2018-08-13 11:33:19 +01:00
Rebecca Law
d0e9ab4972 If the notifications that are being deleted are letters then we need to delete the letter from s3 as well. 2018-08-08 16:20:25 +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
Chris Hill-Scott
a4857c08ab Read job metadata from S3 metadata
All of our uploads now have the metadata about the job set on them in
S3. So this commit moves to using that metadata, if it’s there, instead
of the data in the body of the post request.

The aim of this is to stop the admin app having to post this data, which
means that it won’t have to keep this data in the session for the
while doing the file upload flow.
2018-04-30 11:47:13 +01:00
Ken Tsang
edd030e5dd Refactor code to move business logic
- DVLA specific logic is now moved to letters_pdf_tasks
2018-01-26 14:45:36 +00:00
venusbb
8f5a5f8105 Parse acknowledgement files against .ZIP.TXT created by ftp app.
- Also convert the files info to upper() for comparison rather than lower
because original file names are in upper case. The unit tests contain examples of the returned lists.
2018-01-18 10:44:36 +00:00
venusbb
7d84b4629a Using key query rather than try catch
Added a unit test for empty content
2018-01-17 14:45:34 +00:00
venusbb
9179802717 Fix a typo error on task argument
Modify unit test to be more robust
2018-01-17 12:21:56 +00:00
venusbb
f273b23c25 Get ack files only from day before the ack file is received.
Take care of upper and lower case of file names and contents
Add a test for s3 get_list_of_files_by_suffix
2018-01-16 09:34:09 +00:00
venusbb
24b785e7e0 Added process for dvla acknowledgement file
Daily schedule task to check ack file against zip file lists
if we haven't receive ack for a zip file, raise a 500 exception
2018-01-12 15:44:00 +00:00
Ken Tsang
3a4b8673bc Update upload_letters_pdf to use config setting for letter processing deadline 2017-12-19 13:23:55 +00:00
Leo Hemsted
1ca252dcf9 put pdfs in tomorrow's dvla bucket after 17:30
So if someone sends a letter in the evening, it gets picked up the
next day
2017-12-15 11:47:52 +00:00
Ken Tsang
bad129c5e9 Add extra logging for upload_letters_pdf 2017-12-12 12:07:55 +00:00
Ken Tsang
7b390e74c4 Upper case the filename to meet requirements 2017-12-05 16:03:08 +00:00
Ken Tsang
aa39f47d8e Added letters pdf S3 upload function
- uses s3upload from notifications_utils which will create an s3 bucket if it doesn't already exist
2017-12-04 16:48:38 +00:00
Leo Hemsted
7dd3c1df5a set letter notifications to pending while notify-ftp does its stuff
this means that if the task is accidentally ran twice (eg we autoscale
notify-celery-worker-beat to 2), it won't send letters twice.

Additionally, update some function names and config variables to make
it clear that they are referring to letter jobs, rather than all letter
content
2017-09-26 09:57:35 +01:00
Imdad Ahad
a1a5377f9c Add methods to get and remove s3 bucket objects 2017-06-13 12:36:34 +01:00
Imdad Ahad
1d30d93c6f Add s3 method to remove transformed dvla files 2017-06-07 16:31:14 +01:00
Imdad Ahad
ee484ec368 Add get_s3_file method for use in DVLA processing 2017-05-15 10:48:37 +01:00
Imdad Ahad
7a10a91262 Revert "Process SNS request triggered by a DVLA S3 update" 2017-05-12 17:21:07 +01:00
Imdad Ahad
f766f90207 Add task to process a DVLA response file:
* Currently we do nothing with the parsed response. We will
* update the status of the notifications in a separate PR
2017-05-12 14:24:26 +01:00
Nicholas Staples
143d1b0db8 Updated to retrieve csv upload from new bucket.
Fix test errors.
2016-04-07 14:10:30 +01:00
Nicholas Staples
4cc0028b01 Remove csv after process job is finished.
Fixed new tests.
2016-04-05 14:55:03 +01:00
Martyn Inglis
b3884e2d6c Move job processing into celery
- brings boto S3 into new AWS folder
- CSV processing utils method

Rejigs the jobs rest endpoint - removes some now unused endpoints,

Calls to the task with the job, job processing in task, delegating SMS calls to the sms task
2016-02-24 17:12:30 +00:00