Skip to content

feat: add overwrite-only mode for ECR mirroring TAROT-3721#244

Merged
lolgab merged 1 commit into
masterfrom
feat/ecr-overwrite-only-existing
Jun 2, 2026
Merged

feat: add overwrite-only mode for ECR mirroring TAROT-3721#244
lolgab merged 1 commit into
masterfrom
feat/ecr-overwrite-only-existing

Conversation

@lolgab
Copy link
Copy Markdown
Contributor

@lolgab lolgab commented Jun 2, 2026

Summary

  • add overwrite_only_existing parameter to mirror_to_ecr
  • fail the job when overwrite-only mode is enabled and the target tag is missing in ECR
  • keep default behavior unchanged when the new flag is disabled

Test plan

  • validate CircleCI config compiles
  • run a pipeline with overwrite_only_existing: true and a missing tag to verify failure
  • run a pipeline with an existing tag to verify overwrite flow

Made with Cursor

Add a dedicated flag to mirror_to_ecr that updates an existing tag but fails when the target tag is missing in ECR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new parameter overwrite_only_existing to the mirror_to_ecr job. This parameter ensures that an image is only overwritten if the target tag already exists in ECR, failing the job if the tag is missing. The mirroring logic has been updated to support this conditional check. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Copy link
Copy Markdown

@codacy-production codacy-production Bot left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR successfully introduces the overwrite_only_existing parameter to the ECR mirroring job. While the code is up to standards according to Codacy, there are no automated tests (e.g., Bats or shell-check) included to verify the new logic. The acceptance criteria depend on specific failure (exit 1) and success conditions that are currently only validated through manual testing. This lack of automated verification for critical job control flow should be addressed to ensure long-term maintainability and prevent regressions in mirroring behavior.

About this PR

  • The PR lacks automated test coverage (e.g., Bats or shell-check) for the new conditional logic. While manual verification steps are listed in the description, adding automated unit tests would ensure that the specific failure and success conditions for the 'overwrite_only_existing' flag are consistently met and preserved in future changes.

Test suggestions

  • Job fails with exit 1 when overwrite_only_existing is true and the ECR tag does not exist\n- [ ] Job proceeds with docker push when overwrite_only_existing is true and the ECR tag already exists\n- [ ] Job proceeds with docker push when overwrite_only_existing is false and the ECR tag is missing (default behavior)\n- [ ] Job skips mirroring when overwrite_only_existing is false, force is false, and tag already exists
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Job fails with exit 1 when overwrite_only_existing is true and the ECR tag does not exist\n- [ ] Job proceeds with docker push when overwrite_only_existing is true and the ECR tag already exists\n- [ ] Job proceeds with docker push when overwrite_only_existing is false and the ECR tag is missing (default behavior)\n- [ ] Job skips mirroring when overwrite_only_existing is false, force is false, and tag already exists

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

REPO_DATA=$(aws ecr describe-images --repository-name=${MIRROR_NAME} --image-ids=imageTag=${MIRROR_TAG} ||: )
if << parameters.force>> || [[ -z $REPO_DATA ]] ; then
SHOULD_MIRROR=false
if [[ -z $REPO_DATA ]] ; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Nitpick: It's recommended to quote the variable expansion to handle potential edge cases in the command output and maintain style consistency.\n\nThis might be a simple fix:\nsuggestion\n if [[ -z "$REPO_DATA" ]] ; then\n

@lolgab lolgab changed the title feat: add overwrite-only mode for ECR mirroring feat: add overwrite-only mode for ECR mirroring TAROT-3721 Jun 2, 2026
@lolgab lolgab merged commit 8206523 into master Jun 2, 2026
6 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