trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

feat(deployments): ECR repo adaptations to enable external build cache

Open myftija opened this issue 1 month ago • 2 comments

  • 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

myftija avatar Nov 14 '25 11:11 myftija

⚠️ 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

changeset-bot[bot] avatar Nov 14 '25 11:11 changeset-bot[bot]

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-ecr versions.

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 #' reference, 2) checked checklist items confirming compliance with contributing guide and PR conventions, 3) detailed 'Testing' section describing steps taken to verify the changes work, 4) optional Screenshots section if applicable.
✅ 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.

❤️ Share

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

coderabbitai[bot] avatar Nov 14 '25 11:11 coderabbitai[bot]