Skip to content

feat: add --no-dependency-prompt option for scaffold #4420

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

Conversation

markoeremija
Copy link
Contributor

@markoeremija markoeremija commented Jun 13, 2025

Description

Fixes #4419.

This PR introduces the ability to use the --no-dependency-prompt flag which is available in the boilerplate package. Using this flag enables skipping the prompt always asking if the user wants to have the dependencies for base and leaf files included or not. For example, the following output:

This boilerplate template has a dependency! Run boilerplate on dependency base with template folder ../.boilerplate-files/base-file and output folder {{ .baseFilePath }}? (y/n) : y

Will not be shown in the terragrunt scaffold command output when --no-dependency-prompt option is set.

TODOs

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)]
  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.

Release Notes (draft)

Updated terragrunt scaffold so the --no-dependency-prompt flag can be used.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added a CLI flag to the scaffold command to disable the confirmation prompt for including dependencies.
  • Documentation
    • Updated scaffold command documentation to include the new flag and its usage.

Copy link

vercel bot commented Jun 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
terragrunt-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 10:15am

Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

📝 Walkthrough

Walkthrough

A new boolean CLI flag, --no-dependency-prompt, has been added to the terragrunt scaffold command. The flag is integrated into the CLI, options, and documentation. Related structs and tests are updated to support and document the new flag, which disables dependency confirmation prompts during scaffolding.

Changes

File(s) Change Summary
cli/commands/scaffold/cli.go Added --no-dependency-prompt CLI flag and environment variable support.
options/options.go Added NoDependencyPrompt boolean field to TerragruntOptions struct and its constructor.
cli/commands/scaffold/scaffold.go Passed DisableDependencyPrompt option from opts.NoDependencyPrompt to BoilerplateOptions.
cli/commands/scaffold/scaffold_test.go Updated test to include DisableDependencyPrompt in BoilerplateOptions struct initialization.
docs/_docs/02_features/07-scaffold.md Updated documentation to describe and demonstrate the new flag --no-dependency-prompt.
docs-starlight/src/content/docs/02-features/07-scaffold.md Updated documentation similarly to include --no-dependency-prompt flag.
test/integration_scaffold_test.go Added integration test for --no-dependency-prompt flag verifying no dependency prompt occurs.
test/fixtures/scaffold/dependency-prompt-template/.boilerplate/boilerplate.yml Added boilerplate configuration defining dependencies for testing the new flag.
test/fixtures/scaffold/dependency-prompt-template/leaf/terragrunt.hcl Added new terragrunt.hcl template file for the leaf dependency in the boilerplate template.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant TerragruntOptions
    participant ScaffoldCommand
    participant BoilerplateOptions

    User->>CLI: Run 'terragrunt scaffold --no-dependency-prompt'
    CLI->>TerragruntOptions: Parse flags, set NoDependencyPrompt
    CLI->>ScaffoldCommand: Call Run with TerragruntOptions
    ScaffoldCommand->>BoilerplateOptions: Pass DisableDependencyPrompt (from NoDependencyPrompt)
    BoilerplateOptions-->>ScaffoldCommand: Use DisableDependencyPrompt to control prompts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Suggested labels

preserved, docs

Suggested reviewers

  • denis256
  • yhakbar
  • levkohimins

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e0a03e and a5622c4.

📒 Files selected for processing (9)
  • cli/commands/scaffold/cli.go (2 hunks)
  • cli/commands/scaffold/scaffold.go (1 hunks)
  • cli/commands/scaffold/scaffold_test.go (1 hunks)
  • docs-starlight/src/content/docs/02-features/07-scaffold.md (2 hunks)
  • docs/_docs/02_features/07-scaffold.md (2 hunks)
  • options/options.go (2 hunks)
  • test/fixtures/scaffold/dependency-prompt-template/.boilerplate/boilerplate.yml (1 hunks)
  • test/fixtures/scaffold/dependency-prompt-template/leaf/terragrunt.hcl (1 hunks)
  • test/integration_scaffold_test.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • cli/commands/scaffold/scaffold.go
  • cli/commands/scaffold/scaffold_test.go
  • test/fixtures/scaffold/dependency-prompt-template/.boilerplate/boilerplate.yml
  • docs-starlight/src/content/docs/02-features/07-scaffold.md
  • options/options.go
  • test/integration_scaffold_test.go
  • docs/_docs/02_features/07-scaffold.md
  • test/fixtures/scaffold/dependency-prompt-template/leaf/terragrunt.hcl
  • cli/commands/scaffold/cli.go
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
cli/commands/scaffold/cli.go (2)

