Skip to content

Chore: [AEA-0000] - Use common dev container#65

Merged
anthony-nhs merged 17 commits intomainfrom
common_dev_container
Mar 23, 2026
Merged

Chore: [AEA-0000] - Use common dev container#65
anthony-nhs merged 17 commits intomainfrom
common_dev_container

Conversation

@anthony-nhs
Copy link
Contributor

Summary

  • Routine Change

Details

  • use common dev container

Copilot AI review requested due to automatic review settings March 23, 2026 08:44
@github-actions
Copy link
Contributor

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-0000

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the repository to use the shared “eps common” devcontainer approach, simplifying CI by pulling config (including pinned devcontainer images) from a reusable workflow and removing the repo-level asdf version file.

Changes:

  • Switch CI/pull request/release workflows to get-repo-config + *-devcontainer reusable workflows and pass pinned_image.
  • Update devcontainer to build FROM a published ghcr.io/nhsdigital/eps-devcontainers/... image and simplify post-attach setup.
  • Remove root .tool-versions.asdf, bump asdf version in the base devcontainer config, and add a bootstrap .tool-versions file for fallback builds.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/base/.devcontainer/.tool-versions.asdf Bumps asdf version used by base devcontainer scripts.
.tool-versions.asdf Removes repo-level asdf version file (no longer used by workflows).
.github/workflows/release.yml Uses common reusable workflows and consumes pinned_image/tag_format.
.github/workflows/pull_request.yml Uses common reusable workflows for PR quality checks with pinned_image.
.github/workflows/ci.yml Uses common reusable workflows; adds permissions for tag workflow.
.devcontainer/devcontainer.json Updates build args and post-attach behavior to match the common devcontainer image approach.
.devcontainer/Dockerfile.bootstrap Adds a bootstrap build for when published images aren’t available.
.devcontainer/Dockerfile Changes devcontainer build to extend from a published eps-devcontainers image and optionally remap docker group GID.
.devcontainer/.tool-versions.bootstrap Adds tool versions used by the bootstrap Dockerfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +11
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE_NAME}:${IMAGE_VERSION}

USER root
# specify DOCKER_GID to force container docker group id to match host
RUN if [ -n "${DOCKER_GID}" ]; then \
if ! getent group docker; then \
groupadd -g ${DOCKER_GID} docker; \
else \
groupmod -g ${DOCKER_GID} docker; \
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

DOCKER_GID is used in the RUN block but isn't declared as a build arg (ARG DOCKER_GID) anywhere in this Dockerfile, so the value passed from devcontainer.json won't be available and the docker group remap will never run. Declare ARG DOCKER_GID (and ideally validate it’s a numeric GID and quote the variable when passing it to groupadd/groupmod) before this RUN instruction.

Suggested change
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE_NAME}:${IMAGE_VERSION}
USER root
# specify DOCKER_GID to force container docker group id to match host
RUN if [ -n "${DOCKER_GID}" ]; then \
if ! getent group docker; then \
groupadd -g ${DOCKER_GID} docker; \
else \
groupmod -g ${DOCKER_GID} docker; \
ARG DOCKER_GID
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE_NAME}:${IMAGE_VERSION}
USER root
# specify DOCKER_GID to force container docker group id to match host
RUN if [ -n "${DOCKER_GID}" ]; then \
if ! printf '%s\n' "${DOCKER_GID}" | grep -Eq '^[0-9]+$'; then \
echo "Invalid DOCKER_GID: ${DOCKER_GID} (must be a numeric GID)" >&2; \
exit 1; \
fi; \
if ! getent group docker >/dev/null; then \
groupadd -g "${DOCKER_GID}" docker; \
else \
groupmod -g "${DOCKER_GID}" docker; \

Copilot uses AI. Check for mistakes.
Comment on lines 68 to 71
},
"eslint.useFlatConfig": true,
"eslint.format.enable": true
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

eslint.useFlatConfig and eslint.format.enable are currently defined as siblings of settings, not inside the settings object. Devcontainer VS Code settings are only picked up from customizations.vscode.settings, so these values likely won’t apply unless they’re moved under settings.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +11
"DOCKER_GID": "${env:DOCKER_GID:}",
"IMAGE_NAME": "node_24_python_3_14",
"IMAGE_VERSION": "latest",
"USER_UID": "${localEnv:USER_ID:}",
"USER_GID": "${localEnv:GROUP_ID:}"
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The build arg for DOCKER_GID is sourced from ${env:DOCKER_GID:} while other host-derived values use ${localEnv:...}. For a host Docker group mapping, this should likely be ${localEnv:DOCKER_GID:}; otherwise it will typically resolve empty at build time. Also, USER_UID/USER_GID are being passed but the current .devcontainer/Dockerfile doesn’t declare/use them, which can be confusing unless the image build is updated to apply them.

Suggested change
"DOCKER_GID": "${env:DOCKER_GID:}",
"IMAGE_NAME": "node_24_python_3_14",
"IMAGE_VERSION": "latest",
"USER_UID": "${localEnv:USER_ID:}",
"USER_GID": "${localEnv:GROUP_ID:}"
"DOCKER_GID": "${localEnv:DOCKER_GID:}",
"IMAGE_NAME": "node_24_python_3_14",
"IMAGE_VERSION": "latest"

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 28
tag_release:
needs: [quality_checks, get_asdf_version]
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@5ac2707dd9cd60ad127275179495b9c890d74711
needs: [quality_checks, get_config_values]
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
with:
dry_run: false
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
branch_name: main
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
secrets: inherit
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

tag_release in this workflow calls the same reusable workflow as ci.yml, but unlike ci.yml it doesn't grant contents: write (and potentially id-token: write) permissions. If the reusable workflow needs these to create tags/releases or use OIDC, this run will fail; consider mirroring the permissions block from .github/workflows/ci.yml here.

Copilot uses AI. Check for mistakes.
@anthony-nhs anthony-nhs merged commit 25fb477 into main Mar 23, 2026
4 checks passed
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