- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
          fix: Adding docs back for -detailed-exitcode, etc.
          #4803
        
          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
          
📝 WalkthroughWalkthroughAdded three informational Asides to docs-starlight/src/data/flags/all.mdx documenting behavior of run --all with dependencies, implicit -auto-approve when combined with apply/destroy, and aggregate exit code semantics with -detailed-exitcode. No code or API changes. Changes
 Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
 Suggested reviewers
 Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
 ✅ Passed checks (2 passed)
 Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
 ✨ Finishing touches🧪 Generate unit tests
 Comment   | 
    
| 
           The latest updates on your projects. Learn more about Vercel for GitHub. 
  | 
    
2a78eef    to
    4e57d6e      
    Compare
  
    There was a problem hiding this 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/data/flags/all.mdx (2)
47-51: Be explicit about implicit -auto-approve and add a safety tip.“Silently” can read as surprising behavior; “implicitly” is more neutral. Add a short best-practice note.
<Aside type="note"> -Using `run --all` with `apply` or `destroy` silently adds the `-auto-approve` flag to the command line -arguments passed to OpenTofu/Terraform due to issues with shared `stdin` making individual approvals impossible. - +When you use `run --all` with `apply` or `destroy`, Terragrunt implicitly adds `-auto-approve` to the +OpenTofu/Terraform invocation. Because multiple units share a single `stdin` stream, interactive approvals +aren’t possible. + +Best practice: review plans first (for example, `run --all plan -detailed-exitcode`) and narrow the scope +with [`--include-dir`](/docs/reference/cli/commands/run#include-dir) and/or +[`--exclude-dir`](/docs/reference/cli/commands/run#exclude-dir). </Aside>
53-62: Clarify that -detailed-exitcode is plan-specific and improve wording (“exits with code”).This aligns reader expectations and matches Terraform/OpenTofu semantics where 2 = “changes present,” not an error.
<Aside type="note"> -Using the OpenTofu/Terraform [-detailed-exitcode](https://opentofu.org/docs/cli/commands/plan/#other-options) -flag with the `run --all` command results in an aggregate exit code being returned, rather than the exit code of any particular unit. +When using the OpenTofu/Terraform [-detailed-exitcode](https://opentofu.org/docs/cli/commands/plan/#other-options) +flag with `run --all` (typically with the `plan` command), Terragrunt returns an aggregate exit code rather than +the exit code of any particular unit. Note: exit code 2 means “plan succeeded with changes.” -The algorithm for determining the aggregate exit code is as follows: +The algorithm for determining the aggregate exit code is as follows: -- If any unit throws a 1, Terragrunt will throw a 1. -- If any unit throws a 2, but nothing throws a 1, Terragrunt will throw a 2. -- If nothing throws a non-zero, Terragrunt will throw a 0. +- If any unit exits with code 1, Terragrunt exits with code 1. +- Else if any unit exits with code 2, Terragrunt exits with code 2. +- Else Terragrunt exits with code 0. </Aside>If desired, we can cross-check that this matches current behavior in error aggregation. Would you like a follow-up PR linking to a short “Exit codes” reference page and the MultiError rationale?
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs-starlight/src/data/flags/all.mdx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs-starlight/**/*.md*
⚙️ CodeRabbit configuration file
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
docsto the Starlight + Astro based documentation indocs-starlight. Make sure that thedocs-starlightdocumentation is accurate and up-to-date with thedocsdocumentation, and that any difference between them results in an improvement in thedocs-starlightdocumentation.
Files:
docs-starlight/src/data/flags/all.mdx
🧠 Learnings (1)
📓 Common learnings
Learnt from: jorhett
PR: gruntwork-io/terragrunt#1234
File: errors/multierror.go:35-39
Timestamp: 2025-09-10T04:41:35.652Z
Learning: In Terragrunt's MultiError.Error() method, checking for the exact string "exit status 2" and returning it directly is not a brittle hack but a semantic fix. Terraform's --detailed-exitcode flag uses exit code 2 to mean "plan succeeded with changes" (not an error), so when multiple modules return this status, it should not be wrapped in "Hit multiple errors:" formatting as that misrepresents successful operations as errors.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Pull Request has non-contributor approval
 - GitHub Check: build_no_proxy / Build (linux/amd64)
 - GitHub Check: build_no_proxy / Build (windows/386)
 - GitHub Check: build_no_proxy / Build (windows/amd64)
 - GitHub Check: build_no_proxy / Build (linux/arm64)
 - GitHub Check: base_tests / Test (macos)
 - GitHub Check: base_tests / Test (ubuntu)
 - GitHub Check: Pull Request has non-contributor approval
 
🔇 Additional comments (1)
docs-starlight/src/data/flags/all.mdx (1)
37-45: Tighten wording and link to the dependency docs (mock_outputs attribute)Clarify the ambiguous "it" and point directly to the dependency block docs — there’s no
#dependency-mock_outputsanchor. Suggested replacement:<Aside type="caution"> Use `run --all` with care if you have unapplied dependencies. If your stack defines inter-unit dependencies via `dependency` blocks and you haven’t deployed them yet, commands like `run --all plan` can fail because Terragrunt cannot resolve dependency outputs until their source units have been applied. To plan successfully before the first apply, use the `mock_outputs` attribute in `dependency` blocks. See [dependency block docs](/docs/reference/hcl/blocks/#dependency) for details. </Aside>Likely an incorrect or invalid review comment.
Description
Fixes #000.
TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added / Removed / Updated [X].
Migration Guide
Summary by CodeRabbit