-
-
Notifications
You must be signed in to change notification settings - Fork 965
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
WIP - feat: introducing "copy_terraform_lock_file" to fine tune Lock File Handling #2889
base: main
Are you sure you want to change the base?
Conversation
…andling Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
cc4a171
to
3ab235d
Compare
Hi @denis256, would you be so kind and provide some feedback about this PR? Thanks in advance. |
Hi, yes, it is in my queue to check... ⌛ |
Hi @denis256 , sorry to bother you once again, but is there anything I could help you to expedite the review of this PR? I would love to hear from you if this change is something the project is willing to accept. Thanks once again. |
hello @rodrigorfk @denis256 , hope you're doing well. Can I ask if this merge can be completed sometime soon? my team found this merge request and we could all use this feature since we're trying to create a remote and client setup for terragrunt and versioning could become an issue if there are locks on both remote and client side. |
# Conflicts: # cli/commands/terraform/action.go
488b2bf
to
2140d73
Compare
Hi @Josephuss , thanks for your message, I'm happy to see that your team also thought this change would be useful, I have updated the branch and fixed the outstanding conflicts. |
We've also come across this PR, it's exactly the functionality we need, for the same reasons as the others mentioned. |
Thanks @rodrigorfk for bringing this update! This change unlocks the ability for the lock file to be managed and versioned by the remove module itself. It would be great to have it merged. |
# Conflicts: # config/include_test.go # docs/_docs/02_features/lock-file-handling.md
Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Thanks for the interest @IvanKuzyshyn , I have updated the branch and resolved the conflicts once again. Hopefully @denis256 will have some time to provide a feedback about this change soon. 🙏 |
Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Quality Gate passedIssues Measures |
Just passing by to nudge this as I'm also interested, thanks in advance 😀 |
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 great! I left some small details that can be addressed before we get this merged in.
Sorry we've let this PR get stale. I appreciate that the tests were updated, and docs were improved with the feature update.
func shouldCopyLockFile(args []string) bool { | ||
func shouldCopyLockFile(args []string, terraformConfig *config.TerraformConfig) bool { | ||
if terraformConfig != nil && terraformConfig.CopyTerraformLockFile != nil && !*terraformConfig.CopyTerraformLockFile { | ||
return false |
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 can be simplified as return *terraformConfig.CopyTerraformLockFile
, with the last part of the if
statement removed above.
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.
thanks for the suggestion @yhakbar, but I am not sure if we should perform an early return like that, if we do that and the user explicitly defines copyTerraformLockFile = true
on their terragrunt.hcl, terragrunt will copy the file on all commands, which will change the existing behaviour about copying it only for the init
and providers lock
command. Thoughts?
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.
Ah, good point. It might help to leave a comment above the check to make sure that someone doesn't make the same logical mistake I'm making.
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.
done @yhakbar, added the comment, do you mind having another look? thanks in advance
Hi @yhakbar, thanks for the review and suggestions, I will be away for a week and will make sure I go over your comments once I am back. |
# Conflicts: # config/config_as_cty.go # docs/_docs/04_reference/config-blocks-and-attributes.md
Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Quality Gate passedIssues Measures |
Hey there kind folks, just coming to bump that up the grave if anyone is available for review 🙏 |
Hey @gmauleon , this PR currently has some conflicts, so it'll need those conflicts resolved, lints passing and tests run before it can be reviewed. When it is, the title should be updated, with reviews requested. If you could help out @rodrigorfk by supplying a PR to his source branch, that might help things move along. |
Description
Fixes #1653.
This PR introduces a new attribute called
copy_terraform_lock_file
under theterraform
block as following:The default value is
true
and does not change any existing Terragrunt behaviour, once it is defined asfalse
, Terragrunt will stop copying the.terraform.lock.hcl
file from the temporary terragrunt directory to the working directory.TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added / Removed / Updated [X].
Added "copy_terraform_lock_file" attribute to fine tune Lock File Handling
Migration Guide