Conversation
|
This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket: VED-956 |
dlzhry2nhs
left a comment
There was a problem hiding this comment.
Looks good - just a handful of comments. Only really key thing in there is to avoid putting functionality in the log decorators.
I tested manually and all looked okay, albeit with a very small file. One thing to consider, as I am sure this will be tested with larger files, is the eventually consistent nature of DynamoDB. Hopefully it will be fast enough, but there is a risk that we may calculate the success count while DDB is still working through out increment requests for failures.
One potential mitigation would be, had we followed the architecture diagram then we could have incremented failures slightly earlier in the process in the recordforwarder. I am okay with the proposed approach in this PR.
Another potential option could be to use a ConsistentRead, though I don't know enough to say if that will work for sure. Will leave it up to you whether you want to make any adjustments, or keep this up the sleeve in case there are any test findings.
| self.mock_dynamodb_client.get_item.return_value = {"Item": {"message_id": {"S": test_message_id}}} | ||
|
|
||
| self.assertIsNone(audit_table.get_record_count_by_message_id(test_message_id)) | ||
|
|
There was a problem hiding this comment.
I am fine with these tests as-is. We are using moto in the relevant integration tests i.e. test_ack_processor.
I think mocking is fine for this unit test.
| message_id = base_log_data.get("message_id") | ||
| set_audit_table_ingestion_complete(file_key, message_id, complete_time) | ||
|
|
||
| generate_and_send_logs(STREAM_NAME, complete_time, base_log_data, additional_log_data) |
There was a problem hiding this comment.
https://screening-discovery.slack.com/archives/C08AVB8MEBG/p1764772944077509 Sorry I should have pinged you about this. Please see the 4th to last message. We should include the full payload from complete_batch_file_process in the additional logs, and also add the success and failure count into this payload. It already records the record count.
I can handle updating ITOC with the changes they will need to make to their queries.
Noted. If it proves too slow then we ought to make a new ticket to refactor the failures into the recordforwarder. |
|



Summary
Add any other relevant notes or explanations here. Remove this line if you have nothing to add.
Reviews Required
Review Checklist
ℹ️ This section is to be filled in by the reviewer.