21-27: Constant name deviates from existing naming convention

All other flag constants are suffixed with FlagName (RootFileNameFlagName, VarFileFlagName, …). Renaming for consistency improves readability and grep-ability.

-	DisableDependencyPrompt = "disable-dependency-prompt"
+	DisableDependencyPromptFlagName = "disable-dependency-prompt"

Subsequent references in this file would need the same rename.


83-89: Nice addition – environment variable automatically supported

The flag is wired with tgPrefix.EnvVars, so TERRAGRUNT_DISABLE_DEPENDENCY_PROMPT will work out-of-the-box. Consider documenting this in the scaffold docs for completeness.

cli/commands/scaffold/scaffold_test.go (1)

65-74: Test kept in sync – consider a positive-case test

The new field is included, which protects against regressions.
Optional: add a test exercising DisableDependencyPrompt: true to ensure the underlying boilerplate logic really skips the confirmation prompt.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dac88d and 81b8ecc.

📒 Files selected for processing (5)
  • cli/commands/scaffold/cli.go (2 hunks)
  • cli/commands/scaffold/scaffold.go (1 hunks)
  • cli/commands/scaffold/scaffold_test.go (1 hunks)
  • docs/_docs/02_features/07-scaffold.md (2 hunks)
  • options/options.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`docs/**/*.md`: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration under...

docs/**/*.md: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration underway from the Jekyll based documentation in docs to the Starlight + Astro based documentation in docs-starlight. Whenever changes are made to the docs directory, ensure that an equivalent change is made in the docs-starlight directory to keep the docs-starlight documentation accurate.

  • docs/_docs/02_features/07-scaffold.md
`**/*.go`: Review the Go code for quality and correctness. Make sure that the Go code follows best practices, is performant, and is easy to understand and maintain.

