Skip to content

Commit

Permalink
Update dependencies (#714)
Browse files Browse the repository at this point in the history
Also, fix some typos according to cspell
Freeze terraform version by using Coveo fork instead of using the official Hashicorp version.  This avoid Renovate breaks the build by updating terraform dependencies and fix go get by telling him to use our fork instead of the upstream while discovering new versions.
  • Loading branch information
jocgir committed Oct 9, 2024
1 parent f1d7446 commit 1b6189b
Show file tree
Hide file tree
Showing 21 changed files with 190 additions and 105 deletions.
84 changes: 84 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"ignoreWords": [
"alecthomas",
"awshelper",
"backends",
"cheekybits",
"codecov",
"configstack",
"coveooss",
"debugf",
"doesnt",
"dont",
"eipalloc",
"envv",
"envvars",
"errwriter",
"exitcode",
"exiter",
"extensioner",
"fatih",
"funcs",
"genny",
"getter's",
"gocty",
"goerrors",
"gohcl",
"gotemplate",
"gruntwork",
"gthcl",
"hacky",
"hclparse",
"hclwrite",
"infof",
"infoln",
"inode",
"jondoe",
"jsonencode",
"kief",
"ldflags",
"logname",
"logrus",
"mapstructure",
"marshallable",
"matryer",
"mgmt",
"mitchellh",
"multilogger",
"mycompany",
"mysql",
"nilf",
"noconfig",
"novendor",
"preboot",
"prepended",
"reutils",
"sirupsen",
"stretchr",
"stscreds",
"subdir",
"subfolder",
"subfolders",
"templatestring",
"terragrunt",
"testmap",
"tfconfig",
"tflang",
"tfpath",
"tfstate",
"tfvars",
"tgerrors",
"tracef",
"undeploy",
"untaint",
"urfave",
"urlhelper",
"vals",
"varfile",
"warningf",
"whitespaces",
"zclconf"
],
"words": [],
"language": "en,en-US,en-GB"
}
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: ["1.3.8"]
terraform: ["1.9.7"]
steps:
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion cli/get_stack_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func getStack(terragruntOptions *options.TerragruntOptions) (err error) {
modules configstack.SimpleTerraformModules
)

