Skip to content

feat(terraform): preview requests in dry run for tf commands - #2895

Merged
dan-petty merged 1 commit into
mainfrom
feat/2249-tf-dry-run
Oct 31, 2026
Merged

dan-petty merged 1 commit into
mainfrom
feat/2249-tf-dry-run

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

This change implements sub-issue #2249. It adds dry-run support to 15 OpenTofu commands in devops tf.

Changes

  • Categorized 9 commands making subprocess calls under @dry_run_class("request-plan"): tf init, tf plan, tf apply, tf destroy, tf output, tf deploy-cloud, tf lint, tf cost breakdown, and tf cost diff.
  • Added shared request planners in src/devops_cli/tf/tf_plans.py using PlannedRequest records.
  • Categorized 6 local inspection commands under @dry_run_class("no-external-request"): tf drift, tf fmt, tf graph, tf notify-plan, tf status, and tf validate.
  • Removed echo-only dry-run previews and redundant --dry-run options from read-only commands without a shim.
  • Updated TFOutputResult, TFLintResult, and TFCostBreakdownResult models with dry_run and requests fields.
  • Removed 15 OpenTofu entries from tests/fixtures/dry_run_gaps.json.
  • Added test coverage in tests/commands/test_tf_dry_run.py.

Closes #2249

@dan-petty dan-petty added the type/feature Type feature: a new function label Oct 31, 2026
@dan-petty dan-petty changed the title feat(tf): preview requests in dry run for tf commands feat(terraform): preview requests in dry run for tf commands Oct 31, 2026
Add dry-run support to OpenTofu commands.

Nine commands that dispatch subprocesses now carry the request-plan
class: tf init, tf plan, tf apply, tf destroy, tf output,
tf deploy-cloud, tf lint, tf cost breakdown, and tf cost diff.
Under dry run, each command previews its planned execution requests
and starts no subprocess.

Six local inspection commands carry the no-external-request class:
tf drift, tf fmt, tf graph, tf notify-plan, tf status, and tf validate.
Under dry run, each command runs locally without external network requests.
Removed redundant explicit dry-run options from local inspection commands.

Closes #2249
@dan-petty
dan-petty force-pushed the feat/2249-tf-dry-run branch from 84abd29 to 5dc0407 Compare October 31, 2026 18:18
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 18:26
@dan-petty
dan-petty merged commit 980a9be into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the feat/2249-tf-dry-run branch October 31, 2026 18:26
dan-petty-release Bot added a commit that referenced this pull request Oct 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.31.0](v0.30.0...v0.31.0)
(2026-10-31)


### Features

* **terraform:** preview requests in dry run for tf commands
([#2895](#2895))
([980a9be](980a9be)),
closes [#2249](#2249)


### Bug Fixes

* **security:** the subprocess environment guard accepts LESS, which...
([#2896](#2896))
([1545b85](1545b85))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tf): tf commands list their requests in a dry run and make none

1 participant