Skip to content

Support publishing Docker images under legacy name for backward compatibility#304

Merged
tomquist merged 1 commit into
developfrom
claude/legacy-docker-image-name-W8L4l
Apr 6, 2026
Merged

Support publishing Docker images under legacy name for backward compatibility#304
tomquist merged 1 commit into
developfrom
claude/legacy-docker-image-name-W8L4l

Conversation

@tomquist
Copy link
Copy Markdown
Owner

@tomquist tomquist commented Apr 6, 2026

Summary

This change adds support for publishing Docker images under a legacy image name in parallel with the new image name, enabling backward compatibility during project rebranding.

Key Changes

  • Added optional legacy-image-name input parameter to the merge-manifests workflow that accepts a legacy image name (e.g., owner/repo)
  • Updated the manifest metadata extraction step to include both the primary and legacy image names when building and publishing Docker images
  • Configured both base and addon image builds to publish under the legacy name tomquist/b2500-meter alongside the new tomquist/astrameter image
  • Updated CHANGELOG to clarify that the legacy image is still published for backward compatibility during the AstraMeter rebranding

Implementation Details

  • The legacy image name is converted to lowercase (matching Docker registry naming conventions) and combined with the same image suffix as the primary image
  • The legacy image name is only added to the metadata when explicitly provided (optional parameter with empty string default)
  • Both images receive the same tags and manifest digests, ensuring they stay in sync

https://claude.ai/code/session_019rqSCHT7q5DGHZhntbLbpF

Summary by CodeRabbit

  • Documentation

    • Updated changelog confirming the legacy Docker image continues to be published alongside the primary image.
  • Chores

    • Updated CI/CD workflow to support publishing container images under an additional legacy name for backward compatibility.

Add an optional `legacy-image-name` input to the merge-manifests
workflow so the manifest list can be tagged in a second GHCR
repository in addition to the primary one. CI now passes
`tomquist/b2500-meter` for both the base and the addon merges, so
images keep being published at `ghcr.io/tomquist/b2500-meter` and
`ghcr.io/tomquist/b2500-meter-addon` for backward compatibility
after the rebrand to AstraMeter.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 6, 2026

Walkthrough

The changes add support for publishing container manifests under a legacy image name in parallel with the new primary image. Two workflow files are updated to accept and process a legacy-image-name input parameter, and documentation is updated to reflect this backward-compatible publishing strategy.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/ci.yml, .github/workflows/merge-manifests.yml
Added new optional legacy-image-name workflow input parameter. Updated the manifest merge workflow to conditionally compute and export the lowercased legacy image name, and modified Docker metadata action configuration to support publishing to two image targets (primary and legacy) when legacy name is provided.
Documentation
CHANGELOG.md
Updated breaking-change rebrand entry to document that the legacy Docker image (ghcr.io/tomquist/b2500-meter) continues to be published in parallel for backward compatibility alongside the new primary image.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Support publishing Docker images under legacy name for backward compatibility' accurately and concisely summarizes the main change: adding optional support for publishing Docker images under a legacy image name during rebranding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/legacy-docker-image-name-W8L4l

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomquist tomquist marked this pull request as ready for review April 6, 2026 20:40
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/merge-manifests.yml (1)

40-43: Potential shell injection if legacy-image-name contains special characters.

Directly interpolating ${{ inputs.legacy-image-name }} in the shell script could cause issues if the input contains shell metacharacters (e.g., spaces, quotes, $, backticks). While workflow_call inputs from within the same repository are generally trusted, it's safer to use environment variables.

🛡️ Safer approach using environment variables
      - id: lower-repo
+       env:
+         LEGACY_IMAGE_NAME_INPUT: ${{ inputs.legacy-image-name }}
+         IMAGE_SUFFIX: ${{ inputs.image-suffix }}
        run: |
-         echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}${{ inputs.image-suffix }}" >> $GITHUB_OUTPUT
-         if [ -n "${{ inputs.legacy-image-name }}" ]; then
-           LEGACY_LOWER=$(echo "${{ inputs.legacy-image-name }}" | tr '[:upper:]' '[:lower:]')
-           echo "LEGACY_IMAGE_NAME=${LEGACY_LOWER}${{ inputs.image-suffix }}" >> $GITHUB_OUTPUT
+         echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}${IMAGE_SUFFIX}" >> $GITHUB_OUTPUT
+         if [ -n "$LEGACY_IMAGE_NAME_INPUT" ]; then
+           LEGACY_LOWER=$(echo "$LEGACY_IMAGE_NAME_INPUT" | tr '[:upper:]' '[:lower:]')
+           echo "LEGACY_IMAGE_NAME=${LEGACY_LOWER}${IMAGE_SUFFIX}" >> $GITHUB_OUTPUT
          fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/merge-manifests.yml around lines 40 - 43, The shell
interpolation of ${{ inputs.legacy-image-name }} is unsafe; instead capture the
input into a safe shell variable, quote it and use printf to emit the output so
metacharacters cannot be interpreted. Concretely, read the workflow input into a
local variable (e.g., LEGACY_RAW), produce LEGACY_LOWER by piping the quoted
variable into tr (refer to LEGACY_RAW and LEGACY_LOWER), and write the final
value to $GITHUB_OUTPUT using printf with the value quoted (e.g., printf
'%s=%s\n' LEGACY_IMAGE_NAME "${LEGACY_LOWER}${{ inputs.image-suffix }}" >>
$GITHUB_OUTPUT) to prevent word-splitting and shell injection.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/merge-manifests.yml:
- Around line 40-43: The shell interpolation of ${{ inputs.legacy-image-name }}
is unsafe; instead capture the input into a safe shell variable, quote it and
use printf to emit the output so metacharacters cannot be interpreted.
Concretely, read the workflow input into a local variable (e.g., LEGACY_RAW),
produce LEGACY_LOWER by piping the quoted variable into tr (refer to LEGACY_RAW
and LEGACY_LOWER), and write the final value to $GITHUB_OUTPUT using printf with
the value quoted (e.g., printf '%s=%s\n' LEGACY_IMAGE_NAME "${LEGACY_LOWER}${{
inputs.image-suffix }}" >> $GITHUB_OUTPUT) to prevent word-splitting and shell
injection.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: abacfc0e-d321-4394-bfdf-526539ee91d4

📥 Commits

Reviewing files that changed from the base of the PR and between 4bc34a0 and bf15d8e.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • .github/workflows/merge-manifests.yml
  • CHANGELOG.md

@tomquist tomquist merged commit 596e80d into develop Apr 6, 2026
13 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