Skip to content

fix(terraform): say that tf notify-plan prints and sends nothing - #4962

Merged
dan-petty merged 5 commits into
mainfrom
fix/3644-notify-plan-help-says-prints
Nov 12, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/3644-notify-plan-help-says-prints

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The command tf notify-plan formats the plan comment and prints it. It sends no request. Its docstring, the help of --pr, the MCP tool description and the knowledge base said that it posts the comment to a pull request, so a reader of the read-only MCP tool believed that it writes to GitHub. The docstring and the option help now say what the command does, including the fixed sample plan when no plan file exists. The generated documents and the MCP tool listing snapshot follow. The unused help text HELP.tf.notify_plan, which also said post, is deleted. A new invariant fails when a command of the dry-run class no-external-request, or one of its options, says that it posts.

Closes #3644

Change: openspec/changes/archive/2026-11-12-3644-tf-notify-plan-says-it-posts/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/terraform OpenTofu modules and the infrastructure they declare labels Nov 12, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 07:42
@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 07:42
@dan-petty
dan-petty merged commit 72762d7 into main Nov 12, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/3644-notify-plan-help-says-prints branch November 12, 2026 07:48
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.117.2](v0.117.1...v0.117.2)
(2026-11-12)


### Bug Fixes

* **terraform:** say that tf notify-plan prints and sends nothing
([#4962](#4962))
([72762d7](72762d7))

---
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>
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record

All runs are local, in the worktree, on the final code.

fail-to-pass

uv run devops ci fail-to-pass --base origin/main:

  passed on base: tests.commands.test_tf_notify_plan::test_notify_plan_prints_the_sample_plan_with_no_plan_file
  passed on base: tests.commands.test_tf_notify_plan::test_notify_plan_prints_the_comment_for_a_pull_request
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_a_local_writer_outside_the_exposure_table_is_reported
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_ratchet_fails_when_gap_entry_is_not_a_command
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_ratchet_fails_when_request_plan_lacks_dry_run
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_a_no_external_request_tool_is_read_only_exactly_when_its_command_writes_nothing
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_ratchet_fails_when_classified_command_remains_in_gaps
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_a_local_writer_with_a_read_only_tool_is_reported
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_ratchet_fails_when_command_lacks_class_and_not_in_gaps
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_no_external_request_command_that_says_post_fails_the_help_check
  failed on base: tests.invariants.test_dry_run_class_ratchet::test_no_external_request_commands_do_not_say_they_post (assert ["Command 'tf... comment to."] == [])
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_dry_run_class_ratchet_repository_invariant
  passed on base: tests.invariants.test_dry_run_class_ratchet::test_a_command_that_writes_nothing_with_a_tool_that_is_not_read_only_is_reported
1 failed on base (1 failed and 12 passed in tests/commands/test_tf_notify_plan.py, tests/invariants/test_dry_run_class_ratchet.py; 0 errored).

The repository invariant test_no_external_request_commands_do_not_say_they_post fails on origin/main because tf notify-plan says "post" in its docstring and in the help of --pr. It passes with the fix.

Scoped checks

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all rows pass.
  • uv run devops ci test on tests/invariants/test_dry_run_class_ratchet.py, tests/commands/test_tf_notify_plan.py, tests/commands/test_tf.py, tests/commands/test_tf_dry_run.py, tests/commands/test_cli_format_adoption.py, tests/ai/mcp/test_mcp_tool_registry.py, tests/ai/mcp/test_mcp_tool_listing.py, tests/docs/test_docs_inventory.py and tests/ai/rag/test_knowledge_base_sync.py: 104 passed.
  • After the rebase onto origin/main, which changed tests/invariants/test_dry_run_class_ratchet.py (fix(mcp): mark the tools that write local state not read-only #4942): the two test files of the change, 13 passed; docs, openspec, lint and format pass.
  • uv run mypy src/devops_cli/commands/tf.py src/devops_cli/lang/en/help.py: no issues.

No test posts a comment on a pull request. The hermetic floor of the test suite blocks the network and refuses gh, so the CLI tests also prove that the command sends no request.

Census of the new invariant

A probe of every command that devops reaches gave 134 of 539 commands with the dry-run class no-external-request. Only tf notify-plan said "post", so the invariant has no allowlist.

Follow-up issues

The issue title now has the scope terraform, because .github/labels.yml declares scope/terraform and no scope/tf.

No live step is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/terraform OpenTofu modules and the infrastructure they declare type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(terraform): tf notify-plan says it posts a comment and posts nothing

1 participant