Skip to content

Commit 67d3682

Browse files
Merge branch 'master' into dependabot/npm_and_yarn/multi-170d91aa79
2 parents ff28ff6 + e1a1b92 commit 67d3682

161 files changed

Lines changed: 17729 additions & 6648 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/continuous-integration-workflow.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
with:
1313
fetch-depth: 0 # This causes all history to be fetched, which is required for calculate-version to function
1414

15-
- name: Install Python 3.9
15+
- name: Install Python 3.13
1616
uses: actions/setup-python@v1
1717
with:
18-
python-version: 3.9
18+
python-version: 3.13
1919

2020
- name: Update apt repositories
2121
run: sudo apt update
@@ -70,6 +70,9 @@ jobs:
7070
- name: Run custom attribute reporter pytests
7171
run: make test-custom-attribute-reporter
7272

73+
- name: Generate examples
74+
run: make generate-examples
75+
7376
- name: Check resources are valid FHIR 4.0.1
7477
run: make validate
7578

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ venv
1414
.env
1515
*.code-workspace
1616
.tool-versions
17+
.venv
1718

1819
__pycache__/
1920
.envrc
@@ -27,6 +28,10 @@ tests/docker.env
2728
tests/*.key
2829
tests/.pytest_cache
2930

31+
32+
keys.zip
33+
ssocli-bundle.zip
34+
3035
scripts/custom_attribute_reporter/output/
3136

3237
ID_TOKEN_NHS_LOGIN_PRIVATE_KEY
@@ -39,3 +44,8 @@ keys/
3944
karate.jar
4045

4146
newman-test-report.xml
47+
git
48+
keys.zip:Zone.Identifier
49+
tests/scripts/get_token
50+
tests/scripts/acurl
51+
tests/scripts/install

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9
1+
3.13

Makefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ install-node:
1212
install-hooks:
1313
cp scripts/pre-commit .git/hooks/pre-commit
1414

15-
install-fhir-validator:
16-
mkdir -p bin
17-
test -f bin/org.hl7.fhir.validator.jar || curl -L https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar > bin/org.hl7.fhir.validator.jar
15+
BIN_DIR := bin
16+
FHIR_VALIDATOR := $(BIN_DIR)/validator_cli.jar
17+
FHIR_VALIDATOR_URL := https://github.com/hapifhir/org.hl7.fhir.core/releases/download/6.7.9/validator_cli.jar
1818

1919
karate:
2020
cd karate-tests && mvn clean test -Dtest=TestParallel
@@ -25,8 +25,17 @@ lint:
2525
find . -name '*.py' | xargs poetry run flake8
2626
find . -name '*.sh' | grep -v node_modules | xargs shellcheck
2727

28-
validate: generate-examples
29-
java -jar bin/org.hl7.fhir.validator.jar build/examples/**/*application_fhir+json*.json -version 4.0.1 -tx n/a -extension any | tee /tmp/validation.txt
28+
install-fhir-validator:
29+
@mkdir -p $(BIN_DIR)
30+
@if [ ! -s "$(FHIR_VALIDATOR)" ]; then \
31+
echo "Downloading FHIR validator: $(FHIR_VALIDATOR_URL)"; \
32+
curl -fSL "$(FHIR_VALIDATOR_URL)" -o "$(FHIR_VALIDATOR)"; \
33+
fi
34+
@test -s "$(FHIR_VALIDATOR)" || (echo "Validator jar missing or empty"; exit 1)
35+
36+
validate: install-fhir-validator
37+
@echo "Validating examples..."
38+
java -jar "$(FHIR_VALIDATOR)" build/examples/**/*application_fhir+json*.json -version 4.0.1 -tx n/a -extension any | tee /tmp/validation.txt
3039

3140
prism: publish
3241
prism proxy build/personal-demographics.json ${OAUTH_BASE_URI}/${PDS_BASE_PATH} --errors --validate-request false

