Skip to content
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

fix: Allow ROOT as a Repository Creation Template prefix #38685

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

bodgit
Copy link
Contributor

@bodgit bodgit commented Aug 5, 2024

Description

This fixes the aws_ecr_repository_creation_template resource and data source so they accept ROOT as a valid value. I think this was missed as I originally copied the validator from the pull-through cache code without adding this additional special case.

Tests added, explicitly not using ParallelTest so the resource and data source tests don’t fight over the one template that can exist.

Relations

Closes #38650

References

Output from Acceptance Testing

% make testacc TESTS=TestAccECRRepositoryCreationTemplate PKG=ecr
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 20 -run='TestAccECRRepositoryCreationTemplate'  -timeout 360m
=== RUN   TestAccECRRepositoryCreationTemplateDataSource_basic
=== PAUSE TestAccECRRepositoryCreationTemplateDataSource_basic
=== RUN   TestAccECRRepositoryCreationTemplateDataSource_root
--- PASS: TestAccECRRepositoryCreationTemplateDataSource_root (14.21s)
=== RUN   TestAccECRRepositoryCreationTemplate_basic
=== PAUSE TestAccECRRepositoryCreationTemplate_basic
=== RUN   TestAccECRRepositoryCreationTemplate_disappears
=== PAUSE TestAccECRRepositoryCreationTemplate_disappears
=== RUN   TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists
=== PAUSE TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists
=== RUN   TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle
=== PAUSE TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle
=== RUN   TestAccECRRepositoryCreationTemplate_repository
=== PAUSE TestAccECRRepositoryCreationTemplate_repository
=== RUN   TestAccECRRepositoryCreationTemplate_root
--- PASS: TestAccECRRepositoryCreationTemplate_root (13.11s)
=== CONT  TestAccECRRepositoryCreationTemplateDataSource_basic
=== CONT  TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists
=== CONT  TestAccECRRepositoryCreationTemplate_repository
=== CONT  TestAccECRRepositoryCreationTemplate_disappears
=== CONT  TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle
=== CONT  TestAccECRRepositoryCreationTemplate_basic
--- PASS: TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists (18.72s)
--- PASS: TestAccECRRepositoryCreationTemplateDataSource_basic (34.20s)
--- PASS: TestAccECRRepositoryCreationTemplate_disappears (34.66s)
--- PASS: TestAccECRRepositoryCreationTemplate_basic (39.77s)
--- PASS: TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle (40.89s)
--- PASS: TestAccECRRepositoryCreationTemplate_repository (49.62s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecr        77.078s

@bodgit bodgit requested a review from a team as a code owner August 5, 2024 09:04
Copy link

github-actions bot commented Aug 5, 2024

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ecr Issues and PRs that pertain to the ecr service. needs-triage Waiting for first response or review from a maintainer. labels Aug 5, 2024
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Aug 5, 2024
@ewbankkit ewbankkit self-assigned this Aug 5, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 5, 2024
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Aug 5, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccECRRepositoryCreationTemplate' PKG=ecr ACCTEST_PARALLELISM=4
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/ecr/... -v -count 1 -parallel 4  -run=TestAccECRRepositoryCreationTemplate -timeout 360m
=== RUN   TestAccECRRepositoryCreationTemplateDataSource_basic
=== PAUSE TestAccECRRepositoryCreationTemplateDataSource_basic
=== RUN   TestAccECRRepositoryCreationTemplateDataSource_root
--- PASS: TestAccECRRepositoryCreationTemplateDataSource_root (9.28s)
=== RUN   TestAccECRRepositoryCreationTemplate_basic
=== PAUSE TestAccECRRepositoryCreationTemplate_basic
=== RUN   TestAccECRRepositoryCreationTemplate_disappears
=== PAUSE TestAccECRRepositoryCreationTemplate_disappears
=== RUN   TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists
=== PAUSE TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists
=== RUN   TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle
=== PAUSE TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle
=== RUN   TestAccECRRepositoryCreationTemplate_repository
=== PAUSE TestAccECRRepositoryCreationTemplate_repository
=== RUN   TestAccECRRepositoryCreationTemplate_root
--- PASS: TestAccECRRepositoryCreationTemplate_root (9.06s)
=== CONT  TestAccECRRepositoryCreationTemplateDataSource_basic
=== CONT  TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists
=== CONT  TestAccECRRepositoryCreationTemplate_repository
=== CONT  TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle
--- PASS: TestAccECRRepositoryCreationTemplate_failWhenAlreadyExists (5.63s)
=== CONT  TestAccECRRepositoryCreationTemplate_disappears
--- PASS: TestAccECRRepositoryCreationTemplateDataSource_basic (9.42s)
=== CONT  TestAccECRRepositoryCreationTemplate_basic
--- PASS: TestAccECRRepositoryCreationTemplate_ignoreEquivalentLifecycle (11.90s)
--- PASS: TestAccECRRepositoryCreationTemplate_disappears (8.84s)
--- PASS: TestAccECRRepositoryCreationTemplate_repository (17.82s)
--- PASS: TestAccECRRepositoryCreationTemplate_basic (10.44s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecr	42.870s

@ewbankkit
Copy link
Contributor

@bodgit Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 179a398 into hashicorp:main Aug 5, 2024
48 checks passed
@github-actions github-actions bot added this to the v5.62.0 milestone Aug 5, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

This functionality has been released in v5.62.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Sep 9, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/ecr Issues and PRs that pertain to the ecr service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants