Skip to content

Docs | Leverage CLI: backend key format, validate-layout exit code, = in task arguments - #257

Merged
diego-ojeda-binbash merged 1 commit into
masterfrom
leverage-cli-backend-keys-and-validate-layout
Nov 27, 2026
Merged

diego-ojeda-binbash merged 1 commit into
masterfrom
leverage-cli-backend-keys-and-validate-layout

Conversation

@diego-ojeda-binbash

@diego-ojeda-binbash diego-ojeda-binbash commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What?

  • tofu and terraform reference, init:
    • how the CLI builds a layer's backend key: the account directory, then the layer's directories without their base-/tools- prefix, with an example
    • init --layers gives each layer its own key
  • tofu and terraform reference, validate-layout:
    • the command exits with an error when a check fails, so it can be used in CI
    • the key format it expects, and the variants it accepts: with or without the region directory, tf-/terraform-, and -dr
  • run reference: arguments are split on commas, and a keyworded value can contain = (task[query=a=b]).

Why?

These behaviors changed in Leverage CLI during the testing work of binbashar/leverage#346, and the docs didn't describe them:

References

Important

No screenshots: the change is text in 3 existing pages (reference/tofu/tofu.md, reference/terraform.md, reference/run.md), with no new pages or navigation. The init note sits in the existing "Regarding S3 backend keys" info box.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified that task arguments are comma-separated and cannot contain commas, while keyword argument values can include =.
    • Expanded Terraform and OpenTofu guidance on how S3 state keys are formed, including separate keys for each layer when using init --layers.
    • Documented the expected S3 key layout, accepted layout variations, and that validate-layout returns an error when a check fails.

…=` in task arguments

- tofu/terraform reference: how `init` builds a layer's backend key, that
  `init --layers` gives each layer its own key, which keys `validate-layout`
  accepts (with or without the region directory, tf-/terraform-, -dr), and
  that it exits with an error when a check fails.
- run reference: arguments are split on commas; a value may contain `=`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@diego-ojeda-binbash
diego-ojeda-binbash requested a review from a team as a code owner November 27, 2026 19:26
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI reference updates clarify task argument syntax and document S3 state key generation and validation for Terraform and OpenTofu.

Changes

Task argument syntax

Layer / File(s) Summary
Argument separator guidance
docs/user-guide/leverage-cli/reference/run.md
The Usage documentation states that task argument values cannot contain commas and that keyword argument values may contain = signs.

Terraform and OpenTofu state keys

Layer / File(s) Summary
Key generation and layout validation
docs/user-guide/leverage-cli/reference/terraform.md, docs/user-guide/leverage-cli/reference/tofu/tofu.md
The init documentation describes generated S3 keys and separate keys for each layer when using --layers. The validate-layout documentation describes the expected key format, accepted variants, and error outcome when a check fails.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: angelofenoglio, juanmatias

Merge Risk: Minimal · up to 797ec

This change only updates CLI reference documentation for backend keys, layout validation, and task arguments. No concrete problem was found, and the risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names three documentation changes that match the PR: S3 backend key format for init, the validate-layout exit code on failure, and the handling of = in task arguments for run. The docs-onl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names three documentation changes that match the PR: S3 backend key format for init, the validate-layout exit code on failure, and the handling of = in task arguments for run. The docs-only scope is also clear. The title is long and uses a pipe-separated format, but it describes the main changes accurately.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb604d2c-71c4-4916-9e54-f62205dc5238
Commits

Reviewing files that changed from the base of the PR and between 2a08dfe and 797ec3d.

Files selected for processing: 3

  • docs/user-guide/leverage-cli/reference/run.md
  • docs/user-guide/leverage-cli/reference/terraform.md
  • docs/user-guide/leverage-cli/reference/tofu/tofu.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@diego-ojeda-binbash
diego-ojeda-binbash merged commit 0dfc66a into master Nov 27, 2026
5 checks passed
@diego-ojeda-binbash
diego-ojeda-binbash deleted the leverage-cli-backend-keys-and-validate-layout branch November 27, 2026 19:30
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