**/*.go: Review the Go code for quality and correctness. Make sure that the Go code follows best practices, is performant, and is easy to understand and maintain.

  • cli/commands/scaffold/scaffold_test.go
  • cli/commands/scaffold/scaffold.go
  • options/options.go
  • cli/commands/scaffold/cli.go
🧬 Code Graph Analysis (4)
cli/commands/scaffold/scaffold_test.go (1)
cli/commands/scaffold/cli.go (1)
  • DisableDependencyPrompt (26-26)
cli/commands/scaffold/scaffold.go (1)
cli/commands/scaffold/cli.go (1)
  • DisableDependencyPrompt (26-26)
options/options.go (1)
cli/commands/scaffold/cli.go (1)
  • DisableDependencyPrompt (26-26)
cli/commands/scaffold/cli.go (2)
cli/flags/flag.go (1)
  • NewFlag (28-41)
internal/cli/bool_flag.go (1)
  • BoolFlag (13-49)
🔇 Additional comments (2)
options/options.go (1)

313-315: New option field is well-integrated.

The DisableDependencyPrompt flag is correctly added to the struct and initialised with a sane default; no functional or stylistic issues spotted.

Also applies to: 421-422

cli/commands/scaffold/scaffold.go (1)

198-208: Propagation of the new flag looks correct

The flag is forwarded to boilerplate_options.BoilerplateOptions, so scaffold generation will respect the setting. No additional concerns here.

Comment on lines 18 to 20
```bash
terragrunt scaffold <MODULE_URL> [TEMPLATE_URL] [--var] [--var-file] [--no-include-root] [--root-file-name]
terragrunt scaffold <MODULE_URL> [TEMPLATE_URL] [--var] [--var-file] [--no-include-root] [--root-file-name] [--disable-dependency-prompt]
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Docs-starlight copy missing

Per contribution guidelines, every change under docs/ must be mirrored in docs-starlight/. Please replicate the new flag description there to keep the two doc sets in sync.

Also applies to: 108-109

🤖 Prompt for AI Agents
In docs/_docs/02_features/07-scaffold.md around lines 18 to 20 and also lines
108 to 109, the new flag description added in the docs/ directory is missing in
the docs-starlight/ directory. To fix this, replicate the exact changes made for
the new flag description from docs/_docs/02_features/07-scaffold.md into the
corresponding file and lines in docs-starlight/_docs/02_features/07-scaffold.md
to keep both documentation sets synchronized.

@markoeremija markoeremija changed the title feat: add --disable-dependency-prompt option for scaffold feat: add --disable-dependency-prompt option for scaffold Jun 13, 2025
@markoeremija markoeremija force-pushed the feat/add-disable-dependency-prompt-option branch from 81b8ecc to ab96332 Compare June 17, 2025 08:58
@yhakbar
Copy link
Collaborator

yhakbar commented Jun 19, 2025

Hey @markoeremija ,

Thanks for submitting this PR. Could you please take a look at the following rules and make sure this flag follows them?
https://terragrunt-v1.gruntwork.io/docs/reference/cli/rules

I think at the least disable should change to no, as --no-dependency-prompt, but I'm open to a different name if you think of one that better aligns with the rules.

@yhakbar yhakbar marked this pull request as draft June 19, 2025 14:13
@markoeremija
Copy link
Contributor Author

Hey @yhakbar, thanks for taking a look. I will check the rules out and try to implement the --no-dependency-prompt flag as mentioned.

@markoeremija markoeremija force-pushed the feat/add-disable-dependency-prompt-option branch from ab96332 to 1cd2d95 Compare June 19, 2025 15:34
@markoeremija markoeremija changed the title feat: add --disable-dependency-prompt option for scaffold feat: add --no-dependency-prompt option for scaffold Jun 19, 2025
@markoeremija markoeremija force-pushed the feat/add-disable-dependency-prompt-option branch from 1cd2d95 to 8ca3b46 Compare June 19, 2025 16:01
@markoeremija markoeremija force-pushed the feat/add-disable-dependency-prompt-option branch from 8ca3b46 to 8b4d342 Compare June 30, 2025 10:13
Copy link

vercel bot commented Jun 30, 2025

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@yhakbar yhakbar marked this pull request as ready for review June 30, 2025 13:10
@yhakbar yhakbar requested a review from wakeful as a code owner June 30, 2025 13:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
docs-starlight/src/content/docs/02-features/07-scaffold.md (2)

14-15: Add missing pipe separator before optional flags to keep usage syntax consistent

Previous examples in the docs show the optional flags grouped with a single pair of square brackets. Adding more flags without a preceding pipe character (|) can be confusing. Consider clarifying with individual brackets or clearly noting [...] indicates any number of optional flags.


105-106: Tighten wording to follow the style of the surrounding bullet list

The current phrasing is slightly verbose compared to the preceding bullets. Align the tone by leading with the action verb and removing the parenthetical clause.

- `--no-dependency-prompt` - Disable dependency confirmation, but keep the interactive mode enabled (skip asking for confirmation about including dependencies defined in the boilerplate template).
+ `--no-dependency-prompt` - Disable the prompt that asks whether to include dependencies defined in the boilerplate template while keeping interactive mode enabled.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab96332 and bfd0fa8.

📒 Files selected for processing (6)
  • cli/commands/scaffold/cli.go (2 hunks)
  • cli/commands/scaffold/scaffold.go (1 hunks)
  • cli/commands/scaffold/scaffold_test.go (1 hunks)
  • docs-starlight/src/content/docs/02-features/07-scaffold.md (2 hunks)
  • docs/_docs/02_features/07-scaffold.md (2 hunks)
  • options/options.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/_docs/02_features/07-scaffold.md
  • cli/commands/scaffold/scaffold_test.go
  • options/options.go
  • cli/commands/scaffold/cli.go
  • cli/commands/scaffold/scaffold.go
🧰 Additional context used
📓 Path-based instructions (1)
`docs-starlight/**/*.md*`: Review the documentation for clarity, grammar, and sp...

docs-starlight/**/*.md*: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration underway from the Jekyll based documentation in docs to the Starlight + Astro based documentation in docs-starlight. Make sure that the docs-starlight documentation is accurate and up-to-date with the docs documentation, and that any difference between them results in an improvement in the docs-starlight documentation.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • docs-starlight/src/content/docs/02-features/07-scaffold.md
🧠 Learnings (1)
docs-starlight/src/content/docs/02-features/07-scaffold.md (2)
Learnt from: yhakbar
PR: gruntwork-io/terragrunt#3868
File: docs-starlight/patches/@astrojs%2Fstarlight@0.31.1.patch:33-33
Timestamp: 2025-02-10T23:20:04.295Z
Learning: In Terragrunt projects, all `.hcl` files can be assumed to be Terragrunt configurations by default, with specific exceptions like `.terraform.lock.hcl` that need explicit handling.
Learnt from: yhakbar
PR: gruntwork-io/terragrunt#4169
File: cli/commands/hcl/validate/cli.go:29-60
Timestamp: 2025-04-17T13:02:28.098Z
Learning: Avoid shadowing imported packages with local variables in Go code, such as using a variable named `flags` when the `github.com/gruntwork-io/terragrunt/cli/flags` package is imported. Use more specific variable names like `flagSet` instead.

@yhakbar
Copy link
Collaborator

yhakbar commented Jun 30, 2025

@markoeremija would it be possible to get some integration tests for this? Presumably, we could verify that when scaffolding a template with dependencies, using this flag allows the integration test to proceed without getting hung on the interactive prompt.

@markoeremija
Copy link
Contributor Author

Test results:

go test -v -run 'TestScaffoldNoDependencyPrompt' ./test
=== RUN   TestScaffoldNoDependencyPrompt
=== PAUSE TestScaffoldNoDependencyPrompt
=== CONT  TestScaffoldNoDependencyPrompt
    integration_scaffold_test.go:167: [tgl --working-dir /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001 scaffold --no-dependency-prompt /Users/markoeremija/Projects/open-source/terragrunt-work/terragrunt/test/fixtures/scaffold/dependency-prompt-template//. --output-folder /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar --log-format=key-value]
[boilerplate] 2025/07/16 13:22:45 Loading boilerplate config from /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Loading boilerplate config from /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Processing dependency base, with template folder /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/base and output folder /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar/base
[boilerplate] 2025/07/16 13:22:45 Loading boilerplate config from /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Loading boilerplate config from /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/base/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Processing templates in /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/base and outputting generated files to /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar/base
[boilerplate] 2025/07/16 13:22:45 Skipping /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/base
[boilerplate] 2025/07/16 13:22:45 Skipping /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/base/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Copying /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/base/test.hcl to /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar/base/test.hcl
[boilerplate] 2025/07/16 13:22:45 Processing dependency leaf, with template folder /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/leaf and output folder /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar/leaf
[boilerplate] 2025/07/16 13:22:45 Loading boilerplate config from /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Loading boilerplate config from /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/leaf/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Processing templates in /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/leaf and outputting generated files to /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar/leaf
[boilerplate] 2025/07/16 13:22:45 Skipping /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/leaf
[boilerplate] 2025/07/16 13:22:45 Skipping /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/leaf/boilerplate.yml
[boilerplate] 2025/07/16 13:22:45 Processing templates in /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate and outputting generated files to /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/TestScaffoldNoDependencyPrompt315672047/001/foo/bar
[boilerplate] 2025/07/16 13:22:45 Skipping /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate
[boilerplate] 2025/07/16 13:22:45 Skipping /var/folders/mr/23vws81n3vgdlrd5p0l56zph0000gp/T/scaffold1236786798/.boilerplate/boilerplate.yml
    integration_scaffold_test.go:167: [TestScaffoldNoDependencyPrompt] Full contents of stdout:
    package.go:919: [TestScaffoldNoDependencyPrompt]
    integration_scaffold_test.go:167: [TestScaffoldNoDependencyPrompt] Full contents of stderr:
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=warn msg=Failed to parse url file:///Users/markoeremija/Projects/open-source/terragrunt-work/terragrunt/test/fixtures/scaffold/dependency-prompt-template//.
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=warn msg=Failed to parse module url file:///Users/markoeremija/Projects/open-source/terragrunt-work/terragrunt/test/fixtures/scaffold/dependency-prompt-template//.
    package.go:919: [TestScaffoldNoDependencyPrompt] fatal: '/Users/markoeremija/Projects/open-source/terragrunt-work/terragrunt/test/fixtures/scaffold/dependency-prompt-template' does not appear to be a git repository
    package.go:919: [TestScaffoldNoDependencyPrompt] fatal: Could not read from remote repository.
    package.go:919: [TestScaffoldNoDependencyPrompt]
    package.go:919: [TestScaffoldNoDependencyPrompt] Please make sure you have the correct access rights
    package.go:919: [TestScaffoldNoDependencyPrompt] and the repository exists.
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=warn msg=Failed to find last release tag for file:///Users/markoeremija/Projects/open-source/terragrunt-work/terragrunt/test/fixtures/scaffold/dependency-prompt-template
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=info msg=Scaffolding a new Terragrunt module file:///Users/markoeremija/Projects/open-source/terragrunt-work/terragrunt/test/fixtures/scaffold/dependency-prompt-template//. to ./foo/bar
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=info msg=Running boilerplate generation to ./foo/bar
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=info msg=Running fmt on generated code ./foo/bar
    package.go:919: [TestScaffoldNoDependencyPrompt] time=2025-07-16CEST13:22:45+02:00 level=info msg=Scaffolding completed
    package.go:919: [TestScaffoldNoDependencyPrompt]
--- PASS: TestScaffoldNoDependencyPrompt (0.05s)
PASS
ok  	github.com/gruntwork-io/terragrunt/test	0.770s

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/integration_scaffold_test.go (1)

159-173: Well-implemented integration test with comprehensive coverage.

The test effectively validates the new --no-dependency-prompt flag functionality by:

  • Verifying the command executes successfully
  • Confirming dependency warning messages are suppressed (line 169)
  • Checking that expected scaffolded files are created (lines 170-171)
  • Validating the completion message appears (line 172)

The test follows Go testing best practices with proper use of t.Parallel(), appropriate assertions, and good error handling.

Consider adding the --non-interactive flag for consistency with other tests in this file:

-, stderr, err := helpers.RunTerragruntCommandWithOutput(t, fmt.Sprintf("terragrunt --working-dir %s scaffold --no-dependency-prompt %s --output-folder %s", tmpEnvPath, localBoilerplateModuleDir, outputFolder))
+, stderr, err := helpers.RunTerragruntCommandWithOutput(t, fmt.Sprintf("terragrunt --non-interactive --working-dir %s scaffold --no-dependency-prompt %s --output-folder %s", tmpEnvPath, localBoilerplateModuleDir, outputFolder))
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1674e9 and e838622.

📒 Files selected for processing (9)
  • cli/commands/scaffold/cli.go (2 hunks)
  • cli/commands/scaffold/scaffold.go (1 hunks)
  • cli/commands/scaffold/scaffold_test.go (1 hunks)
  • docs-starlight/src/content/docs/02-features/07-scaffold.md (2 hunks)
  • docs/_docs/02_features/07-scaffold.md (2 hunks)
  • options/options.go (2 hunks)
  • test/fixtures/scaffold/dependency-prompt-template/.boilerplate/boilerplate.yml (1 hunks)
  • test/fixtures/scaffold/dependency-prompt-template/leaf/terragrunt.hcl (1 hunks)
  • test/integration_scaffold_test.go (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • test/fixtures/scaffold/dependency-prompt-template/leaf/terragrunt.hcl
🚧 Files skipped from review as they are similar to previous changes (6)
  • docs/_docs/02_features/07-scaffold.md
  • docs-starlight/src/content/docs/02-features/07-scaffold.md
  • cli/commands/scaffold/scaffold.go
  • cli/commands/scaffold/scaffold_test.go
  • cli/commands/scaffold/cli.go
  • options/options.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧬 Code Graph Analysis (1)
test/integration_scaffold_test.go (2)
test/helpers/package.go (1)
  • RunTerragruntCommandWithOutput (935-939)
util/file.go (1)
  • FileExists (58-61)
🪛 YAMLlint (1.37.1)
test/fixtures/scaffold/dependency-prompt-template/.boilerplate/boilerplate.yml

[error] 7-7: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
test/integration_scaffold_test.go (1)

22-22: LGTM!

The constant is appropriately named and follows the established naming pattern for test fixtures.

@markoeremija
Copy link
Contributor Author

@yhakbar @wakeful would someone have some time to check the latest changes?

@yhakbar
Copy link
Collaborator

yhakbar commented Jul 24, 2025

We've got some lint failures, but I'm willing to merge this, then correct afterwards if the tests pass. It's not worth blocking the PR.

@markoeremija
Copy link
Contributor Author

@yhakbar I see the lint errors, I can fix that, my bad.

@yhakbar
Copy link
Collaborator

yhakbar commented Jul 24, 2025

@yhakbar I see the lint errors, I can fix that, my bad.

Don't bother. It'll just slow down the process of getting this release. We can fix it in another PR.

@yhakbar yhakbar merged commit 76ff53c into gruntwork-io:main Jul 24, 2025
74 of 79 checks passed
@yhakbar yhakbar mentioned this pull request Jul 24, 2025
6 tasks
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.

Add --disable-dependency-prompt flag to terragrunt scaffold
2 participants