Commit Graph

42 Commits

Author SHA1 Message Date
Kenneth Kehl
3cba7f157e fix tests 2024-09-26 13:29:22 -07:00
Kenneth Kehl
c2f2cbc3bb fix tests 2024-09-26 13:18:14 -07:00
Kenneth Kehl
561d813d4e remove redis_store mocking from s3 tests 2024-09-26 12:24:06 -07:00
Kenneth Kehl
2f9fea909e actually start deleting old s3 objects 2024-09-11 07:31:50 -07:00
Kenneth Kehl
4e9e014a0c add test 2024-09-10 11:12:43 -07:00
Kenneth Kehl
baf878158f clean up s3 2024-08-16 11:10:10 -07:00
Kenneth Kehl
496571686a initial 2024-08-16 09:53:29 -07:00
Kenneth Kehl
0c3b382562 fix test 2024-08-15 17:25:03 -07:00
Kenneth Kehl
7258105c91 fix flake 8 2024-08-13 15:45:39 -07:00
Kenneth Kehl
db9197e7a6 ugh secrets 2024-08-13 15:32:43 -07:00
Kenneth Kehl
905df17f65 remove datetime.utcnow() 2024-05-23 13:59:51 -07:00
Kenneth Kehl
0010a431a6 merge from main again 2024-02-06 12:31:32 -08:00
Kenneth Kehl
82dd29d457 handle bom in phone number field 2024-02-01 12:01:29 -08:00
Kenneth Kehl
ed3a356ad1 merge from main and fix some tests 2024-01-19 08:58:24 -08:00
Kenneth Kehl
7997d887c6 fix case sensitivity looking up phone number 2024-01-18 10:53:20 -08:00
Kenneth Kehl
567dd390b4 fix personalisation 2024-01-18 10:03:35 -08:00
Kenneth Kehl
3e6229b87a fix tests add redis mock 2024-01-12 07:42:21 -08:00
Kenneth Kehl
726e0b15fa code review feedback 2024-01-08 14:31:28 -08:00
Kenneth Kehl
a5f78224b2 remove print statements 2024-01-05 10:39:07 -08:00
Kenneth Kehl
88379c9e46 final 2024-01-05 10:35:14 -08:00
Kenneth Kehl
c082546aa0 add migration for e2e tests and improve code coverage 2023-09-12 10:15:07 -07:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Ryan Ahearn
84e7e9b5cf Use credentials output by terraform/development 2023-03-13 13:44:10 -04:00
Ryan Ahearn
22aa7e2787 Remove default creds from s3 module 2023-03-03 16:01:12 -05:00
Ryan Ahearn
538d2cbe4c Proactively specify aws region for s3 operations 2022-09-26 10:56:59 -04:00
Ryan Ahearn
8ede076708 Use correct access credentials for each bucket 2022-09-22 12:14:25 -04:00
Ben Thorner
ff7eebc90a Simplify deleting old letters
Previously we made a call to S3 to list objects for a letter, even
though we already had the precise key of the single object to hand.
This removes the one usage of "get_s3_bucket_objects" and uses the
filename directly in the call to remove the object.
2021-03-15 17:18:20 +00:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Chris Hill-Scott
3b0b96834d Do extra code style checks with flake8-bugbear
Flake8 Bugbear checks for some extra things that aren’t code style
errors, but are likely to introduce bugs or unexpected behaviour. A
good example is having mutable default function arguments, which get
shared between every call to the function and therefore mutating a value
in one place can unexpectedly cause it to change in another.

This commit enables all the extra warnings provided by Flake8 Bugbear,
except for:
- the line length one (because we already lint for that separately)
- B903 Data class should either be immutable or use `__slots__` because
  this seems to false-positive on some of our custom exceptions
- B902 Invalid first argument 'cls' used for instance method because
  some SQLAlchemy decorators (eg `declared_attr`) make things that
  aren’t formally class methods take a class not an instance as their
  first argument

It disables:
- _B306: BaseException.message is removed in Python 3_ because I think
  our exceptions have a custom structure that means the `.message`
  attribute is still present

Matches the work done in other repos:
- https://github.com/alphagov/notifications-admin/pull/3172/files
2020-12-22 16:26:45 +00:00
Katie Smith
62b11bc61e Delete delete_dvla_response_files_older_than_seven_days task
This was not being used.
2020-04-02 14:49:47 +01:00
David McDonald
a14d5f0225 Remove task that no longer runs
We no longer puts files in these s3 buckets (and have in fact deleted
the buckets) therefore this task is redundant and can be removed.
2020-02-06 10:57:43 +00: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
7d84b4629a Using key query rather than try catch
Added a unit test for empty content
2018-01-17 14:45:34 +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
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
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
1dacc6c3a3 Updates:
* Skip the decorated tests as that doesn't work as we expect
* Remove magic numbers in tests
2017-06-13 15:22:31 +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