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 branch name symmetry issue for Amplify #20426

Merged

Conversation

imiosga
Copy link

@imiosga imiosga commented Aug 3, 2021

Fixes a symmetry issue in BranchParseResourceID(...) for aws_amplify_branch when the branch name contains '/'

Closes #20410

Community Note

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

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAmplify'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAmplify -timeout 180m
=== RUN   TestAccAWSAmplify_serial
=== RUN   TestAccAWSAmplify_serial/App
=== RUN   TestAccAWSAmplify_serial/App/Name
=== PAUSE TestAccAWSAmplify_serial/App/Name
=== RUN   TestAccAWSAmplify_serial/App/basic
=== PAUSE TestAccAWSAmplify_serial/App/basic
=== RUN   TestAccAWSAmplify_serial/App/disappears
=== PAUSE TestAccAWSAmplify_serial/App/disappears
=== RUN   TestAccAWSAmplify_serial/App/Tags
=== PAUSE TestAccAWSAmplify_serial/App/Tags
=== RUN   TestAccAWSAmplify_serial/App/AutoBranchCreationConfig
=== PAUSE TestAccAWSAmplify_serial/App/AutoBranchCreationConfig
=== RUN   TestAccAWSAmplify_serial/App/BasicAuthCredentials
=== PAUSE TestAccAWSAmplify_serial/App/BasicAuthCredentials
=== RUN   TestAccAWSAmplify_serial/App/BuildSpec
=== PAUSE TestAccAWSAmplify_serial/App/BuildSpec
=== RUN   TestAccAWSAmplify_serial/App/EnvironmentVariables
=== PAUSE TestAccAWSAmplify_serial/App/EnvironmentVariables
=== RUN   TestAccAWSAmplify_serial/App/Repository
    resource_aws_amplify_app_test.go:591: Environment variable AMPLIFY_GITHUB_ACCESS_TOKEN is not set
=== RUN   TestAccAWSAmplify_serial/App/CustomRules
=== PAUSE TestAccAWSAmplify_serial/App/CustomRules
=== RUN   TestAccAWSAmplify_serial/App/Description
=== PAUSE TestAccAWSAmplify_serial/App/Description
=== RUN   TestAccAWSAmplify_serial/App/IamServiceRole
=== PAUSE TestAccAWSAmplify_serial/App/IamServiceRole
=== CONT  TestAccAWSAmplify_serial/App/Name
=== CONT  TestAccAWSAmplify_serial/App/BuildSpec
=== CONT  TestAccAWSAmplify_serial/App/Description
=== CONT  TestAccAWSAmplify_serial/App/Tags
=== CONT  TestAccAWSAmplify_serial/App/BasicAuthCredentials
=== CONT  TestAccAWSAmplify_serial/App/AutoBranchCreationConfig
=== CONT  TestAccAWSAmplify_serial/App/CustomRules
=== CONT  TestAccAWSAmplify_serial/App/IamServiceRole
=== CONT  TestAccAWSAmplify_serial/App/disappears
=== CONT  TestAccAWSAmplify_serial/App/basic
=== CONT  TestAccAWSAmplify_serial/App/EnvironmentVariables
=== RUN   TestAccAWSAmplify_serial/BackendEnvironment
=== RUN   TestAccAWSAmplify_serial/BackendEnvironment/basic
=== PAUSE TestAccAWSAmplify_serial/BackendEnvironment/basic
=== RUN   TestAccAWSAmplify_serial/BackendEnvironment/disappears
=== PAUSE TestAccAWSAmplify_serial/BackendEnvironment/disappears
=== RUN   TestAccAWSAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName
=== PAUSE TestAccAWSAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName
=== CONT  TestAccAWSAmplify_serial/BackendEnvironment/basic
=== CONT  TestAccAWSAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName
=== CONT  TestAccAWSAmplify_serial/BackendEnvironment/disappears
=== RUN   TestAccAWSAmplify_serial/Branch
=== RUN   TestAccAWSAmplify_serial/Branch/basic
=== PAUSE TestAccAWSAmplify_serial/Branch/basic
=== RUN   TestAccAWSAmplify_serial/Branch/disappears
=== PAUSE TestAccAWSAmplify_serial/Branch/disappears
=== RUN   TestAccAWSAmplify_serial/Branch/Tags
=== PAUSE TestAccAWSAmplify_serial/Branch/Tags
=== RUN   TestAccAWSAmplify_serial/Branch/BasicAuthCredentials
=== PAUSE TestAccAWSAmplify_serial/Branch/BasicAuthCredentials
=== RUN   TestAccAWSAmplify_serial/Branch/EnvironmentVariables
=== PAUSE TestAccAWSAmplify_serial/Branch/EnvironmentVariables
=== RUN   TestAccAWSAmplify_serial/Branch/OptionalArguments
=== PAUSE TestAccAWSAmplify_serial/Branch/OptionalArguments
=== CONT  TestAccAWSAmplify_serial/Branch/basic
=== CONT  TestAccAWSAmplify_serial/Branch/BasicAuthCredentials
=== CONT  TestAccAWSAmplify_serial/Branch/Tags
=== CONT  TestAccAWSAmplify_serial/Branch/disappears
=== CONT  TestAccAWSAmplify_serial/Branch/OptionalArguments
=== CONT  TestAccAWSAmplify_serial/Branch/EnvironmentVariables
=== RUN   TestAccAWSAmplify_serial/DomainAssociation
=== RUN   TestAccAWSAmplify_serial/DomainAssociation/update
    resource_aws_amplify_domain_association_test.go:92: Environment variable AMPLIFY_DOMAIN_NAME is not set
