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

B inconsistent field #40707

Merged
merged 17 commits into from
Jan 6, 2025
Merged

B inconsistent field #40707

merged 17 commits into from
Jan 6, 2025

Conversation

Klopklopi
Copy link
Contributor

@Klopklopi Klopklopi commented Dec 27, 2024

Description

Modified the reimportOpenAPIDefinition to make consistent the name in input. The original behavior was altered by the resourceAPIRead that would cause to change the name (and the version) of the ApiGateway at the creation state.

Added test to verify if the name is the same as in input of the resource configuration and not a default name

Relations

Closes #40505.
Closes #33389.

References

Output from Acceptance Testing

% make testacc TESTS=TestAccAPIGatewayV2API_name PKG=apigatewayv2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/apigatewayv2/... -v -count 1 -parallel 20 -run='TestAccAPIGatewayV2API_name'  -timeout 360m
2024/12/27 17:02:37 Initializing Terraform AWS Provider...
=== RUN   TestAccAPIGatewayV2API_name
=== PAUSE TestAccAPIGatewayV2API_name
=== CONT  TestAccAPIGatewayV2API_name
--- PASS: TestAccAPIGatewayV2API_name (26.64s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2       37.517s
...

Hugo Joubert added 2 commits December 27, 2024 16:46
Modified the reimportOpenAPIDefinition to make consistent the name in input. The original behavior was altered by the resourceAPIRead that would cause to change the name (and the version) of the ApiGateway at the creation state.
Added test for the issue hashicorp#40505 to verify if the name is the same as in input of the resource configuration and not a default name
@Klopklopi Klopklopi requested a review from a team as a code owner December 27, 2024 16:04
Copy link

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 tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. needs-triage Waiting for first response or review from a maintainer. labels Dec 27, 2024
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 28, 2024
@ewbankkit ewbankkit self-assigned this Dec 29, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 29, 2024
Copy link

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

ewbankkit
ewbankkit previously approved these changes Dec 29, 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=TestAccAPIGatewayV2API_' PKG=apigatewayv2 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/apigatewayv2/... -v -count 1 -parallel 3  -run=TestAccAPIGatewayV2API_ -timeout 360m
2024/12/29 17:28:51 Initializing Terraform AWS Provider...
=== RUN   TestAccAPIGatewayV2API_tags
=== PAUSE TestAccAPIGatewayV2API_tags
=== RUN   TestAccAPIGatewayV2API_tags_null
=== PAUSE TestAccAPIGatewayV2API_tags_null
=== RUN   TestAccAPIGatewayV2API_tags_EmptyMap
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyMap
=== RUN   TestAccAPIGatewayV2API_tags_AddOnUpdate
=== PAUSE TestAccAPIGatewayV2API_tags_AddOnUpdate
=== RUN   TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate
=== RUN   TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_overlapping
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_overlapping
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag
=== RUN   TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag
=== RUN   TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate
=== PAUSE TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate
=== RUN   TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag
=== PAUSE TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccAPIGatewayV2API_basicWebSocket
=== PAUSE TestAccAPIGatewayV2API_basicWebSocket
=== RUN   TestAccAPIGatewayV2API_basicHTTP
=== PAUSE TestAccAPIGatewayV2API_basicHTTP
=== RUN   TestAccAPIGatewayV2API_disappears
=== PAUSE TestAccAPIGatewayV2API_disappears
=== RUN   TestAccAPIGatewayV2API_allAttributesWebSocket
=== PAUSE TestAccAPIGatewayV2API_allAttributesWebSocket
=== RUN   TestAccAPIGatewayV2API_allAttributesHTTP
=== PAUSE TestAccAPIGatewayV2API_allAttributesHTTP
=== RUN   TestAccAPIGatewayV2API_openAPI
=== PAUSE TestAccAPIGatewayV2API_openAPI
=== RUN   TestAccAPIGatewayV2API_OpenAPI_withTags
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_withTags
=== RUN   TestAccAPIGatewayV2API_OpenAPI_withCors
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_withCors
=== RUN   TestAccAPIGatewayV2API_OpenAPI_withMoreFields
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_withMoreFields
=== RUN   TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
=== RUN   TestAccAPIGatewayV2API_cors
=== PAUSE TestAccAPIGatewayV2API_cors
=== RUN   TestAccAPIGatewayV2API_quickCreate
=== PAUSE TestAccAPIGatewayV2API_quickCreate
=== RUN   TestAccAPIGatewayV2API_OpenAPI_noTitle
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_noTitle
=== CONT  TestAccAPIGatewayV2API_tags
=== CONT  TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add
=== CONT  TestAccAPIGatewayV2API_openAPI
--- PASS: TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add (27.73s)
=== CONT  TestAccAPIGatewayV2API_OpenAPI_noTitle
--- PASS: TestAccAPIGatewayV2API_openAPI (28.34s)
=== CONT  TestAccAPIGatewayV2API_quickCreate
--- PASS: TestAccAPIGatewayV2API_OpenAPI_noTitle (14.93s)
=== CONT  TestAccAPIGatewayV2API_cors
--- PASS: TestAccAPIGatewayV2API_quickCreate (14.17s)
=== CONT  TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
--- PASS: TestAccAPIGatewayV2API_tags (47.81s)
=== CONT  TestAccAPIGatewayV2API_OpenAPI_withMoreFields
=== NAME  TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
    api_test.go:509: Step 1/5, expected an error with pattern, no match on: After applying this test step, the non-refresh plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_apigatewayv2_api.test will be updated in-place
          ~ resource "aws_apigatewayv2_api" "test" {
              - description                  = "Description test" -> null
                id                           = "oe1umios86"
              ~ name                         = "Title test" -> "tf-acc-test-5492610049081969265"
              - version                      = "2.0" -> null
                # (10 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAPIGatewayV2API_OpenAPI_failOnWarnings (11.16s)
=== CONT  TestAccAPIGatewayV2API_OpenAPI_withCors
--- PASS: TestAccAPIGatewayV2API_cors (28.12s)
=== CONT  TestAccAPIGatewayV2API_OpenAPI_withTags
--- PASS: TestAccAPIGatewayV2API_OpenAPI_withMoreFields (28.81s)
=== CONT  TestAccAPIGatewayV2API_basicHTTP
--- PASS: TestAccAPIGatewayV2API_OpenAPI_withCors (34.65s)
=== CONT  TestAccAPIGatewayV2API_allAttributesHTTP
--- PASS: TestAccAPIGatewayV2API_basicHTTP (13.25s)
=== CONT  TestAccAPIGatewayV2API_allAttributesWebSocket
--- PASS: TestAccAPIGatewayV2API_OpenAPI_withTags (27.38s)
=== CONT  TestAccAPIGatewayV2API_disappears
--- PASS: TestAccAPIGatewayV2API_disappears (11.40s)
=== CONT  TestAccAPIGatewayV2API_basicWebSocket
--- PASS: TestAccAPIGatewayV2API_basicWebSocket (13.01s)
=== CONT  TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccAPIGatewayV2API_allAttributesHTTP (35.40s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_overlapping
--- PASS: TestAccAPIGatewayV2API_allAttributesWebSocket (36.34s)
=== CONT  TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate
--- PASS: TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate (17.61s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag (28.20s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag (14.33s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_overlapping (37.15s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag (14.46s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag (15.05s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag (15.14s)
=== CONT  TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly (21.95s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly (22.72s)
=== CONT  TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly
--- PASS: TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add (33.57s)
=== CONT  TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping (36.50s)
=== CONT  TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag (32.98s)
=== CONT  TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly (47.80s)
=== CONT  TestAccAPIGatewayV2API_tags_AddOnUpdate
--- PASS: TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace (22.88s)
=== CONT  TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate
--- PASS: TestAccAPIGatewayV2API_tags_AddOnUpdate (22.40s)
=== CONT  TestAccAPIGatewayV2API_tags_EmptyMap
--- PASS: TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace (26.43s)
=== CONT  TestAccAPIGatewayV2API_tags_null
--- PASS: TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate (25.24s)
--- PASS: TestAccAPIGatewayV2API_tags_EmptyMap (17.19s)
--- PASS: TestAccAPIGatewayV2API_tags_null (17.72s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2	292.212s
FAIL
make: *** [testacc] Error 1

Failure is unrelated to this change and is occurring in CI.

@Klopklopi Klopklopi requested a review from ewbankkit December 30, 2024 14:58
Copy link
Contributor

@johnsonaj johnsonaj left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@ewbankkit
Copy link
Contributor

@Klopklopi Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 20de062 into hashicorp:main Jan 6, 2025
41 checks passed
@github-actions github-actions bot added this to the v5.83.0 milestone Jan 6, 2025
@Klopklopi Klopklopi deleted the b_inconsistent_field branch January 6, 2025 18:42
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
3 participants