run := app.Flag("run", "Run the full stack to get the result instead of just analysing the dependencies").Short('r').Bool()
run := app.Flag("run", "Run the full stack to get the result instead of just analyzing the dependencies").Short('r').Bool()
output := app.Flag("output", "Specify format of the output (hcl, json, yaml)").Short('o').Enum("h", "hcl", "H", "HCL", "j", "json", "J", "JSON", "y", "yml", "yaml", "Y", "YML", "YAML")
app.Flag("absolute", "Output absolute path (--abs)").Short('a').BoolVar(&absolute)
app.Flag("abs", "").Hidden().BoolVar(&absolute)
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (conf *TerragruntConfig) loadBootConfigs(terragruntOptions *options.Terragr
if bootstrapFile != "" {
bootstrapDir := path.Dir(bootstrapFile)
if strings.HasPrefix(bootstrapDir, "s3:/") {
// The path.Dir removes the double slash, so s3:// is not longer interpretated correctly
// The path.Dir removes the double slash, so s3:// is not longer interpreted correctly
bootstrapDir = strings.Replace(bootstrapDir, "s3:/", "s3://", -1)
}

Expand Down
2 changes: 1 addition & 1 deletion config/extension_base_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (list GenericItemList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *GenericItemList) merge(imported GenericItemList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
2 changes: 1 addition & 1 deletion config/generated_approval_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (list ApprovalConfigList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *ApprovalConfigList) merge(imported ApprovalConfigList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
2 changes: 1 addition & 1 deletion config/generated_extra_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (list TerraformExtraArgumentsList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *TerraformExtraArgumentsList) merge(imported TerraformExtraArgumentsList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
2 changes: 1 addition & 1 deletion config/generated_extra_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (list ExtraCommandList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *ExtraCommandList) merge(imported ExtraCommandList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
2 changes: 1 addition & 1 deletion config/generated_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (list HookList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *HookList) merge(imported HookList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
2 changes: 1 addition & 1 deletion config/generated_import_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (list ImportFilesList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *ImportFilesList) merge(imported ImportFilesList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
2 changes: 1 addition & 1 deletion config/generated_import_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (list ImportVariablesList) baseInit(config *TerragruntConfigFile) {
}
}

// Merge elements from an imported list to the current list priorising those already existing
// Merge elements from an imported list to the current list prioritizing those already existing
func (list *ImportVariablesList) merge(imported ImportVariablesList, mode mergeMode, argName string) {
if len(imported) == 0 {
return
Expand Down
12 changes: 6 additions & 6 deletions configstack/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ func ResolveTerraformModules(terragruntConfigPaths []string, terragruntOptions *
if err != nil {
return []*TerraformModule{}, err
}
return crosslinkDependencies(mergeMaps(modules, externalDependencies), canonicalTerragruntConfigPaths)
return crossLinkDependencies(mergeMaps(modules, externalDependencies), canonicalTerragruntConfigPaths)
}

// Go through each of the given Terragrunt configuration files and resolve the module that configuration file represents
// into a TerraformModule struct. Note that this method will NOT fill in the Dependencies field of the TerraformModule
// struct (see the crosslinkDependencies method for that). Return a map from module path to TerraformModule struct.
// struct (see the crossLinkDependencies method for that). Return a map from module path to TerraformModule struct.
//
// resolveExternal is used to exclude modules that don't contain terraform files. This is used to avoid requirements of
// adding terragrunt.ignore when a parent folder doesn't have terraform files to deploy by itself.
Expand All @@ -126,7 +126,7 @@ func resolveModules(canonicalTerragruntConfigPaths []string, terragruntOptions *

// Create a TerraformModule struct for the Terraform module specified by the given Terragrunt configuration file path.
// Note that this method will NOT fill in the Dependencies field of the TerraformModule struct (see the
// crosslinkDependencies method for that).
// crossLinkDependencies method for that).
func resolveTerraformModule(terragruntConfigPath string, terragruntOptions *options.TerragruntOptions) (module *TerraformModule, tfFiles bool, err error) {
modulePath, err := util.CanonicalPath(filepath.Dir(terragruntConfigPath), ".")
if err != nil {
Expand Down Expand Up @@ -168,7 +168,7 @@ func resolveTerraformModule(terragruntConfigPath string, terragruntOptions *opti
// These external dependencies are outside of the current working directory, which means they may not be part of the
// environment the user is trying to apply-all or destroy-all. Therefore, this method also confirms whether the user wants
// to actually apply those dependencies or just assume they are already applied. Note that this method will NOT fill in
// the Dependencies field of the TerraformModule struct (see the crosslinkDependencies method for that).
// the Dependencies field of the TerraformModule struct (see the crossLinkDependencies method for that).
func resolveExternalDependenciesForModules(canonicalTerragruntConfigPaths []string, moduleMap map[string]*TerraformModule, terragruntOptions *options.TerragruntOptions) (map[string]*TerraformModule, error) {
allExternalDependencies := map[string]*TerraformModule{}

Expand Down Expand Up @@ -218,7 +218,7 @@ func resolveExternalDependenciesForModules(canonicalTerragruntConfigPaths []stri
// config (i.e. those dependencies not in the given list of Terragrunt config canonical file paths). These external
// dependencies are outside of the current working directory, which means they may not be part of the environment the
// user is trying to apply-all or destroy-all. Note that this method will NOT fill in the Dependencies field of the
// TerraformModule struct (see the crosslinkDependencies method for that).
// TerraformModule struct (see the crossLinkDependencies method for that).
func resolveExternalDependenciesForModule(module *TerraformModule, canonicalTerragruntConfigPaths []string, terragruntOptions *options.TerragruntOptions) (result map[string]*TerraformModule, err error) {
result = make(map[string]*TerraformModule)
if module.Config.Dependencies == nil || len(module.Config.Dependencies.Paths) == 0 {
Expand Down Expand Up @@ -276,7 +276,7 @@ func mergeMaps(modules map[string]*TerraformModule, externalDependencies map[str

// Go through each module in the given map and cross-link its dependencies to the other modules in that same map. If
// a dependency is referenced that is not in the given map, return an error.
func crosslinkDependencies(moduleMap map[string]*TerraformModule, canonicalTerragruntConfigPaths []string) ([]*TerraformModule, error) {
func crossLinkDependencies(moduleMap map[string]*TerraformModule, canonicalTerragruntConfigPaths []string) ([]*TerraformModule, error) {
modules := []*TerraformModule{}

for _, module := range moduleMap {
Expand Down
6 changes: 3 additions & 3 deletions configstack/running_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const (
// ModuleHandler is a function prototype to inject interaction during the processing.
// The function receive the current module, its output and its error in parameter.
// Normally, the handler should return the same error as received in parameter, but it is possible to
// alter the normal course of the proccess by changing the error result.
// alter the normal course of the process by changing the error result.
type ModuleHandler func(TerraformModule, string, error) (string, error)

// Create a new RunningModule struct for the given module. This will initialize all fields to reasonable defaults,
Expand Down Expand Up @@ -156,15 +156,15 @@ func toRunningModules(modules []*TerraformModule, dependencyOrder dependencyOrde
runningModules[module.Path] = newRunningModule(module, &mutex)
}

return crossLinkDependencies(runningModules, dependencyOrder)
return crossLinkRunningModulesDependencies(runningModules, dependencyOrder)
}

// Loop through the map of runningModules and for each module M:
//
// - If dependencyOrder is NormalOrder, plug in all the modules M depends on into the Dependencies field and all the
// modules that depend on M into the NotifyWhenDone field.
// - If dependencyOrder is ReverseOrder, do the reverse.
func crossLinkDependencies(modules map[string]*runningModule, dependencyOrder dependencyOrder) (map[string]*runningModule, error) {
func crossLinkRunningModulesDependencies(modules map[string]*runningModule, dependencyOrder dependencyOrder) (map[string]*runningModule, error) {
for _, module := range modules {
for _, dependency := range module.Module.Dependencies {
runningDependency, hasDependency := modules[dependency.Path]
Expand Down
2 changes: 1 addition & 1 deletion configstack/stack_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func getResultHandler(detailedExitCode bool, results *[]moduleResult, hasChanges
if exitCode, convErr := shell.GetExitCode(err); convErr == nil && detailedExitCode && exitCode == tgerrors.ChangeExitCode {
// We do not want to consider ChangeExitCode as an error and not execute the dependants because there is an "error" in the dependencies.
// ChangeExitCode is not an error in this case, it is simply a status. We will reintroduce the exit code at the very end to mimic the behaviour
// of the native terrafrom plan -detailed-exitcode to exit with ChangeExitCode if there are changes in any of the module in the stack.
// of the native terraform plan -detailed-exitcode to exit with ChangeExitCode if there are changes in any of the module in the stack.
*hasChanges = true
err = nil
}
Expand Down
53 changes: 27 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ go 1.23

require (
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/aws/aws-sdk-go-v2 v1.32.1
github.com/aws/aws-sdk-go-v2/config v1.27.42
github.com/aws/aws-sdk-go-v2/credentials v1.17.40
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.1
github.com/aws/aws-sdk-go-v2/service/s3 v1.65.1
github.com/aws/aws-sdk-go-v2/service/ssm v1.55.1
github.com/aws/aws-sdk-go-v2/service/sts v1.32.1
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.27.43
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.65.2
github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2
github.com/cheekybits/genny v1.0.0
github.com/coveooss/gotemplate/v3 v3.9.1
github.com/coveooss/gotemplate/v3 v3.9.2
github.com/coveooss/multilogger v0.6.0
github.com/fatih/color v1.17.0
github.com/go-errors/errors v1.5.1
github.com/hashicorp/go-getter v1.7.6
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/hcl/v2 v2.22.0
github.com/hashicorp/terraform v0.15.3 // Terraform must be pinned to a specific version to avoid breaking changes
github.com/hashicorp/terraform v1.9.7
github.com/hashicorp/terraform-config-inspect v0.0.0-20240801114854-6714b46f5fe4
github.com/mitchellh/mapstructure v1.5.0
github.com/rs/xid v1.6.0
Expand All @@ -33,8 +33,8 @@ require (

require (
cel.dev/expr v0.16.2 // indirect
cloud.google.com/go v0.115.1 // indirect
cloud.google.com/go/auth v0.9.7 // indirect
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.9.8 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
cloud.google.com/go/iam v1.2.1 // indirect
Expand All @@ -58,18 +58,18 @@ require (
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.20 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.20 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.20 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect
github.com/aws/smithy-go v1.22.0 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bmatcuk/doublestar v1.3.4 // indirect
Expand Down Expand Up @@ -141,12 +141,12 @@ require (
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/api v0.199.0 // indirect
google.golang.org/genproto v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/genproto v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/grpc/stats/opentelemetry v0.0.0-20241004113128-859602c14c6c // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/grpc/stats/opentelemetry v0.0.0-20241009093917-b8ee37db62be // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
Expand All @@ -155,4 +155,5 @@ require (
replace (
github.com/hashicorp/go-getter => github.com/coveord/go-getter v1.7.105
github.com/hashicorp/hcl/v2 => github.com/coveord/hcl/v2 v2.8.102
github.com/hashicorp/terraform => github.com/coveooss/terraform v0.15.3 // Terraform must be pinned to a specific version to avoid breaking changes
)
Loading

0 comments on commit 1b6189b

Please sign in to comment.