=== RUN   TestAccAWSAmplify_serial/DomainAssociation/basic
    resource_aws_amplify_domain_association_test.go:22: Environment variable AMPLIFY_DOMAIN_NAME is not set
=== RUN   TestAccAWSAmplify_serial/DomainAssociation/disappears
    resource_aws_amplify_domain_association_test.go:63: Environment variable AMPLIFY_DOMAIN_NAME is not set
=== RUN   TestAccAWSAmplify_serial/Webhook
=== RUN   TestAccAWSAmplify_serial/Webhook/basic
=== PAUSE TestAccAWSAmplify_serial/Webhook/basic
=== RUN   TestAccAWSAmplify_serial/Webhook/disappears
=== PAUSE TestAccAWSAmplify_serial/Webhook/disappears
=== RUN   TestAccAWSAmplify_serial/Webhook/update
=== PAUSE TestAccAWSAmplify_serial/Webhook/update
=== CONT  TestAccAWSAmplify_serial/Webhook/basic
=== CONT  TestAccAWSAmplify_serial/Webhook/update
=== CONT  TestAccAWSAmplify_serial/Webhook/disappears
--- PASS: TestAccAWSAmplify_serial (269.60s)
    --- PASS: TestAccAWSAmplify_serial/App (0.00s)
        --- SKIP: TestAccAWSAmplify_serial/App/Repository (0.00s)
        --- PASS: TestAccAWSAmplify_serial/App/disappears (32.28s)
        --- PASS: TestAccAWSAmplify_serial/App/basic (43.71s)
        --- PASS: TestAccAWSAmplify_serial/App/Name (60.91s)
        --- PASS: TestAccAWSAmplify_serial/App/BuildSpec (76.14s)
        --- PASS: TestAccAWSAmplify_serial/App/EnvironmentVariables (77.57s)
        --- PASS: TestAccAWSAmplify_serial/App/BasicAuthCredentials (79.13s)
        --- PASS: TestAccAWSAmplify_serial/App/Tags (80.07s)
        --- PASS: TestAccAWSAmplify_serial/App/CustomRules (82.83s)
        --- PASS: TestAccAWSAmplify_serial/App/IamServiceRole (85.87s)
        --- PASS: TestAccAWSAmplify_serial/App/Description (92.10s)
        --- PASS: TestAccAWSAmplify_serial/App/AutoBranchCreationConfig (95.11s)
    --- PASS: TestAccAWSAmplify_serial/BackendEnvironment (0.00s)
        --- PASS: TestAccAWSAmplify_serial/BackendEnvironment/disappears (29.65s)
        --- PASS: TestAccAWSAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName (34.05s)
        --- PASS: TestAccAWSAmplify_serial/BackendEnvironment/basic (38.81s)
    --- PASS: TestAccAWSAmplify_serial/Branch (0.01s)
        --- PASS: TestAccAWSAmplify_serial/Branch/disappears (32.95s)
        --- PASS: TestAccAWSAmplify_serial/Branch/basic (37.61s)
        --- PASS: TestAccAWSAmplify_serial/Branch/OptionalArguments (59.65s)
        --- PASS: TestAccAWSAmplify_serial/Branch/Tags (76.29s)
        --- PASS: TestAccAWSAmplify_serial/Branch/EnvironmentVariables (76.49s)
        --- PASS: TestAccAWSAmplify_serial/Branch/BasicAuthCredentials (76.62s)
    --- PASS: TestAccAWSAmplify_serial/DomainAssociation (0.00s)
        --- SKIP: TestAccAWSAmplify_serial/DomainAssociation/update (0.00s)
        --- SKIP: TestAccAWSAmplify_serial/DomainAssociation/basic (0.00s)
        --- SKIP: TestAccAWSAmplify_serial/DomainAssociation/disappears (0.00s)
    --- PASS: TestAccAWSAmplify_serial/Webhook (0.00s)
        --- PASS: TestAccAWSAmplify_serial/Webhook/disappears (33.25s)
        --- PASS: TestAccAWSAmplify_serial/Webhook/basic (36.50s)
        --- PASS: TestAccAWSAmplify_serial/Webhook/update (59.06s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	271.580s

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/amplify Issues and PRs that pertain to the amplify service. labels Aug 3, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @imiosga 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@imiosga imiosga changed the title [WIP] Fix branch name symmetry issue for Amplify Fix branch name symmetry issue for Amplify Aug 3, 2021
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Aug 4, 2021
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Aug 4, 2021
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 🚀.

% go test -v ./aws/internal/service/amplify
=== RUN   TestBranchParseResourceID
=== RUN   TestBranchParseResourceID/empty_ID
=== RUN   TestBranchParseResourceID/incorrect_format
=== RUN   TestBranchParseResourceID/valid_ID
=== RUN   TestBranchParseResourceID/valid_ID_one_slash
=== RUN   TestBranchParseResourceID/valid_ID_three_slashes
--- PASS: TestBranchParseResourceID (0.00s)
    --- PASS: TestBranchParseResourceID/empty_ID (0.00s)
    --- PASS: TestBranchParseResourceID/incorrect_format (0.00s)
    --- PASS: TestBranchParseResourceID/valid_ID (0.00s)
    --- PASS: TestBranchParseResourceID/valid_ID_one_slash (0.00s)
    --- PASS: TestBranchParseResourceID/valid_ID_three_slashes (0.00s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/amplify	1.111s

@ewbankkit
Copy link
Contributor

@imiosga Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 76437e2 into hashicorp:main Aug 4, 2021
@github-actions github-actions bot added this to the v3.53.0 milestone Aug 4, 2021
@github-actions
Copy link

github-actions bot commented Aug 5, 2021

This functionality has been released in v3.53.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!

@github-actions
Copy link

github-actions bot commented Sep 5, 2021

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 5, 2021
@imiosga imiosga deleted the b-aws_amplify_branch-name_symmetry-20410 branch October 1, 2021 10:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/amplify Issues and PRs that pertain to the amplify service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_amplify_branch - unexpected behaviour in BranchParseResourceID (fails for schema-valid branch names)
2 participants