azure/azure-build-pipeline.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ resources:
3030

3131
variables:
3232
- template: project.yml
33+
3334
extends:
3435
template: azure/common/apigee-build.yml@common
3536
parameters:
@@ -40,12 +41,17 @@ extends:
4041
PIP_CACHE_DIR: ".poetry"
4142
test_steps:
4243
- template: templates/install-jdk.yml
43-
4444
- bash: "make sandbox &"
4545
displayName: Start Sandbox Server
4646
workingDirectory: "${{ variables.service_name }}"
47-
4847
- bash: |
48+
set -eux
49+
# Build spec and examples
50+
make publish
51+
make generate-examples
52+
# Fetch validator and validate
53+
make install-fhir-validator
54+
ls -lh bin build build/examples || true
4955
java -version
5056
make validate
5157
displayName: Validate FHIR

azure/azure-pr-pipeline.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ extends:
4545
- template: templates/install-jdk.yml
4646
post_deploy:
4747
- template: templates/pds-tests-karate.yml
48+
parameters:
49+
python_version: ${{ variables.python_version }}
4850

4951
- environment: internal-dev
5052
stage_name: pytest_bdd_tests
5153
post_deploy:
5254
- template: templates/pds-tests.yml
55+
parameters:
56+
python_version: ${{ variables.python_version }}
5357
depends_on:
5458
- karate_tests
5559

@@ -60,7 +64,9 @@ extends:
6064
- template: templates/install-jdk.yml
6165
post_deploy:
6266
- template: templates/sandbox-tests.yml
63-
67+
parameters:
68+
python_version: ${{ variables.python_version }}
69+
6470
- environment: internal-dev
6571
service_name: ${{ variables.service_name }}-int
6672
short_service_name: ${{ variables.short_service_name }}-int
@@ -70,6 +76,8 @@ extends:
7076
- template: templates/install-jdk.yml
7177
post_deploy:
7278
- template: templates/pds-tests-dev-int.yml
79+
parameters:
80+
python_version: ${{ variables.python_version }}
7381
jinja_templates:
7482
PDS_TARGET_SERVER: spine-demographics-int
7583
REQUIRE_ASID: false

azure/azure-release-pipeline.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,29 @@ extends:
4141
RATE_LIMIT_POST: true
4242
apigee_deployments:
4343
- environment: internal-dev
44+
pre_deploy:
45+
- template: templates/install-jdk.yml
4446
post_deploy:
4547
- template: templates/pds-tests-dev.yml
4648
# only deploy to other environments if the build was NOT a daily overnight build
4749
- ${{ if ne(variables['resources.pipeline.build_pipeline.triggerReason'], 'Schedule') }}:
4850
- environment: internal-qa-sandbox
4951
enable_status_monitoring: false
5052
proxy_path: sandbox
53+
pre_deploy:
54+
- template: templates/install-jdk.yml
5155
post_deploy:
5256
- template: templates/sandbox-tests.yml
57+
5358
- environment: int
59+
pre_deploy:
60+
- template: templates/install-jdk.yml
5461
post_deploy:
5562
- template: templates/pds-tests-int.yml
5663
depends_on:
5764
- internal_dev
5865
- internal_qa_sandbox
66+
5967
- environment: ref
6068
enable_status_monitoring: false # revert when /_status implemented or endpoint updated
6169
depends_on:
@@ -65,14 +73,18 @@ extends:
6573
REQUIRE_ASID: false
6674
PDS_TARGET_SERVER: spine-demographics
6775
RATE_LIMIT_POST: false
76+
6877
- environment: sandbox
6978
proxy_path: sandbox
7079
enable_status_monitoring: false
80+
pre_deploy:
81+
- template: templates/install-jdk.yml
7182
post_deploy:
7283
- template: templates/sandbox-tests.yml
7384
depends_on:
7485
- internal_dev
7586
- internal_qa_sandbox
87+
7688
- environment: prod
7789
depends_on:
7890
- internal_dev

