Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix end-to-end test failures caused by Pydantic serializing ForwardResponse.user/patients using the declared base type (Demographics), which drops subtype-specific fields for EMIS/TPP patient models.
Changes:
- Update
ForwardResponseto useSerializeAsAnyso runtime subtype fields are preserved during serialization. - Rename the EMIS-specific
Patientmodel toPersonand update EMIS client/tests accordingly. - Update Proxygen credential placeholders and GitHub Actions workflow/action inputs (currently inconsistent and likely to break CI).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
app/api/domain/forward_response_model.py |
Uses SerializeAsAny on user/patients to preserve subtype serialization. |
app/api/infrastructure/emis/models.py |
Renames EMIS Patient model to Person; updates SessionResponse typing. |
app/api/infrastructure/emis/client.py |
Updates EMIS client to construct Person and fixes docstring typing/spelling. |
app/api/infrastructure/emis/tests/test_client.py |
Updates EMIS tests to use Person. |
app/api/infrastructure/tpp/client.py |
Fixes docstring spelling (“structual” → “structural”). |
.github/workflows/pull-request-checks.yml |
Switches Proxygen secret names to NEW_PROXYGEN_* (currently mismatched with reusable workflow/action). |
.github/actions/setup-proxygen/action.yaml |
Updates sed/echo steps to inputs.NEW_PROXYGEN_* (but inputs are still declared as PROXYGEN_*). |
proxygen/credentials.yaml |
Updates placeholder strings used for sed substitution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…gital/im1-pfs-auth into task/NPA-6546/fix-end-to-end-tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
🧾 Ticket Link
https://nhsd-jira.digital.nhs.uk/browse/NPA-6546
📄 Description/Summary of Changes
We have two classes, Demographics, and specific Patient models for TPP and EMIS that inherit from Demographics
Since we were using Demographics in the forwards_response.py file, pydantic was dropping all the extra fields we have on the specific TPP and EMIS Patient classes because it was using the types declared in forwards_response.py not the runtime types
Using SerializeAsAny makes Pydantic serialise the actual runtime types and not drop the extra fields
There are also new additions to enable the new proxygen deployments to be fixed
These include adding the new keys to GitHub secrets and adding the PTL_ and PROD_ variables to the GitHub actions
We also now have split out Prod and PTL actions/config files
🧪 Developer Testing Carried Out
📋 PR Principles
🏷️ Naming Conventions Reminder
Please ensure the following naming conventions are followed:
NPA-XXXX: <short-description><type>/NPA-XXXX/<short-description>NPA-XXXX: <short-description>