SPINEDEM-5945 Update sync-wrap to match /Patient/$process-birth-details#1271
Open
fabianmcgibbon wants to merge 19 commits intomasterfrom
Open
SPINEDEM-5945 Update sync-wrap to match /Patient/$process-birth-details#1271fabianmcgibbon wants to merge 19 commits intomasterfrom
fabianmcgibbon wants to merge 19 commits intomasterfrom
Conversation
|
This branch is working on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket: SPINEDEM-5945 |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
…create-patient-at-birth
There was a problem hiding this comment.
Pull request overview
Extends the existing POST rate-limiting/spike-arrest behavior to also cover the /Patient/$process-birth-details endpoint, and updates functional + Karate tests/mocks to align with the new behavior.
Changes:
- Apply the
SpikeArrest.PatientCreatestep to POST requests for both/Patientand/Patient/$process-birth-details. - Add a new pytest-bdd scenario + step for rate-limit testing of the record-at-birth endpoint, with some helper refactoring.
- Harden Karate tests against transient 502s during retry, and update a record-at-birth mock OperationOutcome payload.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/functional/test_patient_create.py | Adds a new pytest-bdd scenario/step for $process-birth-details and refactors the “post many times” helper. |
| tests/functional/features/post_patient.feature | Adds a new Gherkin scenario to exercise spike-arrest on the record-at-birth endpoint. |
| proxies/live/apiproxy/targets/sync-wrap.xml | Updates the Apigee condition to include /Patient/$process-birth-details for POST spike-arrest. |
| karate-tests/src/test/java/patients/healthcareWorker/updatePatientDetails/oasExamples.feature | Adds retry-until handling for 502 responses in the background GET. |
| karate-tests/src/test/java/patients/common/createPatient.feature | Updates retry-until conditions to also retry on 502. |
| karate-tests/src/test/java/mocks/stubs/postPdsRecordAtBirthResponses/new_pds_record_at_birth_out__of_range_mother_age.json | Adds additional warning issues in the mocked OperationOutcome. |
Comments suppressed due to low confidence (1)
tests/functional/test_patient_create.py:160
elapsed_time_req.seconds == 0is a very brittle assertion here.timedelta.secondstruncates to whole seconds and is sensitive to crossing a second boundary, so this can fail even if requests are dispatched within <1s. Useelapsed_time_req.total_seconds()with an appropriate upper bound (e.g., < 1.0) or otherwise relax the check to avoid flakiness.
request_times = [x['request_time'] for x in results]
request_times.sort()
elapsed_time_req = request_times[-1] - request_times[0]
assert elapsed_time_req.seconds == 0
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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.



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.