Skip to content

Conversation

Benbentwo
Copy link
Contributor

@Benbentwo Benbentwo commented Sep 25, 2025

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:

  • Added support for new tag mutability modes (IMMUTABLE_WITH_EXCLUSION, MUTABLE_WITH_EXCLUSION) and a new image_tag_mutability_exclusion_filter variable, allowing specific tags (e.g., latest, dev-) to be excluded from immutability. This is reflected in README.md, README.yaml, src/variables.tf, and src/main.tf. [1] [2] [3] [4]
  • Updated documentation to describe new mutability options and the exclusion filter, including usage examples and variable descriptions. [1] [2] [3] [4]

Dependency updates:

  • Upgraded the AWS provider requirement to >= 6.8.0, < 7.0.0 and the cloudposse/ecr/aws module to version 1.0.0 to support the new ECR features. [1] [2] [3]

Testing and validation:

  • Added a new test case TestImmutabilityExclusions in component_test.go to verify the correct application of the new mutability modes and exclusion filters.
  • Introduced a new test fixture stack immutability-exclusions.yaml and registered it in the test suite to demonstrate and validate the new functionality. [1] [2]

Summary by CodeRabbit

  • New Features

    • Added support for ECR image tag mutability exclusions, allowing specified tags (e.g., latest, dev-) to remain mutable.
  • Documentation

    • Updated usage examples and inputs to include new mutability options and exclusion filter configuration.
  • Chores

    • Upgraded AWS provider compatibility to >=6.8.0, <7.0.0.
    • Bumped ECR module dependency to 1.0.0.
  • Tests

    • Added coverage for immutability with exclusions, including new test fixtures and scenarios.

Copy link

coderabbitai bot commented Sep 25, 2025

Walkthrough

Introduces 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

Cohort / File(s) Summary of changes
Documentation updates
README.md, README.yaml
Document new image_tag_mutability options (…WITH_EXCLUSION), add image_tag_mutability_exclusion_filter examples, and update provider/module version requirements and usage snippets.
Terraform module wiring
src/main.tf, src/variables.tf, src/versions.tf
Bump ECR module to 1.0.0; add variable image_tag_mutability_exclusion_filter and pass through to module; update aws provider constraint to >=6.8.0,<7.0.0; extend description for image_tag_mutability.
Tests
test/component_test.go
Add TestImmutabilityExclusions validating IMMUTABLE_WITH_EXCLUSION behavior, scan-on-push, drift, and cleanup.
Test fixtures
test/fixtures/stacks/.../usecase/immutability-exclusions.yaml, test/fixtures/stacks/orgs/default/test/tests.yaml
Add new fixture defining immutability exclusions use case; include it in test imports.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Added tests #19 — Adds Terratest-based ECR tests; related by expanding the same test suite that this PR augments with immutability-exclusions coverage.

Suggested labels

needs-test

Suggested reviewers

  • milldr

Poem

I nudge the tags with gentle paws,
Exclusions set by rabbit laws;
“latest” hops free, “dev-” can play,
While others freeze in place each day.
Providers bloom, modules grow—
Carrots committed, green fields aglow.
(\/)<(^^)>(\_/)

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title directly highlights the primary change—adding support for ECR tag immutability exclusion—which matches the pull request’s main objective of introducing new immutability modes and exclusion filters. Despite the extra backticks around “feature,” it still concisely conveys the core enhancement.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/immutability-exclusions

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

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

@Benbentwo Benbentwo changed the title feature ECR tag immutability **exclusion** support feature ECR tag immutability *exclusion* support Sep 25, 2025
@Benbentwo Benbentwo changed the title feature ECR tag immutability *exclusion* support feature ECR tag immutability exclusion support Sep 25, 2025
@mergify mergify bot requested review from a team September 25, 2025 19:39
Copy link

mergify bot commented Sep 25, 2025

Important

Title is necessary and should not be empty.

Kindly provide a meaningful title for this Pull Request.

@mergify mergify bot added the triage Needs triage label Sep 25, 2025
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between c5c8a22 and b1c82b2.

📒 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.

@Benbentwo
Copy link
Contributor Author

/terratest

@goruha goruha added the major Breaking changes (or first stable release) label Sep 25, 2025
@goruha goruha added this pull request to the merge queue Sep 25, 2025
@mergify mergify bot removed the triage Needs triage label Sep 25, 2025
Merged via the queue into main with commit 62cb1e1 Sep 25, 2025
20 checks passed
@goruha goruha deleted the feature/immutability-exclusions branch September 25, 2025 21:59
Copy link

These changes were released in v2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Breaking changes (or first stable release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants