ci: support variant-prefixed devcontainer Go tags#778
Open
dlevy-msft-sql wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
devcontainer-version-checkworkflow 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 as2-1.26-bookworm, which the current regex does not match. When dependabot proposes that bump (#776),DOCKERFILE_TAGends up empty and the job exits with: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:
1.26-bookworm1.262-1.26-bookworm1.2610-1.30-bookworm1.30No change to behavior for the legacy tag format. Once this merges, rebasing #776 should turn its
devcontainer-version-checkgreen.