-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
service/codebuild: use typelist where maxitems are 1 #13417
Conversation
@@ -178,7 +177,6 @@ func resourceAwsCodeBuildProject() *schema.Resource { | |||
"environment_variable": { | |||
Type: schema.TypeList, | |||
Optional: true, | |||
Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bflad this helped TestAccAWSCodeBuildProject_Environment_EnvironmentVariable
pass but I'm not sure if this is the best change; in the original test, updating from 2 env variables -> 0 failed but 1->2 passed 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good thing to me, especially if the existing testing was expecting it to behave this way (it likely worked previously because of the Set
function). It enables proper drift detection if the environment variables are not in the Terraform configuration, but they are configured in the API. The original implementation (hashicorp/terraform#11560) includes this without comment, so I'm willing to say that we should feel okay changing this now given that generally we want to enable drift detection where possible. CodeBuild also supports hiding sensitive values now via SSM and Secrets Manager. Worst case, we can re-enable Computed
, if for some reason this must be hidden from the diff in some cases, which should have their own, new acceptance tests to prevent this potential "regression" again. 😄
We'll definitely want to note this particular change in the CHANGELOG though, just in case it might catch folks off guard. 👍
@@ -178,7 +177,6 @@ func resourceAwsCodeBuildProject() *schema.Resource { | |||
"environment_variable": { | |||
Type: schema.TypeList, | |||
Optional: true, | |||
Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good thing to me, especially if the existing testing was expecting it to behave this way (it likely worked previously because of the Set
function). It enables proper drift detection if the environment variables are not in the Terraform configuration, but they are configured in the API. The original implementation (hashicorp/terraform#11560) includes this without comment, so I'm willing to say that we should feel okay changing this now given that generally we want to enable drift detection where possible. CodeBuild also supports hiding sensitive values now via SSM and Secrets Manager. Worst case, we can re-enable Computed
, if for some reason this must be hidden from the diff in some cases, which should have their own, new acceptance tests to prevent this potential "regression" again. 😄
We'll definitely want to note this particular change in the CHANGELOG though, just in case it might catch folks off guard. 👍
@@ -1516,84 +1512,6 @@ func resourceAwsCodeBuildProjectArtifactsHash(v interface{}) int { | |||
return hashcode.String(buf.String()) | |||
} | |||
|
|||
func resourceAwsCodeBuildProjectEnvironmentHash(v interface{}) int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
Please note that I've also marked this to close #10615 since the original issue report refers to a problem with the set hashing, that will no longer be present. |
…blebinarydriver flag where applicable
@bflad I also started using the string ptr -> string conversion func in one place then ended up looking at the whole file 😅 lmk if I should change those back as well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to go, thanks for all your effort into this beast of an issue. 🚀 Please reach out if you'd like any help with changelog or issue commenting.
Output from acceptance testing (VPC config one needs an issue opened, OAuth testing is completely manual, which we may want to consider hiding that test behind an environment variable):
--- FAIL: TestAccAWSCodeBuildProject_Source_Auth (11.50s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (23.67s)
--- PASS: TestAccAWSCodeBuildProject_Description (52.62s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (55.68s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig_GitHub (63.09s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig_GitHub (77.11s)
--- PASS: TestAccAWSCodeBuildProject_basic (85.00s)
--- PASS: TestAccAWSCodeBuildProject_SourceVersion (86.97s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig_GitHubEnterprise (89.06s)
--- PASS: TestAccAWSCodeBuildProject_QueuedTimeout (88.99s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (92.68s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (95.28s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig_CodeCommit (96.34s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig_GitHubEnterprise (75.27s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (106.75s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (11.68s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (54.60s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (32.26s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (32.38s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (30.63s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (137.75s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (48.92s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (50.46s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (93.21s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_ArtifactIdentifier (33.25s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (153.71s)
--- PASS: TestAccAWSCodeBuildProject_Tags (58.31s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (71.52s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (96.63s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Name (35.31s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (37.37s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (65.58s)
--- SKIP: TestAccAWSCodeBuildProject_SecondaryArtifacts_Name (0.00s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (110.56s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (42.54s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (38.99s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (46.35s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (198.18s)
--- PASS: TestAWSCodeBuildProject_nameValidation (0.00s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (64.06s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Type (70.45s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Packaging (39.19s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_NamespaceType (51.99s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (40.82s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Location (64.50s)
--- PASS: TestAccAWSCodeBuildProject_ARMContainer (131.31s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Location (116.51s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Path (54.57s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_EncryptionDisabled (72.07s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_OverrideArtifactName (77.64s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (55.33s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Type (66.01s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Value (263.13s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_ArtifactIdentifier (99.59s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (270.23s)
--- PASS: TestAccAWSCodeBuildProject_Cache (319.79s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (243.82s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig_CodeCommit (397.06s)
--- FAIL: TestAccAWSCodeBuildProject_VpcConfig (348.53s)
This has been released in version 2.64.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! |
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! |
Community Note
Relates #9956
Release note for CHANGELOG:
Output from acceptance testing: