Skip to content

ci: support variant-prefixed devcontainer Go tags#778

Open
dlevy-msft-sql wants to merge 1 commit into
mainfrom
ci/devcontainer-check-variant-tag
Open

ci: support variant-prefixed devcontainer Go tags#778
dlevy-msft-sql wants to merge 1 commit into
mainfrom
ci/devcontainer-check-variant-tag

Conversation

@dlevy-msft-sql

Copy link
Copy Markdown
Contributor

Problem

The devcontainer-version-check workflow extracts the Go version from the base image tag in .devcontainer/Dockerfile:

DOCKERFILE_TAG=$(grep -oP 'devcontainers/go:\K[0-9]+\.[0-9]+' .devcontainer/Dockerfile)

The regex assumes the tag starts with <major>.<minor> (e.g. 1.26-bookworm). Microsoft has begun publishing variant-prefixed tags such as 2-1.26-bookworm, which the current regex does not match. When dependabot proposes that bump (#776), DOCKERFILE_TAG ends up empty and the job exits with:

ERROR: Could not parse versions

This blocks every dependabot PR that adopts the new tag form.

Fix

Allow an optional leading <digits>- variant prefix in the regex:

DOCKERFILE_TAG=$(grep -oP 'devcontainers/go:(?:[0-9]+-)?\K[0-9]+\.[0-9]+' .devcontainer/Dockerfile)

Both forms now extract the same major.minor:

Tag Extracted
1.26-bookworm 1.26
2-1.26-bookworm 1.26
10-1.30-bookworm 1.30

No change to behavior for the legacy tag format. Once this merges, rebasing #776 should turn its devcontainer-version-check green.

The devcontainer-version-check workflow extracts the Go version from
the base image tag in .devcontainer/Dockerfile. The previous regex
only matched the legacy '<major>.<minor>-bookworm' tag and failed on
the new variant-prefixed tags published on mcr.microsoft.com (e.g.
'2-1.26-bookworm'), causing the job to exit with 'Could not parse
versions'.

Allow an optional leading '<digits>-' variant prefix so both tag
forms are accepted.
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.

1 participant