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-07-06 18:29:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/terragrunt (Old) and /work/SRC/openSUSE:Factory/.terragrunt.new.23466 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "terragrunt" Thu Jul 6 18:29:35 2023 rev:55 rq:1097050 version:0.48.1 Changes: -------- --- /work/SRC/openSUSE:Factory/terragrunt/terragrunt.changes 2023-06-27 23:17:01.399517547 +0200 +++ /work/SRC/openSUSE:Factory/.terragrunt.new.23466/terragrunt.changes 2023-07-06 18:29:51.479574541 +0200 @@ -1,0 +2,9 @@ +Thu Jul 06 07:19:36 UTC 2023 - ka...@b1-systems.de + +- Update to version 0.48.1: + * Updated source version identification (#2630) + * Update documentation to reference Terragrunt Github action + (#2628) + * [skip ci] git-xargs programmatic commit (#2623) + +------------------------------------------------------------------- Old: ---- terragrunt-0.48.0.obscpio New: ---- terragrunt-0.48.1.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ terragrunt.spec ++++++ --- /var/tmp/diff_new_pack.zt6mP7/_old 2023-07-06 18:29:52.591581176 +0200 +++ /var/tmp/diff_new_pack.zt6mP7/_new 2023-07-06 18:29:52.595581200 +0200 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: terragrunt -Version: 0.48.0 +Version: 0.48.1 Release: 0 Summary: Thin wrapper for Terraform for working with multiple Terraform modules License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.zt6mP7/_old 2023-07-06 18:29:52.631581415 +0200 +++ /var/tmp/diff_new_pack.zt6mP7/_new 2023-07-06 18:29:52.635581439 +0200 @@ -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.48.0</param> + <param name="revision">v0.48.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.zt6mP7/_old 2023-07-06 18:29:52.655581558 +0200 +++ /var/tmp/diff_new_pack.zt6mP7/_new 2023-07-06 18:29:52.659581582 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/gruntwork-io/terragrunt</param> - <param name="changesrevision">4aa01e0d7efa44eb19a87fe36cf0e864d8fb08d0</param></service></servicedata> + <param name="changesrevision">4398100979680eb57dbcfd12703dcc4152ebaf3c</param></service></servicedata> (No newline at EOF) ++++++ terragrunt-0.48.0.obscpio -> terragrunt-0.48.1.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/CODEOWNERS new/terragrunt-0.48.1/CODEOWNERS --- old/terragrunt-0.48.0/CODEOWNERS 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/CODEOWNERS 2023-07-05 21:03:36.000000000 +0200 @@ -1 +1 @@ -* @zackproser @rhoboat @denis256 +* @rhoboat @denis256 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/cli/args.go new/terragrunt-0.48.1/cli/args.go --- old/terragrunt-0.48.0/cli/args.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/cli/args.go 2023-07-05 21:03:36.000000000 +0200 @@ -56,7 +56,7 @@ return nil, err } if downloadDirRaw == "" { - downloadDirRaw = util.JoinPath(workingDir, options.TerragruntCacheDir) + downloadDirRaw = util.JoinPath(workingDir, util.TerragruntCacheDir) } downloadDir, err := filepath.Abs(downloadDirRaw) if err != nil { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/cli/hclfmt.go new/terragrunt-0.48.1/cli/hclfmt.go --- old/terragrunt-0.48.0/cli/hclfmt.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/cli/hclfmt.go 2023-07-05 21:03:36.000000000 +0200 @@ -46,7 +46,7 @@ filteredTgHclFiles := []string{} for _, fname := range tgHclFiles { // Ignore any files that are in the .terragrunt-cache - if !util.ListContainsElement(strings.Split(fname, "/"), ".terragrunt-cache") { + if !util.ListContainsElement(strings.Split(fname, "/"), util.TerragruntCacheDir) { filteredTgHclFiles = append(filteredTgHclFiles, fname) } else { terragruntOptions.Logger.Debugf("%s was ignored due to being in the terragrunt cache", fname) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/cli/tfsource/types.go new/terragrunt-0.48.1/cli/tfsource/types.go --- old/terragrunt-0.48.0/cli/tfsource/types.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/cli/tfsource/types.go 2023-07-05 21:03:36.000000000 +0200 @@ -63,10 +63,17 @@ // We don't use any info from directories to calculate our hash return nil } + // avoid checking files in .terragrunt-cache directory since contents is auto-generated + if strings.Contains(path, util.TerragruntCacheDir) { + return nil + } + // avoid checking files in .terraform directory since contents is auto-generated + if info.Name() == util.TerraformLockFile { + return nil + } fileModified := info.ModTime().UnixMicro() hashContents := fmt.Sprintf("%s:%d", path, fileModified) - sourceHash.Write([]byte(hashContents)) return nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/config/config.go new/terragrunt-0.48.1/config/config.go --- old/terragrunt-0.48.0/config/config.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/config/config.go 2023-07-05 21:03:36.000000000 +0200 @@ -565,7 +565,7 @@ } // Skip the Terragrunt cache dir entirely - if info.IsDir() && info.Name() == options.TerragruntCacheDir { + if info.IsDir() && info.Name() == util.TerragruntCacheDir { return filepath.SkipDir } @@ -593,7 +593,7 @@ } // Skip the Terragrunt cache dir - if util.ContainsPath(path, options.TerragruntCacheDir) { + if util.ContainsPath(path, util.TerragruntCacheDir) { return false, nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/docs/_docs/01_getting-started/install.md new/terragrunt-0.48.1/docs/_docs/01_getting-started/install.md --- old/terragrunt-0.48.0/docs/_docs/01_getting-started/install.md 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/docs/_docs/01_getting-started/install.md 2023-07-05 21:03:36.000000000 +0200 @@ -31,3 +31,7 @@ * **Linux**: Most Linux users can use [Homebrew](https://docs.brew.sh/Homebrew-on-Linux): `brew install terragrunt`. Arch Linux users can use `pacman -S terragrunt` to install it [`community-terragrunt`](https://archlinux.org/packages/community/x86_64/terragrunt/). * **FreeBSD**: You can install Terragrunt on FreeBSD using [Pkg](https://www.freebsd.org/cgi/man.cgi?pkg(7)): `pkg install terragrunt`. + +### Terragrunt GitHub Action + +Terragrunt is also available as a GitHub Action. Instructions on how to use it can be found at [https://github.com/gruntwork-io/terragrunt-action](https://github.com/gruntwork-io/terragrunt-action). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/options/options.go new/terragrunt-0.48.1/options/options.go --- old/terragrunt-0.48.0/options/options.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/options/options.go 2023-07-05 21:03:36.000000000 +0200 @@ -28,8 +28,6 @@ // TERRAFORM_DEFAULT_PATH just takes terraform from the path const TERRAFORM_DEFAULT_PATH = "terraform" -const TerragruntCacheDir = ".terragrunt-cache" - const DefaultTFDataDir = ".terraform" const DefaultIAMAssumeRoleDuration = 3600 @@ -299,7 +297,7 @@ func DefaultWorkingAndDownloadDirs(terragruntConfigPath string) (string, string, error) { workingDir := filepath.Dir(terragruntConfigPath) - downloadDir, err := filepath.Abs(filepath.Join(workingDir, TerragruntCacheDir)) + downloadDir, err := filepath.Abs(filepath.Join(workingDir, util.TerragruntCacheDir)) if err != nil { return "", "", errors.WithStackTrace(err) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/test/fixture-init-cache/app/main.tf new/terragrunt-0.48.1/test/fixture-init-cache/app/main.tf --- old/terragrunt-0.48.0/test/fixture-init-cache/app/main.tf 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.48.1/test/fixture-init-cache/app/main.tf 2023-07-05 21:03:36.000000000 +0200 @@ -0,0 +1,5 @@ +variable "test" {} + +output "result" { + value = var.test +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/test/fixture-init-cache/app/terragrunt.hcl new/terragrunt-0.48.1/test/fixture-init-cache/app/terragrunt.hcl --- old/terragrunt-0.48.0/test/fixture-init-cache/app/terragrunt.hcl 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.48.1/test/fixture-init-cache/app/terragrunt.hcl 2023-07-05 21:03:36.000000000 +0200 @@ -0,0 +1,8 @@ +include "root" { + path = find_in_parent_folders() +} + +inputs = { + env = "nonprod" +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/test/fixture-init-cache/terragrunt.hcl new/terragrunt-0.48.1/test/fixture-init-cache/terragrunt.hcl --- old/terragrunt-0.48.0/test/fixture-init-cache/terragrunt.hcl 1970-01-01 01:00:00.000000000 +0100 +++ new/terragrunt-0.48.1/test/fixture-init-cache/terragrunt.hcl 2023-07-05 21:03:36.000000000 +0200 @@ -0,0 +1,20 @@ + +generate "provider" { + path = "provider.tf" + if_exists = "overwrite_terragrunt" + contents = <<EOF +provider "aws" { + region = "eu-central-1" +} +EOF +} + +terraform { + source = "." + extra_arguments "common_vars" { + commands = get_terraform_commands_that_need_vars() + arguments = [ + "-var", "test=qwe", + ] + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/test/integration_test.go new/terragrunt-0.48.1/test/integration_test.go --- old/terragrunt-0.48.0/test/integration_test.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/test/integration_test.go 2023-07-05 21:03:36.000000000 +0200 @@ -151,6 +151,7 @@ TEST_FIXTURE_REF_SOURCE = "fixture-download/remote-ref" TEST_FIXTURE_SOURCE_MAP_SLASHES = "fixture-source-map/slashes-in-ref" TEST_FIXTURE_STRCONTAINS = "fixture-strcontains" + TEST_FIXTURE_INIT_CACHE = "fixture-init-cache" TERRAFORM_BINARY = "terraform" TERRAFORM_FOLDER = ".terraform" TERRAFORM_STATE = "terraform.tfstate" @@ -5585,6 +5586,56 @@ validateOutput(t, outputs, "o2", false) } +func TestInitSkipCache(t *testing.T) { + t.Parallel() + + cleanupTerraformFolder(t, TEST_FIXTURE_INIT_CACHE) + tmpEnvPath := copyEnvironment(t, TEST_FIXTURE_INIT_CACHE) + rootPath := util.JoinPath(tmpEnvPath, TEST_FIXTURE_INIT_CACHE, "app") + + stdout := bytes.Buffer{} + stderr := bytes.Buffer{} + + require.NoError( + t, + runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-log-level debug --terragrunt-non-interactive --terragrunt-working-dir %s", rootPath), &stdout, &stderr), + ) + + // verify that init was invoked + assert.Contains(t, stdout.String(), "Terraform has been successfully initialized!") + assert.Contains(t, stderr.String(), "Running command: terraform init") + + stdout = bytes.Buffer{} + stderr = bytes.Buffer{} + + require.NoError( + t, + runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-log-level debug --terragrunt-non-interactive --terragrunt-working-dir %s", rootPath), &stdout, &stderr), + ) + + // verify that init wasn't invoked second time since cache directories are ignored + assert.NotContains(t, stdout.String(), "Terraform has been successfully initialized!") + assert.NotContains(t, stderr.String(), "Running command: terraform init") + + // verify that after adding new file, init is executed + tfFile := util.JoinPath(tmpEnvPath, TEST_FIXTURE_INIT_CACHE, "app", "project.tf") + if err := ioutil.WriteFile(tfFile, []byte(""), 0644); err != nil { + t.Fatalf("Error writing new Terraform file to %s: %v", tfFile, err) + } + + stdout = bytes.Buffer{} + stderr = bytes.Buffer{} + + require.NoError( + t, + runTerragruntCommand(t, fmt.Sprintf("terragrunt plan --terragrunt-log-level debug --terragrunt-non-interactive --terragrunt-working-dir %s", rootPath), &stdout, &stderr), + ) + + // verify that init was invoked + assert.Contains(t, stdout.String(), "Terraform has been successfully initialized!") + assert.Contains(t, stderr.String(), "Running command: terraform init") +} + func validateOutput(t *testing.T, outputs map[string]TerraformOutput, key string, value interface{}) { t.Helper() output, hasPlatform := outputs[key] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/terragrunt-0.48.0/util/file.go new/terragrunt-0.48.1/util/file.go --- old/terragrunt-0.48.0/util/file.go 2023-06-26 19:12:26.000000000 +0200 +++ new/terragrunt-0.48.1/util/file.go 2023-07-05 21:03:36.000000000 +0200 @@ -21,6 +21,8 @@ const TerraformLockFile = ".terraform.lock.hcl" +const TerragruntCacheDir = ".terragrunt-cache" + // FileOrData will read the contents of the data of the given arg if it is a file, and otherwise return the contents by // itself. This will return an error if the given path is a directory. func FileOrData(maybePath string) (string, error) { @@ -191,7 +193,7 @@ return nil, errors.WithStackTrace(err) } for _, absoluteExpandGlobPath := range absoluteExpandGlob { - if strings.Contains(absoluteExpandGlobPath, ".terragrunt-cache") { + if strings.Contains(absoluteExpandGlobPath, TerragruntCacheDir) { continue } relativeExpandGlobPath, err := GetPathRelativeTo(absoluteExpandGlobPath, source) ++++++ terragrunt.obsinfo ++++++ --- /var/tmp/diff_new_pack.zt6mP7/_old 2023-07-06 18:29:53.335585616 +0200 +++ /var/tmp/diff_new_pack.zt6mP7/_new 2023-07-06 18:29:53.339585639 +0200 @@ -1,5 +1,5 @@ name: terragrunt -version: 0.48.0 -mtime: 1687799546 -commit: 4aa01e0d7efa44eb19a87fe36cf0e864d8fb08d0 +version: 0.48.1 +mtime: 1688583816 +commit: 4398100979680eb57dbcfd12703dcc4152ebaf3c ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/terragrunt/vendor.tar.gz /work/SRC/openSUSE:Factory/.terragrunt.new.23466/vendor.tar.gz differ: char 5, line 1