Skip to content

Conversation

@JamesW1-NHS
Copy link
Contributor

@JamesW1-NHS JamesW1-NHS commented Jan 8, 2026

Summary

  • Routine Change

To refactor elements of lambdas into shared/ which we didn't do in VED-807.

Refactor ack file handling from filenameprocessor/recordprocessor (make_and_upload_ack_file)
Make singleton from sqs_client
Make singleton from all other clients (dynamodb, firehose, etc.)

Notes:

  • We won't refactor the local functions from fhir_repository/fhir_batch_repository. These contain PK values and should remain in the API and batch projects.
  • I have removed the tests from test_clients.py which check that a global client variable is None at import time. Reason: such a variable could be set in preceding tests. The remaining tests suffice to test that a global client variable is never created more than once. The alternative would have been to reintroduce importlib.reload(), which would create side-effects in other test modules.

Note for Testers:

No change in functionality.

No code changes in the backend.

Code changes in the following lambdas:

  • ack_backend
  • filenameprocessor
  • id_sync
  • recordforwarder
  • recordprocessor
  • redis_sync

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Review Checklist

ℹ️ This section is to be filled in by the reviewer.

  • I have reviewed the changes in this PR and they fill all of the acceptance criteria of the ticket.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • If there were changes that are outside of the regular release processes e.g. account infrastructure to setup, manual setup for external API integrations, secrets to set, then I have checked that the developer has flagged this to the Tech Lead as release steps.
  • I have checked that no Personal Identifiable Data (PID) is logged as part of the changes.

@JamesW1-NHS JamesW1-NHS marked this pull request as draft January 8, 2026 17:49
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket:

VED-917

Copy link
Collaborator

@dlzhry2nhs dlzhry2nhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor comments. Changes to the functionality look good. Only major thing is I'm not sure the new util is in the right place within shared.

@sonarqubecloud
Copy link

@JamesW1-NHS JamesW1-NHS temporarily deployed to internal-dev-sandbox January 12, 2026 14:43 — with GitHub Actions Inactive
@JamesW1-NHS JamesW1-NHS enabled auto-merge (squash) January 12, 2026 14:45
@JamesW1-NHS JamesW1-NHS merged commit 3c867a8 into master Jan 12, 2026
17 checks passed
@JamesW1-NHS JamesW1-NHS deleted the VED-917-refactoring branch January 12, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants