Skip to content
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

#1891 Dependent modules detection update #1915

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

denis256
Copy link
Member

Updated FindWhereWorkingDirIsIncluded to return only detected dependent modules, in case of failures user will be asked to confirm the action in any case.

Fix for: #1891

Verified

This commit was signed with the committer’s verified signature.
denis256 Denis O
@@ -577,7 +577,8 @@ func FindWhereWorkingDirIsIncluded(terragruntOptions *options.TerragruntOptions,
dir = dir + filepath.FromSlash("/")
cfgOptions, err := options.NewTerragruntOptions(dir)
if err != nil {
return nil, err
terragruntOptions.Logger.Debugf("Failed to build terragrunt options from %s %v", dir, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a real error that should probably be returned?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since building list of all modules that use current module may not work in some cases(usage of relative paths) approach is to log as debug and ask user to confirm only detected dependencies

#1889

#299

return nil, err
// loggign error as debug since in some cases stack building may fail because parent files can be designed
// to work with relative paths from downstream modules
terragruntOptions.Logger.Debugf("Failed to build module stack %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the real fix for this issue? Where we don't return an error in this case?

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood! I'll kick off tests now.

@brikis98
Copy link
Member

Tests passed! Merging now.

@brikis98 brikis98 merged commit e602659 into gruntwork-io:master Nov 19, 2021
@brikis98
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants