-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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/codebuild_project: support git_clone_depth #3467
resource/codebuild_project: support git_clone_depth #3467
Conversation
97b371d
to
4d3f92e
Compare
resolve conflicts. |
@loivis sorry your ValidateFunc replacement PR made this one unhappy. 🙁 Do you mind sync'ing this up again or let me know if you don't have time? Should be a lot smaller. 😄 |
4d3f92e
to
8da7532
Compare
8da7532
to
0345474
Compare
0345474
to
50b0c25
Compare
50b0c25
to
39648e0
Compare
39648e0
to
8029423
Compare
8029423
to
3f962de
Compare
3f962de
to
3132fcb
Compare
3132fcb
to
53bddf6
Compare
53bddf6
to
58fbe6c
Compare
58fbe6c
to
de61ddf
Compare
de61ddf
to
191f3fb
Compare
should be ok now.
|
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.
Left an initial review below, please let me know if you have any questions. 😄
@@ -619,6 +625,10 @@ func flattenAwsCodeBuildProjectSource(source *codebuild.ProjectSource) []interfa | |||
m["buildspec"] = *source.Buildspec | |||
} | |||
|
|||
if source.GitCloneDepth != nil { | |||
m["git_clone_depth"] = *source.GitCloneDepth |
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.
Two things:
- If the
source.GitCloneDepth
value is always returned, this will change the TypeSet hash when folks upgrade their AWS provider and it will show a diff. We'll need to implement a state migration if that's the case to prevent the diff. - We should convert this from int64 to int to match the Terraform schema:
int(aws.Int64Value(source.GitCloneDepth))
@@ -683,6 +693,9 @@ func resourceAwsCodeBuildProjectSourceHash(v interface{}) int { | |||
if v, ok := m["buildspec"]; ok { | |||
buf.WriteString(fmt.Sprintf("%s-", v.(string))) | |||
} | |||
if v, ok := m["git_clone_depth"]; ok { | |||
buf.WriteString(fmt.Sprintf("%d-", v.(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.
Similar note here, if git_clone_depth
defaults to 0, this will change the TypeSet hash when folks upgrade their AWS provider and it will show a diff. We'll need to implement a state migration if that's the case to prevent the diff.
@@ -403,6 +403,7 @@ resource "aws_codebuild_project" "foo" { | |||
source { | |||
type = "GITHUB" | |||
location = "https://github.com/hashicorp/packer.git" | |||
git_clone_depth = 1 |
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.
We should probably move this to its own test and ensure it can be updated 👍
FYI I think you can get rid of this |
Semi-duplicate PR behind this one: #3929 @loivis do you have any questions or need any help implementing this? If Git clone depth is always returned I think the best route forward here is going to be performing a state migration of |
Looking forward to this ! |
close in favor of #3929 |
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! |
Fix #3457
Also did little cleanup to drop custom validation functions.
The error below doesn't matter, I think?