Skip to content

Commit

Permalink
revert includeparentblocks flag (#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes authored Dec 5, 2024
1 parent 5ae8348 commit 24badb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
1 change: 0 additions & 1 deletion libs/digger_config/digger_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ func hydrateDiggerConfigYamlWithTerragrunt(configYaml *DiggerConfigYaml, parsing
parsingConfig.CreateHclProjectChilds,
ignoreParentTerragrunt,
parsingConfig.IgnoreDependencyBlocks,
parsingConfig.IgnoreIncludeBlocks,
cascadeDependencies,
parsingConfig.DefaultWorkflow,
parsingConfig.DefaultApplyRequirements,
Expand Down
20 changes: 10 additions & 10 deletions libs/digger_config/terragrunt/atlantis/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func sliceUnion(a, b []string) []string {
}

// Parses the terragrunt digger_config at `path` to find all modules it depends on
func getDependencies(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, ignoreIncludeBlocks bool, gitRoot string, cascadeDependencies bool, path string, terragruntOptions *options.TerragruntOptions) ([]string, error) {
func getDependencies(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, gitRoot string, cascadeDependencies bool, path string, terragruntOptions *options.TerragruntOptions) ([]string, error) {
res, err, _ := requestGroup.Do(path, func() (interface{}, error) {
// Check if this path has already been computed
cachedResult, ok := getDependenciesCache.get(path)
Expand All @@ -139,7 +139,7 @@ func getDependencies(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, i
}

dependencies := []string{}
if !ignoreIncludeBlocks && len(includes) > 0 {
if len(includes) > 0 {
for _, includeDep := range includes {
getDependenciesCache.set(includeDep.Path, getDependenciesOutput{nil, err})
dependencies = append(dependencies, includeDep.Path)
Expand Down Expand Up @@ -256,7 +256,7 @@ func getDependencies(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, i
depPath := dep
terrOpts, _ := options.NewTerragruntOptionsWithConfigPath(depPath)
terrOpts.OriginalTerragruntConfigPath = terragruntOptions.OriginalTerragruntConfigPath
childDeps, err := getDependencies(ignoreParentTerragrunt, ignoreDependencyBlocks, ignoreIncludeBlocks, gitRoot, cascadeDependencies, depPath, terrOpts)
childDeps, err := getDependencies(ignoreParentTerragrunt, ignoreDependencyBlocks, gitRoot, cascadeDependencies, depPath, terrOpts)
if err != nil {
continue
}
Expand Down Expand Up @@ -313,7 +313,7 @@ func getDependencies(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, i
}

// Creates an AtlantisProject for a directory
func createProject(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, ignoreIncludeBlocks bool, gitRoot string, cascadeDependencies bool, defaultWorkflow string, defaultApplyRequirements []string, autoPlan bool, defaultTerraformVersion string, createProjectName bool, createWorkspace bool, sourcePath string) (*AtlantisProject, []string, error) {
func createProject(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, gitRoot string, cascadeDependencies bool, defaultWorkflow string, defaultApplyRequirements []string, autoPlan bool, defaultTerraformVersion string, createProjectName bool, createWorkspace bool, sourcePath string) (*AtlantisProject, []string, error) {
options, err := options.NewTerragruntOptionsWithConfigPath(sourcePath)

var potentialProjectDependencies []string
Expand All @@ -324,7 +324,7 @@ func createProject(ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, ign
options.RunTerragrunt = terraform.Run
options.Env = getEnvs()

dependencies, err := getDependencies(ignoreParentTerragrunt, ignoreDependencyBlocks, ignoreIncludeBlocks, gitRoot, cascadeDependencies, sourcePath, options)
dependencies, err := getDependencies(ignoreParentTerragrunt, ignoreDependencyBlocks, gitRoot, cascadeDependencies, sourcePath, options)
if err != nil {
return nil, potentialProjectDependencies, err
}
Expand Down Expand Up @@ -434,7 +434,7 @@ func projectNameFromDir(projectDir string) string {
return projectName
}

func createHclProject(defaultWorkflow string, defaultApplyRequirements []string, autoplan bool, useProjectMarkers bool, defaultTerraformVersion string, ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, ignoreIncludeBlocks bool, gitRoot string, cascadeDependencies bool, createProjectName bool, createWorkspace bool, sourcePaths []string, workingDir string, projectHcl string) (*AtlantisProject, error) {
func createHclProject(defaultWorkflow string, defaultApplyRequirements []string, autoplan bool, useProjectMarkers bool, defaultTerraformVersion string, ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, gitRoot string, cascadeDependencies bool, createProjectName bool, createWorkspace bool, sourcePaths []string, workingDir string, projectHcl string) (*AtlantisProject, error) {
var projectHclDependencies []string
var childDependencies []string
workflow := defaultWorkflow
Expand Down Expand Up @@ -507,7 +507,7 @@ func createHclProject(defaultWorkflow string, defaultApplyRequirements []string,
options.RunTerragrunt = terraform.Run
options.Env = getEnvs()

dependencies, err := getDependencies(ignoreParentTerragrunt, ignoreDependencyBlocks, ignoreIncludeBlocks, gitRoot, cascadeDependencies, sourcePath, options)
dependencies, err := getDependencies(ignoreParentTerragrunt, ignoreDependencyBlocks, gitRoot, cascadeDependencies, sourcePath, options)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -660,7 +660,7 @@ func getAllTerragruntProjectHclFiles(projectHclFiles []string, gitRoot string) m
return uniqueHclFileAbsPaths
}

func Parse(gitRoot string, projectHclFiles []string, createHclProjectExternalChilds bool, autoMerge bool, parallel bool, filterPath string, createHclProjectChilds bool, ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, ignoreIncludeBlocks bool, cascadeDependencies bool, defaultWorkflow string, defaultApplyRequirements []string, autoPlan bool, defaultTerraformVersion string, createProjectName bool, createWorkspace bool, preserveProjects bool, useProjectMarkers bool, executionOrderGroups bool) (*AtlantisConfig, map[string][]string, error) {
func Parse(gitRoot string, projectHclFiles []string, createHclProjectExternalChilds bool, autoMerge bool, parallel bool, filterPath string, createHclProjectChilds bool, ignoreParentTerragrunt bool, ignoreDependencyBlocks bool, cascadeDependencies bool, defaultWorkflow string, defaultApplyRequirements []string, autoPlan bool, defaultTerraformVersion string, createProjectName bool, createWorkspace bool, preserveProjects bool, useProjectMarkers bool, executionOrderGroups bool) (*AtlantisConfig, map[string][]string, error) {
// Ensure the gitRoot has a trailing slash and is an absolute path
absoluteGitRoot, err := filepath.Abs(gitRoot)
if err != nil {
Expand Down Expand Up @@ -726,7 +726,7 @@ func Parse(gitRoot string, projectHclFiles []string, createHclProjectExternalChi

errGroup.Go(func() error {
defer sem.Release(1)
project, projDeps, err := createProject(ignoreParentTerragrunt, ignoreDependencyBlocks, ignoreIncludeBlocks, gitRoot, cascadeDependencies, defaultWorkflow, defaultApplyRequirements, autoPlan, defaultTerraformVersion, createProjectName, createWorkspace, terragruntPath)
project, projDeps, err := createProject(ignoreParentTerragrunt, ignoreDependencyBlocks, gitRoot, cascadeDependencies, defaultWorkflow, defaultApplyRequirements, autoPlan, defaultTerraformVersion, createProjectName, createWorkspace, terragruntPath)
if err != nil {
return err
}
Expand Down Expand Up @@ -785,7 +785,7 @@ func Parse(gitRoot string, projectHclFiles []string, createHclProjectExternalChi

errGroup.Go(func() error {
defer sem.Release(1)
project, err := createHclProject(defaultWorkflow, defaultApplyRequirements, autoPlan, useProjectMarkers, defaultTerraformVersion, ignoreParentTerragrunt, ignoreDependencyBlocks, ignoreIncludeBlocks, gitRoot, cascadeDependencies, createProjectName, createWorkspace, terragruntFiles, workingDir, projectHcl)
project, err := createHclProject(defaultWorkflow, defaultApplyRequirements, autoPlan, useProjectMarkers, defaultTerraformVersion, ignoreParentTerragrunt, ignoreDependencyBlocks, gitRoot, cascadeDependencies, createProjectName, createWorkspace, terragruntFiles, workingDir, projectHcl)
if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion libs/digger_config/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ type TerragruntParsingConfig struct {
IgnoreParentTerragrunt *bool `yaml:"ignoreParentTerragrunt,omitempty"`
CreateParentProject bool `yaml:"createParentProject"`
IgnoreDependencyBlocks bool `yaml:"ignoreDependencyBlocks"`
IgnoreIncludeBlocks bool `yaml:"ignoreIncludeBlocks"`
TriggerProjectsFromDirOnly bool `yaml:"triggerProjectsFromDirOnly"`
Parallel *bool `yaml:"parallel,omitempty"`
CreateWorkspace bool `yaml:"createWorkspace"`
Expand Down

0 comments on commit 24badb0

Please sign in to comment.