Skip to content

Conversation

@nhsdevws
Copy link
Contributor

@nhsdevws nhsdevws commented Oct 2, 2025

Summary

  • ✨ New Feature

Permit upload to redis cache of json schema.
,
New version feathres:

  • permits upload of json files - with ".json" extension.
  • Unrecognized files will not be uploaded. Previously, unrecognised files result in exception.
  • json will be referenced with the filename as the key, in lowercase, and with an underscore instead of "." eg a.json gives key of "a_json"

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 or part of the acceptance criteria of the ticket, and the code is in a mergeable state.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • I have ensured the changelog has been updated by the submitter, if necessary.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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

VED-790

@nhsdevws nhsdevws changed the title DRAFT - VED-790-Redis-Schema-Storage VED-790-Redis-Schema-Storage Oct 3, 2025
@nhsdevws nhsdevws self-assigned this Oct 3, 2025
logger.info("No specific transformation defined for file type: %s", file_type)
return data # Default case, return data as is if no transformation is defined

return transform_generic(data, file_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: previously when no transformation was defined, transform_map() returned data; now it returns {}. Is this intentional?

Copy link
Contributor Author

@nhsdevws nhsdevws Oct 6, 2025

Choose a reason for hiding this comment

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

Previously it threw an exception. Unrecognized formats were not stored.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another question: why would we want to store unrecognised formats e.g. an arbitrary JSON file that the project does not need to retrieve from Redis?

Copy link
Contributor

@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.

Several points require addressing. Some minor, but a major issue concerning how file naming and key naming so that we will not have to rework this when it comes to components retrieving the validation schema.

class RedisCacheKey:
PERMISSIONS_CONFIG_FILE_KEY = "permissions_config.json"
DISEASE_MAPPING_FILE_KEY = "disease_mapping.json"
VALIDATION_SCHEMA_FILE_KEY = "schema.json"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

filename should be ValidationRules.JSON

Copy link
Contributor

@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.

Happy with the changes now - will approve once new file name is clarified.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2025

@nhsdevws nhsdevws enabled auto-merge (squash) October 6, 2025 09:41
@nhsdevws nhsdevws merged commit a6346f9 into master Oct 6, 2025
7 checks passed
@nhsdevws nhsdevws deleted the VED-790-Redis-Schema-Storage branch October 6, 2025 09:50
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.

3 participants