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

Stacks: run #3762

Merged
merged 22 commits into from
Jan 16, 2025
Merged

Stacks: run #3762

merged 22 commits into from
Jan 16, 2025

Conversation

denis256
Copy link
Member

@denis256 denis256 commented Jan 13, 2025

Description

Included changes:

  • added support for stack run * command
  • execution of generate before run
  • added end to end tests to track stack run functionality

RFC: #3313

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

@denis256 denis256 changed the title WIP: Stack run WIP: Stacks: run Jan 13, 2025
@denis256 denis256 changed the title WIP: Stacks: run Stacks: run Jan 16, 2025
@denis256 denis256 marked this pull request as ready for review January 16, 2025 16:34
func generateStack(ctx context.Context, opts *options.TerragruntOptions) error {
opts.TerragruntStackConfigPath = filepath.Join(opts.WorkingDir, defaultStackFile)
opts.Logger.Infof("Generating stack from %s", opts.TerragruntStackConfigPath)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be in info?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without an info message, it is not clear what is happening, the user doesn't see any message and it is not clear which units got processed

if err := os.MkdirAll(baseDir, dirPerm); err != nil {
return errors.New(fmt.Errorf("failed to create base directory: %w", err))
}

for _, unit := range stackFile.Units {
opts.Logger.Infof("Processing unit %s", unit.Name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be in info?

yhakbar
yhakbar previously approved these changes Jan 16, 2025
Copy link
Collaborator

@yhakbar yhakbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful ✨

@denis256 denis256 merged commit 2457563 into main Jan 16, 2025
6 checks passed
@denis256 denis256 deleted the tg-798-stack-run-cli branch January 16, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants