Skip to content

[GPCAPIM-396] Local SDS Int Integration#188

Merged
ian-robinson-35 merged 14 commits intomainfrom
feature/GPCAPIM-396-sds-int
Apr 30, 2026
Merged

[GPCAPIM-396] Local SDS Int Integration#188
ian-robinson-35 merged 14 commits intomainfrom
feature/GPCAPIM-396-sds-int

Conversation

@ian-robinson-35
Copy link
Copy Markdown
Contributor

@ian-robinson-35 ian-robinson-35 commented Apr 23, 2026

Description

Moves SDS connection to INT for localInt setup. Will need to make relevant secret and env var updates based on David H's work that's not merged yet.

Context

Part of proving the INT connections locally

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming
  • Exceptions/Exclusions to coding standards (e.g. #noqa or #NOSONAR) are included within this Pull Request.

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.


sds = SdsFhirApiStub()
get = sds.get # type: ignore
def get(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm interested in what other people think about this pattern, but I think it's nicer than the conditional imports. We're not planning on moving to separately deployment mocks any time soon, so I think a little wrapper function is useful. Not technically part of the scope of this ticket though, so I can revert and discuss separately if we want to.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Six of one ... for me.

Comment thread gateway-api/src/gateway_api/sds/client.py Outdated
Comment thread gateway-api/src/gateway_api/conftest.py Outdated
Comment thread gateway-api/src/gateway_api/controller.py Outdated
self.base_url = base_url.rstrip("/")
self.timeout = timeout
self.api_key = self._get_api_key()
self.api_key = api_key
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This fits better with the env var pattern established in the previous ticket. If we try to read the config from the "app" variable in app.py we get circular imports

) -> None:
"""
Test that the controller uses the SDS URL provided in the constructor.
Test that the controller uses the SDS URL and API token provided in the constructor.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This unit test was checking the call to get inside the client. That means it's really testing both modules. So I've refactored a little so that the responsibility of this test is to prove that the vars are passed down to the client. It's then the responsibility of the client tests to prove that they use those vars correctly.

Comment thread scripts/env/app/pds.sh
;;
int)
echo "https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/"
echo "stub"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PDS INT comes in another ticket, so leaving as "stub" for now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done the same in my INT Provider ticket 👍

@ian-robinson-35 ian-robinson-35 marked this pull request as ready for review April 28, 2026 13:33
@ian-robinson-35 ian-robinson-35 requested a review from a team as a code owner April 28, 2026 13:33
Copy link
Copy Markdown
Contributor

@davidhamill1-nhs davidhamill1-nhs left a comment

Choose a reason for hiding this comment

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

Yet to run locally, but a couple of very minor comments.

Comment thread bruno/gateway-api/collections/Steel_Thread/environments/localInt.yml Outdated

sds = SdsFhirApiStub()
get = sds.get # type: ignore
def get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Six of one ... for me.

Comment thread gateway-api/src/gateway_api/sds/test_client.py Outdated
Comment thread gateway-api/src/gateway_api/test_controller.py Outdated
Comment thread scripts/env/app/pds.sh
;;
int)
echo "https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/"
echo "stub"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done the same in my INT Provider ticket 👍

@davidhamill1-nhs
Copy link
Copy Markdown
Contributor

Run locally. Looks good. 👍

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Deployment Complete

@ian-robinson-35 ian-robinson-35 merged commit eb5cf39 into main Apr 30, 2026
54 checks passed
@ian-robinson-35 ian-robinson-35 deleted the feature/GPCAPIM-396-sds-int branch April 30, 2026 08:44
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