Skip to content

[Resource] Amend what-if noise notice to point to Deployment Stacks - #34002

Open
Torrey Trahanovsky (torreymicrosoft) wants to merge 1 commit into
Azure:devfrom
torreymicrosoft:torreyt/whatif-notice-amend-existing
Open

[Resource] Amend what-if noise notice to point to Deployment Stacks#34002
Torrey Trahanovsky (torreymicrosoft) wants to merge 1 commit into
Azure:devfrom
torreymicrosoft:torreyt/whatif-notice-amend-existing

Conversation

@torreymicrosoft

@torreymicrosoft Torrey Trahanovsky (torreymicrosoft) commented Aug 27, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command

az deployment group what-if, az deployment sub what-if, az deployment mg what-if, az deployment tenant what-if (and the what-if preview shown by --confirm-with-what-if / -c on az deployment ... create).

Description

Replaces #33952, which is now closed. This PR is branched from current dev and implements Alex Frankel (@alex-frankel)'s review feedback.

Review feedback being addressed

Alex Frankel (@alex-frankel), on Azure/azure-powershell#30048 (Resources.resx):

This reads a bit too much like an ad..

Can we only amend what is there:

Note: The result may contain false positive predictions (noise). For what-if with noise reduction, consider Deployment Stacks (https://aka.ms/stackswhatifGA)

That feedback was left on the Azure PowerShell PR, but it applies equally here — the two must stay in sync — so it is implemented identically in both.

What changed as a result:

  • Dropped the separate NOTICE! - Want to get What-if without noise? Move to ... line, which was the part that read like an ad.
  • Amended the existing Note: sentence in place instead of appending a new line, exactly as requested.
  • Removed the https://aka.ms/WhatIfIssues issue-filing line, so the notice is a single sentence with one next step.
  • Adopted Alex Frankel (@alex-frankel)'s proposed wording verbatim, including the parenthesized bare URL and lowercase what-if.

Before (current dev)

Note: The result may contain false positive predictions (noise).
You can help us improve the accuracy of the result by opening an issue here: https://aka.ms/WhatIfIssues
NOTICE! - Want to get What-if without noise? Move to Deployment Stacks What-If https://aka.ms/stackswhatifGA

After

Note: The result may contain false positive predictions (noise). For what-if with noise reduction, consider Deployment Stacks (https://aka.ms/stackswhatifGA)

Test coverage

The CI agent on #33952 flagged the absence of regression coverage as the one actionable item before merge. This PR adds TestFormatWhatIfOperationResult.test_noise_notice in tests/latest/test_resource_formatters.py, asserting the rendered what-if output begins with the exact notice string.

Verified locally that the assertion holds and that the pre-existing test_resource_changes_stats endswith(...) assertion is unaffected, since the notice is emitted at the top of the output.

Scope / risk

  • The only production change is the string literal in _format_noise_notice in src/azure-cli/azure/cli/command_modules/resource/_formatters.py, reached solely through format_what_if_operation_result for template deployment what-if.
  • Deployment Stacks what-if output is produced by DeploymentStacksWhatIfResultFormatter in _stacks_formatters.py and is not touched, so customers already on stacks are not told to move to stacks.
  • https://aka.ms/WhatIfIssues now has no remaining references under src/.
  • The literal is split across two source lines via implicit concatenation so no source line exceeds the 120-character limit in pylintrc / .flake8; the rendered output is a single line.
  • The final string is byte-identical to the one in the companion Azure PowerShell PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 27, 2026 17:17
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added Auto-Assign Auto assign by bot ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group act-identity-squad labels Aug 27, 2026
@torreymicrosoft

Copy link
Copy Markdown
Member Author

Alex Frankel (@alex-frankel) — this replaces the earlier PR you reviewed. Your feedback is implemented verbatim:

This reads a bit too much like an ad.. Can we only amend what is there:
Note: The result may contain false positive predictions (noise). For what-if with noise reduction, consider Deployment Stacks (https://aka.ms/stackswhatifGA)

The standalone NOTICE! - ... line is gone, the existing Note: sentence is amended in place, and the aka.ms/WhatIfIssues line is removed so there is a single next step. The resulting string is byte-identical across Azure CLI and Azure PowerShell.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the template-deployment what-if “noise” notice to use the agreed single-sentence wording that points users to Deployment Stacks for noise reduction, and adds regression coverage to lock the rendered notice text.

Changes:

  • Replace the multi-line what-if noise notice with a single-sentence notice referencing Deployment Stacks.
  • Add a unit test asserting the what-if formatted output starts with the exact notice string.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/azure-cli/azure/cli/command_modules/resource/_formatters.py Replaces the existing multi-line what-if noise notice with the new single-line wording.
src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource_formatters.py Adds a regression test that asserts the formatted output begins with the updated notice text.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

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

Labels

act-identity-squad ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants