Conversation
|
@james00012 Why do this? We just removed the It seems odd that we'd prefix them like this |
Yeah that's a good idea. |
bec705c to
ce2716b
Compare
Remove the terragrunt- prefix from flags and update function names to match standard terraform module naming conventions. Changes: - ApplyAll (was TgApplyAll) - ApplyAllE (was TgApplyAllE) - DestroyAll (was TgDestroyAll) - DestroyAllE (was TgDestroyAllE) - PlanAllExitCode (was TgPlanAllExitCode) - PlanAllExitCodeE (was TgPlanAllExitCodeE) - Init (was TgInit) - InitE (was TgInitE) - StackGenerate (was TgStackGenerate) - StackGenerateE (was TgStackGenerateE) - StackRun (was TgStackRun) - StackRunE (was TgStackRunE) - StackClean (was TgStackClean) - StackCleanE (was TgStackCleanE) - Output (was TgOutput) - OutputE (was TgOutputE) - OutputJson (was TgOutputJson) - OutputJsonE (was TgOutputJsonE) - OutputAll (was TgOutputAll) - OutputAllE (was TgOutputAllE) - Update all tests to use new function names - Update README documentation and examples Benefits: - Simpler, cleaner function names - Consistent with Terragrunt removing terragrunt- prefix from flags - Easier to type and read - Package name already indicates these are terragrunt functions Fixes #1618
ce2716b to
b055a89
Compare
Update ValidateAll and OutputAll to follow the same naming convention as PR #1621 (no Tg prefix). This ensures consistency across all terragrunt module functions.
| func TgStackGenerate(t testing.TestingT, options *Options) string { | ||
| out, err := TgStackGenerateE(t, options) | ||
| // StackGenerate calls terragrunt stack generate and returns stdout/stderr | ||
| func StackGenerate(t testing.TestingT, options *Options) string { |
There was a problem hiding this comment.
It appears that StackGenerate() is not being used at all. I think we should have tests to track that it is used and will not fail
There was a problem hiding this comment.
Hi @denis256, most of the current tests are focused on calling Stack*E. If needed, I can add tests for StackGenerate as well, even without checking for errors—but since it’s just a simple wrapper, I think covering one of the functions should be sufficient.
| func TgStackRun(t testing.TestingT, options *Options) string { | ||
| out, err := TgStackRunE(t, options) | ||
| // StackRun calls terragrunt stack run and returns stdout/stderr | ||
| func StackRun(t testing.TestingT, options *Options) string { |
| // This command cleans up the generated stack files created by stack generate or stack run | ||
| func TgStackClean(t testing.TestingT, options *Options) string { | ||
| out, err := TgStackCleanE(t, options) | ||
| func StackClean(t testing.TestingT, options *Options) string { |
There was a problem hiding this comment.
StackClean() is not invoked in any test
Description
Simplifies function names by removing the
Tgprefix, following Terragrunt's own simplification of removingterragrunt-prefixes from CLI flags.Changes
Function renames:
ApplyAll(wasTgApplyAll)DestroyAll(wasTgDestroyAll)PlanAllExitCode(wasTgPlanAllExitCode)Init(wasTgInit)StackGenerate,StackRun,StackClean(removedTgprefix)Output,OutputJson,OutputAll(removedTgprefix)All tests and documentation updated.
Migration Guide
Simple find-replace: Remove
Tgprefix from all terragrunt function calls.Benefits
Fixes #1618