Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package terragrunt for openSUSE:Factory checked in at 2023-02-23 16:28:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/terragrunt (Old) and /work/SRC/openSUSE:Factory/.terragrunt.new.1706 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "terragrunt" Thu Feb 23 16:28:59 2023 rev:29 rq:1067392 version:0.44.0 Changes: -------- --- /work/SRC/openSUSE:Factory/terragrunt/terragrunt.changes 2023-02-05 19:20:25.343633134 +0100 +++ /work/SRC/openSUSE:Factory/.terragrunt.new.1706/terragrunt.changes 2023-02-23 16:53:06.521032276 +0100 @@ -1,0 +2,13 @@ +Thu Feb 23 10:37:55 UTC 2023 - ka...@b1-systems.de + +- Update to version 0.44.0: + * isRetryable also checks the stdout (#2464) + +------------------------------------------------------------------- +Wed Feb 22 17:26:34 UTC 2023 - ka...@b1-systems.de + +- Update to version 0.43.3: + * #2450 Improved loading of TFLint configuration (#2456) + * #2417 Add handling of intermittent errors in fixture-stack tests (#2439) + +------------------------------------------------------------------- Old: ---- terragrunt-0.43.2.tar.gz New: ---- terragrunt-0.44.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ terragrunt.spec ++++++ --- /var/tmp/diff_new_pack.UNW1Fy/_old 2023-02-23 16:53:07.365037170 +0100 +++ /var/tmp/diff_new_pack.UNW1Fy/_new 2023-02-23 16:53:07.373037216 +0100 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: terragrunt -Version: 0.43.2 +Version: 0.44.0 Release: 0 Summary: Thin wrapper for Terraform for working with multiple Terraform modules License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.UNW1Fy/_old 2023-02-23 16:53:07.405037402 +0100 +++ /var/tmp/diff_new_pack.UNW1Fy/_new 2023-02-23 16:53:07.405037402 +0100 @@ -3,7 +3,7 @@ <param name="url">https://github.com/gruntwork-io/terragrunt</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v0.43.2</param> + <param name="revision">v0.44.0</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> @@ -16,7 +16,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">terragrunt-0.43.2.tar.gz</param> + <param name="archive">terragrunt-0.44.0.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.UNW1Fy/_old 2023-02-23 16:53:07.425037518 +0100 +++ /var/tmp/diff_new_pack.UNW1Fy/_new 2023-02-23 16:53:07.429037541 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/gruntwork-io/terragrunt</param> - <param name="changesrevision">0966273d41466b5ec4220f35e8e6cafdb5a581a1</param></service></servicedata> + <param name="changesrevision">21acbcfc9bb461577bd44d98ea8866aa7536d574</param></service></servicedata> (No newline at EOF) ++++++ terragrunt-0.43.2.tar.gz -> terragrunt-0.44.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/.circleci/config.yml new/terragrunt-0.44.0/.circleci/config.yml --- old/terragrunt-0.43.2/.circleci/config.yml 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/.circleci/config.yml 2023-02-22 21:23:37.000000000 +0100 @@ -23,6 +23,10 @@ shell: powershell.exe command: ./_ci/install-terraform.ps1 - run: + name: Install TFLint + shell: powershell.exe + command: ./_ci/install-tflint.ps1 + - run: name: Run go tests shell: powershell.exe no_output_timeout: 45m @@ -30,6 +34,7 @@ # We're running this test only on Windows currently to provide a convenient # means of reproducing Terragrunt issues that only occur on that platform go test -v ./... -run TestWindowsTerragruntSourceMapDebug -timeout 45m + go test -v ./... -run TestWindowsTflintIsInvoked -timeout 45m # We're running unit tests separately from integration tests - with no parallelization. # With heavy parallelization coupled with re-use of test fixtures we've witnessed slight # instability with the tests. The unit tests are fast to execute, so there is negligible diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/_ci/install-tflint.ps1 new/terragrunt-0.44.0/_ci/install-tflint.ps1 --- old/terragrunt-0.43.2/_ci/install-tflint.ps1 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.44.0/_ci/install-tflint.ps1 2023-02-22 21:23:37.000000000 +0100 @@ -0,0 +1,5 @@ +# Install tflint using Chocolatey +choco install tflint --version 0.42.2 -y +# Verify installation +Get-Command tflint +tflint --version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/cli/cli_app.go new/terragrunt-0.44.0/cli/cli_app.go --- old/terragrunt-0.43.2/cli/cli_app.go 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/cli/cli_app.go 2023-02-22 21:23:37.000000000 +0100 @@ -926,7 +926,7 @@ // Retry the command configurable time with sleep in between for i := 0; i < terragruntOptions.RetryMaxAttempts; i++ { if out, tferr := shell.RunTerraformCommandWithOutput(terragruntOptions, terragruntOptions.TerraformCliArgs...); tferr != nil { - if out != nil && isRetryable(out.Stderr, tferr, terragruntOptions) { + if out != nil && isRetryable(out.Stdout, out.Stderr, tferr, terragruntOptions) { terragruntOptions.Logger.Infof("Encountered an error eligible for retrying. Sleeping %v before retrying.\n", terragruntOptions.RetrySleepIntervalSec) time.Sleep(terragruntOptions.RetrySleepIntervalSec) } else { @@ -1203,12 +1203,13 @@ return nil } -// isRetryable checks whether there was an error and we should attempt again -func isRetryable(tfoutput string, tferr error, terragruntOptions *options.TerragruntOptions) bool { +// isRetryable checks whether there was an error and if the output matches any of the configured RetryableErrors +func isRetryable(stdout string, stderr string, tferr error, terragruntOptions *options.TerragruntOptions) bool { if !terragruntOptions.AutoRetry || tferr == nil { return false } - return util.MatchesAny(terragruntOptions.RetryableErrors, tfoutput) + // When -json is enabled, Terraform will send all output, errors included, to stdout. + return util.MatchesAny(terragruntOptions.RetryableErrors, stderr) || util.MatchesAny(terragruntOptions.RetryableErrors, stdout) } // Custom error types diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/cli/cli_app_test.go new/terragrunt-0.44.0/cli/cli_app_test.go --- old/terragrunt-0.43.2/cli/cli_app_test.go 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/cli/cli_app_test.go 2023-02-22 21:23:37.000000000 +0100 @@ -5,9 +5,9 @@ "path/filepath" "testing" - "github.com/gruntwork-io/terragrunt/errors" - + goerrors "github.com/go-errors/errors" "github.com/gruntwork-io/terragrunt/config" + "github.com/gruntwork-io/terragrunt/errors" "github.com/gruntwork-io/terragrunt/options" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -128,6 +128,118 @@ } } +func TestErrorRetryableOnStdoutError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{".*error.*"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("error is here", "", errors.WithStackTrace(goerrors.New("dummy error")), tgOptions) + require.True(t, retryable, "The error should have retried") +} + +func TestErrorMultipleRetryableOnStderrError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{"no match", ".*error.*"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("", "error is here", errors.WithStackTrace(goerrors.New("dummy error")), tgOptions) + require.True(t, retryable, "The error should have retried") +} + +func TestEmptyRetryablesOnStderrError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("", "error is here", errors.WithStackTrace(goerrors.New("dummy error")), tgOptions) + require.False(t, retryable, "The error should not have retried, the list of retryable errors was empty") +} + +func TestErrorRetryableOnStderrError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{".*error.*"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("", "error is here", errors.WithStackTrace(goerrors.New("dummy error")), tgOptions) + require.True(t, retryable, "The error should have retried") +} + +func TestErrorNotRetryableOnStdoutError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{"not the error"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("error is here", "", errors.WithStackTrace(goerrors.New("dummy error")), tgOptions) + require.False(t, retryable, "The error should not retry") +} + +func TestErrorNotRetryableOnStderrError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{"not the error"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("", "error is here", errors.WithStackTrace(goerrors.New("dummy error")), tgOptions) + require.False(t, retryable, "The error should not retry") +} + +func TestErrorNotRetryableOnStderrWithoutError(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{".*"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = true + + retryable := isRetryable("", "error is here", nil, tgOptions) + require.False(t, retryable, "The error should not retry") +} + +func TestAutoRetryFalseDisablesRetry(t *testing.T) { + t.Parallel() + + tgOptions, err := options.NewTerragruntOptionsForTest("") + require.NoError(t, err) + + retryableErrors := []string{".*"} + tgOptions.RetryableErrors = retryableErrors + tgOptions.AutoRetry = false + + retryable := isRetryable("", "error is here", nil, tgOptions) + require.False(t, retryable, "The error should not retry") +} + func TestTerragruntHandlesCatastrophicTerraformFailure(t *testing.T) { t.Parallel() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/fixture-stack/terragrunt.hcl new/terragrunt-0.44.0/test/fixture-stack/terragrunt.hcl --- old/terragrunt-0.43.2/test/fixture-stack/terragrunt.hcl 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/test/fixture-stack/terragrunt.hcl 2023-02-22 21:23:37.000000000 +0100 @@ -15,3 +15,7 @@ inputs = { terraform_remote_state_s3_bucket = "__FILL_IN_BUCKET_NAME__" } + +retryable_errors = [ + "(?s).*A conflicting conditional operation is currently in progress against this resource. Please try again.*" +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/.tflint.hcl new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/.tflint.hcl --- old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/.tflint.hcl 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/.tflint.hcl 2023-02-22 21:23:37.000000000 +0100 @@ -0,0 +1,7 @@ +plugin "terraform" { + enabled = true + version = "0.2.1" + source = "github.com/terraform-linters/tflint-ruleset-terraform" +} + +config { format = "compact" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/main.tf new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/main.tf --- old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/main.tf 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/main.tf 2023-02-22 21:23:37.000000000 +0100 @@ -0,0 +1,13 @@ +terraform { + required_providers { + random = { + version = ">= 3.4.0" + } + } + + required_version = ">= 1.2.7" +} + +resource "random_id" "env" { + byte_length = 8 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/outputs.tf new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/outputs.tf --- old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/outputs.tf 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/outputs.tf 2023-02-22 21:23:37.000000000 +0100 @@ -0,0 +1 @@ +# Empty outputs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/terragrunt.hcl new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/terragrunt.hcl --- old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/terragrunt.hcl 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/terragrunt.hcl 2023-02-22 21:23:37.000000000 +0100 @@ -0,0 +1,12 @@ +terraform { + + before_hook "tflint" { + commands = ["apply", "plan"] + execute = ["tflint"] + } +} + +inputs = { + aws_region = "us-west-2" + env = "dev" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/variables.tf new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/variables.tf --- old/terragrunt-0.43.2/test/fixture-tflint/no-tf-source/variables.tf 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.44.0/test/fixture-tflint/no-tf-source/variables.tf 2023-02-22 21:23:37.000000000 +0100 @@ -0,0 +1 @@ +# Empty variables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/integration_test.go new/terragrunt-0.44.0/test/integration_test.go --- old/terragrunt-0.43.2/test/integration_test.go 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/test/integration_test.go 2023-02-22 21:23:37.000000000 +0100 @@ -137,6 +137,7 @@ TEST_FIXTURE_TFLINT_ISSUES_FOUND = "fixture-tflint/issues-found" TEST_FIXTURE_TFLINT_NO_CONFIG_FILE = "fixture-tflint/no-config-file" TEST_FIXTURE_TFLINT_MODULE_FOUND = "fixture-tflint/module-found" + TEST_FIXTURE_TFLINT_NO_TF_SOURCE_PATH = "fixture-tflint/no-tf-source" TERRAFORM_BINARY = "terraform" TERRAFORM_FOLDER = ".terraform" TERRAFORM_STATE = "terraform.tfstate" @@ -5238,11 +5239,13 @@ errOut := new(bytes.Buffer) rootPath := copyEnvironmentWithTflint(t, TEST_FIXTURE_TFLINT_NO_ISSUES_FOUND) modulePath := util.JoinPath(rootPath, TEST_FIXTURE_TFLINT_NO_ISSUES_FOUND) - err := runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-working-dir %s", modulePath), out, errOut) + err := runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-log-level debug --terragrunt-working-dir %s", modulePath), out, errOut) assert.NoError(t, err) assert.NotContains(t, errOut.String(), "Error while running tflint with args:") assert.NotContains(t, errOut.String(), "Tflint found issues in the project. Check for the tflint logs above.") + + assert.Contains(t, errOut.String(), fmt.Sprintf("--config %s/.tflint.hcl", modulePath)) } func TestTflintFindsModule(t *testing.T) { @@ -5272,3 +5275,15 @@ err := runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-working-dir %s", modulePath), io.Discard, errOut) assert.Error(t, err, "Could not find .tflint.hcl config file in the parent folders:") } + +func TestTflintFindsConfigInCurrentPath(t *testing.T) { + out := new(bytes.Buffer) + errOut := new(bytes.Buffer) + rootPath := copyEnvironmentWithTflint(t, TEST_FIXTURE_TFLINT_NO_TF_SOURCE_PATH) + modulePath := util.JoinPath(rootPath, TEST_FIXTURE_TFLINT_NO_TF_SOURCE_PATH) + err := runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-log-level debug --terragrunt-working-dir %s", modulePath), out, errOut) + assert.NoError(t, err) + + assert.Contains(t, errOut.String(), "Tflint has run successfully. No issues found") + assert.Contains(t, errOut.String(), fmt.Sprintf("--config %s/.tflint.hcl", modulePath)) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/test/integration_windows_test.go new/terragrunt-0.44.0/test/integration_windows_test.go --- old/terragrunt-0.43.2/test/integration_windows_test.go 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/test/integration_windows_test.go 2023-02-22 21:23:37.000000000 +0100 @@ -4,11 +4,15 @@ package test import ( + "bytes" "fmt" "os" "path/filepath" "strings" "testing" + + "github.com/gruntwork-io/terragrunt/util" + "github.com/stretchr/testify/assert" ) const ( @@ -64,3 +68,17 @@ }) } } + +func TestWindowsTflintIsInvoked(t *testing.T) { + out := new(bytes.Buffer) + errOut := new(bytes.Buffer) + rootPath := copyEnvironmentWithTflint(t, TEST_FIXTURE_TFLINT_NO_ISSUES_FOUND) + modulePath := util.JoinPath(rootPath, TEST_FIXTURE_TFLINT_NO_ISSUES_FOUND) + err := runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-log-level debug --terragrunt-working-dir %s", modulePath), out, errOut) + assert.NoError(t, err) + + assert.NotContains(t, errOut.String(), "Error while running tflint with args:") + assert.NotContains(t, errOut.String(), "Tflint found issues in the project. Check for the tflint logs above.") + + assert.Contains(t, errOut.String(), fmt.Sprintf("--config %s/.tflint.hcl", modulePath)) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.43.2/tflint/tflint.go new/terragrunt-0.44.0/tflint/tflint.go --- old/terragrunt-0.43.2/tflint/tflint.go 2023-02-02 22:04:34.000000000 +0100 +++ new/terragrunt-0.44.0/tflint/tflint.go 2023-02-22 21:23:37.000000000 +0100 @@ -88,7 +88,7 @@ return "", errors.WithStackTrace(ConfigNotFound{cause: "Traversed all the day to the root"}) } - fileToFind := util.JoinPath(currentDir, ".tflint.hcl") + fileToFind := util.JoinPath(previousDir, ".tflint.hcl") if util.FileExists(fileToFind) { terragruntOptions.Logger.Debugf("Found .tflint.hcl in %s", fileToFind) return fileToFind, nil ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/terragrunt/vendor.tar.gz /work/SRC/openSUSE:Factory/.terragrunt.new.1706/vendor.tar.gz differ: char 5, line 1