-
-
Notifications
You must be signed in to change notification settings - Fork 2
feature
ECR tag immutability exclusion support
#57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughIntroduces ECR image tag mutability exclusions via a new variable and wiring to the upstream module, updates AWS provider constraints, bumps the ECR module to 1.0.0, refreshes documentation, and adds tests plus fixtures for the new immutability-with-exclusions scenario. Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 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 |
feature
ECR tag immutability **exclusion** supportfeature
ECR tag immutability *exclusion* support
feature
ECR tag immutability *exclusion* supportfeature
ECR tag immutability exclusion support
Important Title is necessary and should not be empty.Kindly provide a meaningful title for this Pull Request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
test/component_test.go (1)
23-55
: Capture and assert deployment error; assert non-empty outputs.Avoid ignoring errors and strengthen the test by checking outputs.
func (s *ComponentSuite) TestImmutabilityExclusions() { @@ - options, _ := s.DeployAtmosComponent(s.T(), component, stack, &inputs) - assert.NotNil(s.T(), options) + options, err := s.DeployAtmosComponent(s.T(), component, stack, &inputs) + assert.NoError(s.T(), err) + assert.NotNil(s.T(), options) @@ - arnMaps := map[string]string{} + arnMaps := map[string]string{} atmos.OutputStruct(s.T(), options, "ecr_repo_arn_map", &arnMaps) + assert.NotEmpty(s.T(), arnMaps)src/variables.tf (1)
17-40
: Good schema and validations for exclusion filters.Optional filter_type with default WILDCARD and non-empty filter check are appropriate. Consider documenting/validating that exclusions are only meaningful when using *_WITH_EXCLUSION modes; optional, since upstream may already guard this.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
README.md
(3 hunks)README.yaml
(1 hunks)src/main.tf
(1 hunks)src/variables.tf
(1 hunks)src/versions.tf
(1 hunks)test/component_test.go
(1 hunks)test/fixtures/stacks/catalog/usecase/immutability-exclusions.yaml
(1 hunks)test/fixtures/stacks/orgs/default/test/tests.yaml
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
src/{main,variables,outputs,providers,versions,context}.tf
📄 CodeRabbit inference engine (AGENTS.md)
Keep the Terraform component as the single source of truth under src/ with standard files: main.tf, variables.tf, outputs.tf, providers.tf, versions.tf, and context.tf
Files:
src/versions.tf
src/main.tf
src/variables.tf
src/**/*.tf
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.tf
: Use 2-space indentation for Terraform files
In Terraform, prefer lower_snake_case for variables and locals; keep resource and data source names descriptive and aligned with Cloud Posse null-label patterns
Run terraform fmt (recursive) and do not commit formatting violations
Ensure Terraform code passes TFLint checks; do not commit lint violations
Files:
src/versions.tf
src/main.tf
src/variables.tf
**/*.{yml,yaml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Use 2-space indentation for YAML and Markdown files
Files:
test/fixtures/stacks/orgs/default/test/tests.yaml
README.yaml
test/fixtures/stacks/catalog/usecase/immutability-exclusions.yaml
README.md
README.yaml
📄 CodeRabbit inference engine (AGENTS.md)
Treat README.yaml as the single source for documentation; update it when inputs/outputs change
Files:
README.yaml
test/**/*_test.go
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.go
: Place Go Terratest files under test/ and name them *_test.go
Use Go Terratest with github.com/cloudposse/test-helpers and Atmos fixtures for integration tests
Files:
test/component_test.go
test/fixtures/stacks/catalog/usecase/**
📄 CodeRabbit inference engine (AGENTS.md)
Add test scenarios under test/fixtures/stacks/catalog/usecase/
Files:
test/fixtures/stacks/catalog/usecase/immutability-exclusions.yaml
{README.md,src/README.md}
📄 CodeRabbit inference engine (AGENTS.md)
Do not manually edit README.md files; regenerate them using atmos docs generate readme or readme-simple
Files:
README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (5)
test/fixtures/stacks/orgs/default/test/tests.yaml (1)
5-5
: Fixture import registered.New use case is included in the test suite.
README.yaml (1)
41-48
: Docs example updated for exclusions—LGTM.Clear example for WITH_EXCLUSION modes with proper 2-space YAML indentation.
README.md (2)
86-94
: Docs reflect new mutability modes and exclusion filter.Auto-generated README correctly documents provider bump, module version, and new input.
135-148
: Requirements/modules tables are in sync. AWS provider range and ECR module pin match source files.test/fixtures/stacks/catalog/usecase/immutability-exclusions.yaml (1)
1-26
: Fixture looks good and matches new inputs.Consistent 2-space indentation; valid example filters.
/terratest |
These changes were released in v2.0.0. |
This pull request introduces support for advanced ECR image tag mutability options, specifically allowing certain tags to remain mutable while others are immutable. It also updates dependencies to ensure compatibility with these new features, and adds comprehensive documentation and tests to demonstrate usage.
ECR image tag mutability enhancements:
IMMUTABLE_WITH_EXCLUSION
,MUTABLE_WITH_EXCLUSION
) and a newimage_tag_mutability_exclusion_filter
variable, allowing specific tags (e.g.,latest
,dev-
) to be excluded from immutability. This is reflected inREADME.md
,README.yaml
,src/variables.tf
, andsrc/main.tf
. [1] [2] [3] [4]Dependency updates:
>= 6.8.0, < 7.0.0
and thecloudposse/ecr/aws
module to version1.0.0
to support the new ECR features. [1] [2] [3]Testing and validation:
TestImmutabilityExclusions
incomponent_test.go
to verify the correct application of the new mutability modes and exclusion filters.immutability-exclusions.yaml
and registered it in the test suite to demonstrate and validate the new functionality. [1] [2]Summary by CodeRabbit
New Features
Documentation
Chores
Tests