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

resource/aws_codebuild_project: Switch artifacts from TypeSet to TypeList and verify updates #9559

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jul 31, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #755
Closes #2050
Closes #6214
Reference: #6427
Closes #7582

Release note for CHANGELOG:

* resource/aws_codebuild_project: Properly perform drift detection and updates for `artifacts` configuration block arguments

Output from acceptance testing:

--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (58.62s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (52.17s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (51.88s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (51.20s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (52.22s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (33.85s)
--- PASS: TestAccAWSCodeBuildProject_basic (24.98s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (42.62s)
--- PASS: TestAccAWSCodeBuildProject_Cache (70.42s)
--- PASS: TestAccAWSCodeBuildProject_Description (42.32s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (52.39s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (36.50s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (55.37s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (30.64s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (40.62s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (34.69s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (48.53s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (72.76s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (37.23s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (29.35s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (30.83s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (40.18s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (31.11s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (42.65s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (34.28s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (43.13s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (33.90s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (34.04s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (29.80s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (29.93s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (33.38s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (12.23s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (36.44s)
--- PASS: TestAccAWSCodeBuildProject_Tags (43.37s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (62.05s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (23.75s)

…List and verify updates

Reference: #755
Reference: #2050
Reference: #6214
Reference: #6427
Reference: #7582

Output from acceptance testing:

```
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (58.62s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (52.17s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (51.88s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (51.20s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (52.22s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (33.85s)
--- PASS: TestAccAWSCodeBuildProject_basic (24.98s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (42.62s)
--- PASS: TestAccAWSCodeBuildProject_Cache (70.42s)
--- PASS: TestAccAWSCodeBuildProject_Description (42.32s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (52.39s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (36.50s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (55.37s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (30.64s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (40.62s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (34.69s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (48.53s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (72.76s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (37.23s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (29.35s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (30.83s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (40.18s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (31.11s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (42.65s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (34.28s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (43.13s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (33.90s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (34.04s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (29.80s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (29.93s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (33.38s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (12.23s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (36.44s)
--- PASS: TestAccAWSCodeBuildProject_Tags (43.37s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (62.05s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (23.75s)
```
@bflad bflad added bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service. labels Jul 31, 2019
@bflad bflad requested a review from a team July 31, 2019 04:56
@ghost ghost added size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 31, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

Overall this looks good to me, minus a dangling function. I left a couple of suggestions to help improve the readability of the DiffSuppressFunc, but totally optional.

--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (37.01s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (37.42s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (37.48s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (38.41s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (38.45s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (38.58s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (38.64s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (39.75s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (47.11s)
--- PASS: TestAccAWSCodeBuildProject_Tags (50.22s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (50.26s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (50.26s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (50.31s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (59.31s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (69.38s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (69.41s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (34.60s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (37.20s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (76.71s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (37.90s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (78.10s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (78.25s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (34.53s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (38.18s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (51.51s)
--- PASS: TestAccAWSCodeBuildProject_Description (45.84s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (60.59s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (63.23s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (64.99s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (53.93s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (45.54s)
--- PASS: TestAccAWSCodeBuildProject_basic (36.18s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (89.57s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (86.02s)
--- PASS: TestAccAWSCodeBuildProject_Cache (92.89s)

@@ -83,7 +104,6 @@ func resourceAwsCodeBuildProject() *schema.Resource {
},
},
},
Set: resourceAwsCodeBuildProjectArtifactsHash,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see it in the diff, but we can probably get rid of the actual function definition as it is no longer being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's still used by secondary_artifacts on line 324 and cannot be removed from there. 😉 golangci-lint is configured to automatically report unused functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lesson learned don't use ack when you have a linter. 🙉 🙈 🙊

aws/resource_aws_codebuild_project.go Show resolved Hide resolved
aws/resource_aws_codebuild_project.go Show resolved Hide resolved
Reference: #9559 (review)

Output from acceptance testing:

```
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (53.64s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (57.02s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (56.85s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (56.31s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (61.53s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (30.06s)
--- PASS: TestAccAWSCodeBuildProject_basic (31.13s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (39.00s)
--- PASS: TestAccAWSCodeBuildProject_Cache (65.22s)
--- PASS: TestAccAWSCodeBuildProject_Description (38.67s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (57.59s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (39.07s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (41.42s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (38.48s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (43.88s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (34.06s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (48.99s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (75.52s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (38.24s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (33.84s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (30.58s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (32.53s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (31.51s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (32.10s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (31.24s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (41.85s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (33.70s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (33.65s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (33.85s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (33.55s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (33.11s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (11.74s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (37.75s)
--- PASS: TestAccAWSCodeBuildProject_Tags (42.64s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (63.50s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (33.05s)
```
Copy link
Contributor Author

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Updated the DiffSuppressFunc and acceptance testing is still passing:

--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (53.64s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (57.02s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (56.85s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (56.31s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (61.53s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (30.06s)
--- PASS: TestAccAWSCodeBuildProject_basic (31.13s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (39.00s)
--- PASS: TestAccAWSCodeBuildProject_Cache (65.22s)
--- PASS: TestAccAWSCodeBuildProject_Description (38.67s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (57.59s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (39.07s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (41.42s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (38.48s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (43.88s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (34.06s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (48.99s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (75.52s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (38.24s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (33.84s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (30.58s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (32.53s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (31.51s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (32.10s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (31.24s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (41.85s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (33.70s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (33.65s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (33.85s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (33.55s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (33.11s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (11.74s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (37.75s)
--- PASS: TestAccAWSCodeBuildProject_Tags (42.64s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (63.50s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (33.05s)

Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

LGTM 👍 👍

@bflad bflad added this to the v2.22.0 milestone Jul 31, 2019
@bflad bflad merged commit 2dc164b into master Jul 31, 2019
@bflad bflad deleted the b-aws_codebuild_project-less-Set branch July 31, 2019 20:53
bflad added a commit that referenced this pull request Jul 31, 2019
@ghost
Copy link

ghost commented Aug 1, 2019

This has been released in version 2.22.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 for triage. Thanks!

@ghost
Copy link

ghost commented Nov 2, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 2, 2019
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. service/codebuild Issues and PRs that pertain to the codebuild service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants