Repository navigation
Release: 2.1.3-37 - #202
Conversation
Run the release validation pipeline only once
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Reviewer's GuideImplementationMove creation and replacement of the release tag into the Docker workflow after validation, while checking source identity, publication history, and the expected ref before mutation.
Remove the separate merge-commit test and tag-mutation steps so the release workflow dispatches one validated publication pipeline, restoring only a missing tag for an already successful publication.
ConfigurationAdd workflow-dispatch inputs for deferred tag creation and an expected tag ref SHA, and grant the release job permissions needed to verify and mutate refs.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/docker.image.yml" line_range="983-1007" />
<code_context>
+ fi
+
+ - name: Verify existing release tag immediately before publication
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && !inputs.create_release_tag && inputs.image_version != '' }}
+ env:
+ GH_TOKEN: ${{ github.token }}
+ REPOSITORY: ${{ github.repository }}
+ RELEASE_TAG: ${{ inputs.image_version }}
+ run: |
+ set -euo pipefail
+ tag_pattern='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}-[0-9]{1,3}$'
+ if [[ ! "$RELEASE_TAG" =~ $tag_pattern ]]; then
+ echo "Image version '$RELEASE_TAG' is not a release tag; skipping Git tag verification."
+ exit 0
+ fi
+ tag_json=$(gh api "repos/$REPOSITORY/git/ref/tags/$RELEASE_TAG")
+ tag_type=$(jq -r '.object.type' <<< "$tag_json")
</code_context>
<issue_to_address>
**Image tag diverges from release tag**
When an authorized actor moves the release tag after verification but before the registry push, the workflow verifies the Git ref before Build and push, but another actor can retarget the ref after that check and before the registry push. The image is then published from the tested commit under a version tag whose Git ref points to a different commit.
Prevent concurrent release-tag changes during publication, or revalidate the tag at the publication boundary and abort if it no longer resolves to the tested SHA.
</issue_to_address>
### Comment 2
<location path=".github/workflows/docker.image.yml" line_range="857" />
<code_context>
password: ${{ env.QUAY_TOKEN }}
# Keep this step name stable: release-history scripts use it to detect publication attempts.
+ - name: Create or verify release tag after all validation jobs pass
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && inputs.create_release_tag }}
+ env:
</code_context>
<issue_to_address>
**Tag exists without published image**
When tag creation is enabled and no registry credentials produce image tags, or a registry push fails after the tag is created, the tag is written before `Build and push`; when `Prepare` produces no tags, the build step is skipped and the workflow can still succeed, while a later push failure can leave only some registries updated. Callers see a release tag without a fully published image.
Require nonempty publication tags before mutating the ref, and create the release tag only after image publication succeeds (or compensate for failed publication).
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and if the release workflow tags or publishes the wrong commit, consumers may pull images for a release that does not match its intended source. Reverting the workflow cannot undo a moved tag already observed by others or images already published.
Blocking findings: .github/workflows/docker.image.yml:1007, .github/workflows/docker.image.yml:857
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && !inputs.create_release_tag && inputs.image_version != '' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| RELEASE_TAG: ${{ inputs.image_version }} | ||
| run: | | ||
| set -euo pipefail | ||
| tag_pattern='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}-[0-9]{1,3}$' | ||
| if [[ ! "$RELEASE_TAG" =~ $tag_pattern ]]; then | ||
| echo "Image version '$RELEASE_TAG' is not a release tag; skipping Git tag verification." | ||
| exit 0 | ||
| fi | ||
| tag_json=$(gh api "repos/$REPOSITORY/git/ref/tags/$RELEASE_TAG") | ||
| tag_type=$(jq -r '.object.type' <<< "$tag_json") | ||
| tag_sha=$(jq -r '.object.sha' <<< "$tag_json") | ||
| while [[ "$tag_type" == "tag" ]]; do | ||
| tag_json=$(gh api "repos/$REPOSITORY/git/tags/$tag_sha") | ||
| tag_type=$(jq -r '.object.type' <<< "$tag_json") | ||
| tag_sha=$(jq -r '.object.sha' <<< "$tag_json") | ||
| done | ||
| tested_sha=$(git rev-parse HEAD) | ||
| if [[ "$tag_type" != "commit" || "$tag_sha" != "$tested_sha" ]]; then | ||
| echo "::error::Release tag $RELEASE_TAG does not resolve to tested source $tested_sha." | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
🟡 Medium · Image tag diverges from release tag
When an authorized actor moves the release tag after verification but before the registry push, the workflow verifies the Git ref before Build and push, but another actor can retarget the ref after that check and before the registry push. The image is then published from the tested commit under a version tag whose Git ref points to a different commit.
Prevent concurrent release-tag changes during publication, or revalidate the tag at the publication boundary and abort if it no longer resolves to the tested SHA.
Prompt for AI agents
In `.github/workflows/docker.image.yml` at lines 983-1007:
**Image tag diverges from release tag**
When an authorized actor moves the release tag after verification but before the registry push, the workflow verifies the Git ref before Build and push, but another actor can retarget the ref after that check and before the registry push. The image is then published from the tested commit under a version tag whose Git ref points to a different commit.
Prevent concurrent release-tag changes during publication, or revalidate the tag at the publication boundary and abort if it no longer resolves to the tested SHA.| password: ${{ env.QUAY_TOKEN }} | ||
|
|
||
| # Keep this step name stable: release-history scripts use it to detect publication attempts. | ||
| - name: Create or verify release tag after all validation jobs pass |
There was a problem hiding this comment.
🟡 Medium · Tag exists without published image
When tag creation is enabled and no registry credentials produce image tags, or a registry push fails after the tag is created, the tag is written before Build and push; when Prepare produces no tags, the build step is skipped and the workflow can still succeed, while a later push failure can leave only some registries updated. Callers see a release tag without a fully published image.
Require nonempty publication tags before mutating the ref, and create the release tag only after image publication succeeds (or compensate for failed publication).
Prompt for AI agents
In `.github/workflows/docker.image.yml` at line 857:
**Tag exists without published image**
When tag creation is enabled and no registry credentials produce image tags, or a registry push fails after the tag is created, the tag is written before `Build and push`; when `Prepare` produces no tags, the build step is skipped and the workflow can still succeed, while a later push failure can leave only some registries updated. Callers see a release tag without a fully published image.
Require nonempty publication tags before mutating the ref, and create the release tag only after image publication succeeds (or compensate for failed publication).
Automated release for tag 2.1.3-37.
The workflow tests the resulting merge commit before tagging
and publishing the Docker image.
Summary by Sourcery
Ensure release tags are created or updated only after validation succeeds and remain aligned with the published source commit.
New Features:
Bug Fixes:
Enhancements:
CI: