feat(deployments): ECR repo adaptations to enable external build cache
- Update aws sdk ecr client to the latest version
- Exlude the cache tag from the immutability enforcement
- Attach a policy to ECR repos to expire untagged images
⚠️ No Changeset found
Latest commit: da5445228d565689c265ec49bec0b21e2aa1b501
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Walkthrough
This change updates ECR repository behavior in the deployment image creation flow: imageTagMutability is changed from IMMUTABLE to IMMUTABLE_WITH_EXCLUSION and imageTagMutabilityExclusionFilters are added to allow the "cache" tag to remain mutable. A PutLifecyclePolicyCommand call is added to apply a lifecycle policy that expires untagged images older than 3 days. The package dependency for @aws-sdk/client-ecr is bumped from ^3.839.0 to ^3.931.0.
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
- Confirm correctness of the imageTagMutabilityExclusionFilters syntax and that it permits only the "cache" tag to be mutable.
- Verify lifecycle policy JSON (policy text, rules, selection) correctly targets untagged images and enforces a 3-day expiration.
- Check ordering and error handling around repository creation and the PutLifecyclePolicyCommand call.
- Review the dependency bump for any ECR API behavior changes between
@aws-sdk/client-ecrversions.
Pre-merge checks and finishing touches
❌ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
| Description check | ⚠️ Warning | The PR description lacks most required sections from the template. Missing checklist confirmation, testing steps documentation, and no issues referenced. Only changelog content is present. | Complete the PR description by adding: 1) 'Closes # |
✅ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly and concisely summarizes the main change: ECR repository adaptations to enable external build caching through tag mutability exclusions and lifecycle policies. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
ecr-immutability-exclusions
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.
Comment @coderabbitai help to get the list of available commands and usage tips.