-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 secondary_artifacts hash function for aws_codebuild_project #9652
Fix secondary_artifacts hash function for aws_codebuild_project #9652
Conversation
1938d54
to
de189c2
Compare
Thanks for taking this on, @jckuester! If we get this to the right spot, we should add
While glancing through your changes, it appears S3 is the only valid type for secondary artifacts? If so, is it safe to add For |
Good idea, that works!
I am not sure how I can access/pass the CodeBuild project name into the hash function. How do I get access to |
Arg! You are right. The set function only receives an |
If you have a good idea, let me know :-) |
@jckuester if you could push up what you have, we can at least fix the other Our options are fairly limited for the
We might need to mark the # Future Terraform functionality -- not yet implemented
resource "aws_codebuild_project" "example" {
# ... other configuration ...
source_artifact "name1" {
# ... other configuration ...
}
} However that is much farther away. |
de189c2
to
adf090b
Compare
@bflad pushed my changes and skipped the test for the There is a linter error, but I am not aware that I touched any related code:
Do you want me to remove that func? |
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.
Hi @jckuester 👋 Thank you very much for this submission and all the extra testing. I think we are currently at a block for fixing up the secondary_artifacts
configuration block name
handling since we won't be able to correctly get the default in there, however the rest of the changes here are excellent so going to merge this pull request in its current form so we can get all those fixes in. We can discuss ideas for name
further in #6643 🚀
--- PASS: TestAccAWSCodeBuildProject_basic (35.04s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (35.79s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (36.85s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (38.37s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (38.14s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (38.54s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (28.55s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (42.12s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (44.24s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (46.56s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (47.35s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (47.89s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (48.17s)
--- PASS: TestAccAWSCodeBuildProject_Description (48.45s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (48.45s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (14.37s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (55.02s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (56.54s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (57.35s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (57.30s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (23.13s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (27.86s)
--- SKIP: TestAccAWSCodeBuildProject_SecondaryArtifacts_Name (0.00s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (28.28s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (29.13s)
--- PASS: TestAccAWSCodeBuildProject_Tags (38.30s)
--- PASS: TestAccAWSCodeBuildProject_Cache (80.17s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_ArtifactIdentifier (40.98s)
--- PASS: TestAWSCodeBuildProject_nameValidation (0.00s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (39.73s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (31.67s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Name (40.51s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Location (42.65s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (41.46s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (41.82s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (42.45s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (42.64s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (52.26s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Type (40.22s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_ArtifactIdentifier (39.63s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_OverrideArtifactName (39.58s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_EncryptionDisabled (40.84s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Location (40.07s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_NamespaceType (37.83s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Packaging (36.39s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Path (35.54s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts_Type (30.38s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (28.84s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (36.23s)
This has been released in version 2.24.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! |
This is incorrect. According to both the Terraform documentation and AWS's CodeBuild documentation, the following
This Pull Request breaks adding a |
@JonathanReiss15 @bflad I added two temporary tests (#10198) to show, why I assumed
and
|
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! |
Relates to #6643
This PR fixes the hash function for
secondary_artifacts
of theaws_codebuild_project
resource. The symptom was that changes weren't detected by Terraform when changing some ofsecondary_artifacts
's attributes.Unfortunately, I found no good way yet to correctly detect and apply updates for the following attributes:
name
,namespace_type
, andpackaging
. The reason is that those three attributes (if not set explicitly through Terraform configuration) are set by AWS internally and cause the hash value ofsecondary_artifacts
to change after the apply. The tests complain that their is some unapplied diff in the plan.Community Note
Output from acceptance testing: