-
Notifications
You must be signed in to change notification settings - Fork 0
Chore: [AEA-0000] - get tag from dockerfile if not in devcontainer.json #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,6 @@ | |
| "context": "..", | ||
| "args": { | ||
| "DOCKER_GID": "${env:DOCKER_GID:}", | ||
| "IMAGE_NAME": "node_24_python_3_14", | ||
| "IMAGE_VERSION": "v1.2.0", | ||
| "USER_UID": "${localEnv:USER_ID:}", | ||
| "USER_GID": "${localEnv:GROUP_ID:}" | ||
| }, | ||
|
Comment on lines
6
to
10
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,7 +51,6 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ env.BRANCH_NAME }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Load config value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -60,6 +59,18 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$DEVCONTAINER_IMAGE" == "null" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$DEVCONTAINER_IMAGE" == "null" ]; then | |
| if [ -z "$DEVCONTAINER_IMAGE" ] || [ "$DEVCONTAINER_IMAGE" = "null" ] || [ -z "$DEVCONTAINER_VERSION" ] || [ "$DEVCONTAINER_VERSION" = "null" ]; then |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow can now source devcontainer_image/devcontainer_version from the Dockerfile rather than devcontainer.json; please update the workflow output descriptions/comments accordingly to avoid misleading callers.
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback hard-codes .devcontainer/Dockerfile, but devcontainer.json already declares the dockerfile path (.build.dockerfile). For a reusable workflow this can break repos that use a different filename; consider reading .build.dockerfile from devcontainer.json and constructing the path from that value.
| dockerfile=".devcontainer/Dockerfile" | |
| dockerfile_name=$(jq -r '.build.dockerfile // "Dockerfile"' .devcontainer/devcontainer.json) | |
| dockerfile=".devcontainer/${dockerfile_name}" |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add set -euo pipefail at the start of this step (and fail if the Dockerfile/ FROM line can't be read) so jq/awk failures don't silently produce empty/incorrect outputs.
| TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) | |
| DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json) | |
| DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json) | |
| if [ "$DEVCONTAINER_IMAGE" == "null" ]; then | |
| dockerfile=".devcontainer/Dockerfile" | |
| from_ref="$( | |
| awk '/^FROM[[:space:]]+/ { print $2; exit }' "$dockerfile" | |
| )" | |
| set -euo pipefail | |
| TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) | |
| DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json) | |
| DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json) | |
| if [ "$DEVCONTAINER_IMAGE" = "null" ]; then | |
| dockerfile=".devcontainer/Dockerfile" | |
| if [ ! -f "$dockerfile" ]; then | |
| echo "Error: Dockerfile '$dockerfile' not found; cannot derive DEVCONTAINER_IMAGE/DEVCONTAINER_VERSION." >&2 | |
| exit 1 | |
| fi | |
| from_ref="$( | |
| awk '/^FROM[[:space:]]+/ { print $2; exit }' "$dockerfile" | |
| )" | |
| if [ -z "$from_ref" ]; then | |
| echo "Error: No FROM line found in '$dockerfile'; cannot derive DEVCONTAINER_IMAGE/DEVCONTAINER_VERSION." >&2 | |
| exit 1 | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing IMAGE_NAME/IMAGE_VERSION from devcontainer.json will break workflows/scripts that read these fields (e.g. .github/workflows/update-dev-container-version.yml reads
.build.args.IMAGE_NAMEand.build.args.IMAGE_VERSION). Either keep these args in devcontainer.json, or update the version-bump workflow(s) to derive and update the Dockerfile FROM tag instead.