Skip to content

Conversation

@DWolfsNHS
Copy link
Collaborator

@DWolfsNHS DWolfsNHS commented Jan 9, 2026

Description

  • Update CI pipeline to build and deploy the container image.
  • Address SonarQube feedback to improve code quality and maintainability.

Testing
Verified CI pipeline execution for building and deploying the image.
Ensured all tests pass successfully after addressing Sonar feedback

Context

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.

Base automatically changed from GPCAPIM-166helloWorld to main January 9, 2026 14:35
@DWolfsNHS DWolfsNHS force-pushed the feature/GPCAPIM-166_built_image branch 3 times, most recently from 5fc01eb to a1ab514 Compare January 13, 2026 12:39
@DWolfsNHS DWolfsNHS marked this pull request as ready for review January 13, 2026 12:39
@DWolfsNHS DWolfsNHS requested a review from a team as a code owner January 13, 2026 12:39
neil-sproston
neil-sproston previously approved these changes Jan 13, 2026
Copy link
Contributor

@neil-sproston neil-sproston left a comment

Choose a reason for hiding this comment

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

Looks sane and appropiate

@DWolfsNHS
Copy link
Collaborator Author

note: Sonar issue has previously been accepted on main

Copy link
Collaborator

@nhsd-jack-wainwright nhsd-jack-wainwright left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor questions / comments.


branch_safe = replace(replace(var.branch_name, "/", "-"), " ", "-")
log_group_name = "/ecs/preview/${local.branch_safe}"
branch_after_feature = startswith(var.branch_name, "feature-") ? substr(var.branch_name, length("feature-"), length(var.branch_name) - length("feature-")) : var.branch_name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this startswith be looking for "feature/" instead of "feature-", or perhaps be acting on the branch_safe variable instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@neil-sproston - as Jack suggsest, I would expect the branch name to be feature/, but does this come after some other sanitisation of the naming that might have changed this to -?

Copy link
Contributor

Choose a reason for hiding this comment

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

The variable going into terraform already has feature/ changed to feature- this is done in the action and also relates to ecr image tags etc.

Comment on lines 67 to 69
/.pyenv/bin/pyenv install ${PYTHON_VERSION} && \
/.pyenv/bin/pyenv global ${PYTHON_VERSION} && \
/.pyenv/bin/pyenv init -
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very minor but is it worth indenting these calls to indicate that they're a part of the same RUN block as above?

echo "Installing x86 asdf executable..." ; \
wget -O asdf.tar.gz "$ASDF_DOWNLOAD_URL/asdf-v0.18.0-linux-amd64.tar.gz"; \
fi
fi && \
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above, is it worth indenting these calls to highlight that they are being invoked as part of the same run block?

Makefile Outdated
@echo "Building Docker image using Docker. Utilising python version: ${PYTHON_VERSION} ..."
@$(docker) buildx build --load --provenance=false --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t localhost/gateway-api-image infrastructure/images/gateway-api
@echo "Docker image 'gateway-api-image' built successfully!"
@$(docker) buildx build --load --provenance=false --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t ${IMAGE_NAME} infrastructure/images/gateway-api
Copy link
Collaborator

Choose a reason for hiding this comment

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

One thing that I've bumped into on the Pathology side that might be worth thinking about here is the architecture being used for the Python runtime. It might be worth explicitly declaring that we wish to build an x86 image here, as well as including the platform as part of the pip install when bundling the python dependencies.

I think the python build could be updated with something like:

@pip install ... --platform musllinux_1_1_x86_64 --only-binary=:all:

Indicating that any binaries should support musl 1.1 or higher and use the x86 architecture.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes made and validated on windows with make deploy and make test as discussed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Builds also validated in pipeline

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As well as behaviour with ephemeral AWS deployment

Copy link
Collaborator

@nhsd-jack-wainwright nhsd-jack-wainwright left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@DWolfsNHS DWolfsNHS force-pushed the feature/GPCAPIM-166_built_image branch from 69ba897 to 49a3458 Compare January 13, 2026 16:58
@DWolfsNHS DWolfsNHS force-pushed the feature/GPCAPIM-166_built_image branch from c0b679d to e6d3941 Compare January 13, 2026 17:39
@DWolfsNHS DWolfsNHS enabled auto-merge (rebase) January 13, 2026 17:41
auto-merge was automatically disabled January 13, 2026 17:42

Base branch requires signed commits

@sonarqubecloud
Copy link

@DWolfsNHS DWolfsNHS merged commit 5ababe4 into main Jan 13, 2026
71 of 72 checks passed
@DWolfsNHS DWolfsNHS deleted the feature/GPCAPIM-166_built_image branch January 13, 2026 17:51
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