azure/project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ variables:
55
product_display_name: Personal Demographics Service
66
product_description: " "
77
spec_file: personal-demographics.json
8-
python_version: 3.9
8+
python_version: 3.13

azure/templates/pds-tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ steps:
2222
testResultsFiles: $(ARTIFACT_PATH)/tests/functional-test-report.xml
2323
failTaskOnFailedTests: true
2424

25+
- task: PublishPipelineArtifact@1
26+
displayName: 'Publish application restricted test results as an artifact'
27+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed')
28+
inputs:
29+
targetPath: $(ARTIFACT_PATH)/tests/functional-test-report.xml
30+
artifact: pytestFunctionalTestReport
31+
2532
- bash: |
2633
export APIGEE_API_TOKEN="$(secret.AccessToken)"
2734
export APIGEE_ACCESS_TOKEN="$(secret.AccessToken)"
@@ -38,6 +45,13 @@ steps:
3845
testResultsFiles: $(ARTIFACT_PATH)/tests/proxy-behaviour-test-report.xml
3946
failTaskOnFailedTests: true
4047

48+
- task: PublishPipelineArtifact@1
49+
displayName: 'Publish proxy behaviour test results as an artifact'
50+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed')
51+
inputs:
52+
targetPath: $(ARTIFACT_PATH)/tests/proxy-behaviour-test-report.xml
53+
artifact: proxyBehaviourTestReport
54+
4155
- bash: |
4256
export APIGEE_API_TOKEN="$(secret.AccessToken)"
4357
export APIGEE_ACCESS_TOKEN="$(secret.AccessToken)"
@@ -53,6 +67,12 @@ steps:
5367
inputs:
5468
testResultsFiles: $(ARTIFACT_PATH)/tests/sync-wrap-test-report.xml
5569
failTaskOnFailedTests: true
70+
- task: PublishPipelineArtifact@1
71+
displayName: 'Publish sync wrap test results as an artifact'
72+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed')
73+
inputs:
74+
targetPath: $(ARTIFACT_PATH)/tests/sync-wrap-test-report.xml
75+
artifact: syncwrapTestReport
5676

5777
- bash: |
5878
export APIGEE_API_TOKEN="$(secret.AccessToken)"
@@ -71,6 +91,13 @@ steps:
7191
inputs:
7292
testResultsFiles: $(ARTIFACT_PATH)/tests/patient-create-test-report.xml
7393
failTaskOnFailedTests: true
94+
95+
- task: PublishPipelineArtifact@1
96+
displayName: 'Publish post patient test results as an artifact'
97+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed')
98+
inputs:
99+
targetPath: $(ARTIFACT_PATH)/tests/patient-create-test-report.xml
100+
artifact: postPatientTestReport
74101

75102
- bash: |
76103
export APIGEE_API_TOKEN="$(secret.AccessToken)"
@@ -89,3 +116,10 @@ steps:
89116
inputs:
90117
testResultsFiles: $(ARTIFACT_PATH)/tests/patient-access-test-report.xml
91118
failTaskOnFailedTests: true
119+
120+
- task: PublishPipelineArtifact@1
121+
displayName: 'Publish patient access test results as an artifact'
122+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed')
123+
inputs:
124+
targetPath: $(ARTIFACT_PATH)/tests/patient-access-test-report.xml
125+
artifact: patientAccessTestReport

karate-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ We have a Dockerfile set up for the sandbox. You can build the image from this D
117117
```
118118
1. If you run the container you'll see the Karate mockserver logs
119119
```bash
120-
docker run --name karate-sandbox -p 9000:9000 nhs/pds-sandbox
120+
docker run --name karate-sandbox -p 9001:9000 nhs/pds-sandbox
121121
```
122122
1. Inspect the running container to discover its IP address:
123123
```bash

0 commit comments

Comments
 (0)