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

Fix(create/all-terraform): Add in Name/Description in new stacks. #1117

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ Given a version number `MAJOR.MINOR.PATCH`, we increment the:

- Add support for globs in the `import.source` attribute to import multiple files at once.
- Add support for listing *unhealthy* stacks with `terramate list --experimental-status=unhealthy`.
- Add support for triggering *unhealthy* stacks with `terramate experimental trigger --experimental-status=unhealthy`.
- Add support for triggering *unhealthy* stacks with `terramate experimental trigger --experimental-status=unhealthy`.


### Fixed

- Allow to specify multiple tags separated by comma when using `terramate create --tags` command.
- Fixed inconsistent behaviour in `terramate create` vs. `terramate create --all-terraform`, both now populate the name/description fields the same way.

## 0.4.0

Expand Down
27 changes: 10 additions & 17 deletions cmd/terramate/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,10 @@

Metadata struct{} `cmd:"" help:"Shows metadata available on the project"`

Globals struct {
} `cmd:"" help:"List globals for all stacks"`
Globals struct{} `cmd:"" help:"List globals for all stacks"`

Generate struct {
Debug struct {
} `cmd:"" help:"Shows generate debug information"`
Debug struct{} `cmd:"" help:"Shows generate debug information"`
} `cmd:"" help:"Experimental generate commands"`

RunGraph struct {
Expand All @@ -176,8 +174,7 @@
Basedir string `arg:"" optional:"true" help:"Base directory to search stacks"`
} `cmd:"" help:"Show the topological ordering of the stacks"`

RunEnv struct {
} `cmd:"" help:"List run environment variables for all stacks"`
RunEnv struct{} `cmd:"" help:"List run environment variables for all stacks"`

Vendor struct {
Download struct {
Expand Down Expand Up @@ -205,10 +202,8 @@
} `cmd:"" help:"Get configuration value"`

Cloud struct {
Login struct {
} `cmd:"" help:"login for cloud.terramate.io"`
Info struct {
} `cmd:"" help:"cloud information status"`
Login struct{} `cmd:"" help:"login for cloud.terramate.io"`
Info struct{} `cmd:"" help:"cloud information status"`
} `cmd:"" help:"Terramate Cloud commands"`
} `cmd:"" help:"Experimental features (may change or be removed in the future)"`
}
Expand Down Expand Up @@ -285,7 +280,6 @@
}),
kong.Writers(stdout, stderr),
)

if err != nil {
fatal(err, "creating cli parser")
}
Expand Down Expand Up @@ -1141,12 +1135,15 @@

stackDir := baseDir
stackID, err := uuid.NewRandom()
dirBasename := filepath.Base(stackDir)

Check warning on line 1138 in cmd/terramate/cli/cli.go

View check run for this annotation

Codecov / codecov/patch

cmd/terramate/cli/cli.go#L1138

Added line #L1138 was not covered by tests
if err != nil {
fatal(err, "creating stack UUID")
}
stackSpec := config.Stack{
Dir: prj.PrjAbsPath(c.rootdir(), stackDir),
ID: stackID.String(),
Dir: prj.PrjAbsPath(c.rootdir(), stackDir),
ID: stackID.String(),
Name: dirBasename,
Description: dirBasename,

Check warning on line 1146 in cmd/terramate/cli/cli.go

View check run for this annotation

Codecov / codecov/patch

cmd/terramate/cli/cli.go#L1143-L1146

Added lines #L1143 - L1146 were not covered by tests
}

err = stack.Create(c.cfg(), stackSpec)
Expand Down Expand Up @@ -1866,7 +1863,6 @@
logger.Trace().Msg("checking if any stack has outdated code")

outdatedFiles, err := generate.DetectOutdated(c.cfg(), c.vendorDir())

if err != nil {
fatal(err, "failed to check outdated code on project")
}
Expand Down Expand Up @@ -2153,7 +2149,6 @@
CacheFile: cacheFile,
},
)

if err != nil {
logger.Debug().Msgf("checkpoint error: %v", err)
resp = nil
Expand Down Expand Up @@ -2224,7 +2219,6 @@
WorkingDir: basedir,
Env: os.Environ(),
})

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -2304,7 +2298,6 @@
prj.rootdir = rootCfgPath
prj.root = *rootcfg
return prj, true, nil

}

func configureLogging(logLevel, logFmt, logdest string, stdout, stderr io.Writer) {
Expand Down
Loading