feat: add overwrite-only mode for ECR mirroring TAROT-3721#244
Conversation
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>
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
⚪ 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
Summary
overwrite_only_existingparameter tomirror_to_ecrTest plan
overwrite_only_existing: trueand a missing tag to verify failureMade with Cursor