Add What-If support for deployment stacks - #327
Draft
Anthony Martin (anthony-c-martin) with Copilot wants to merge 9 commits into
Draft
Anthony Martin (anthony-c-martin) with Copilot wants to merge 9 commits into
Anthony Martin (anthony-c-martin) with Copilot wants to merge 9 commits into
Conversation
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 8, 2026 15:12
View session
Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for Azure deployment stack what-if feature
Add What-If support for deployment stacks with hasChanges output
Sep 8, 2026
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 8, 2026 16:02
View session
Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Member
|
Copilot please address my comments |
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 8, 2026 16:31
View session
Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 8, 2026 18:38
View session
Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 8, 2026 19:25
View session
Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 9, 2026 00:08
View session
Comment on lines
+105
to
+132
| insert( | ||
| index: number, | ||
| value: string = "", | ||
| color?: Color, | ||
| noIndent: boolean = false, | ||
| ): this { | ||
| if (color && this.colorMode !== "off") { | ||
| this.contents.splice( | ||
| index, | ||
| 0, | ||
| getColorString(this.colorMode, Color.Reset), | ||
| ); | ||
| } | ||
|
|
||
| this.contents.splice(index, 0, value); | ||
|
|
||
| if (color && this.colorMode !== "off") { | ||
| this.contents.splice(index, 0, getColorString(this.colorMode, color)); | ||
| } | ||
|
|
||
| if (!noIndent && this.shouldIndent(index, true)) { | ||
| this.contents.splice(index, 0, this.indents.join("")); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
|
|
||
| insertLine( |
There was a problem hiding this comment.
Why the need to add all these extra methods? Aren't there existing ones we can use?
There was a problem hiding this comment.
Copilot pls address
Author
There was a problem hiding this comment.
Removed insert/insertLine/getCurrentIndex in d997c64. The only caller (stackWhatIf.ts's conditional stack-changes title) now builds that section into a temporary ColorStringBuilder, then appends the title + built content to the main builder with the existing appendLine/append methods only if something was actually produced — no more inserting at a previously-recorded position.
…s array Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
Copilot started work on behalf of
Anthony Martin (anthony-c-martin)
September 9, 2026 00:30
View session
… a section sub-builder instead Co-authored-by: anthony-c-martin <38542602+anthony-c-martin@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deployment stacks did not support the
whatIfoperation, unlike regular deployments. Users had no way to preview stack changes before applying them, or to conditionally gate acreateoperation on whether changes were actually detected.SDK upgrade
@azure/arm-resourcesdeploymentstacksto^2.0.0, which introduces thedeploymentStacksWhatIfResultsAt{ResourceGroup,Subscription,ManagementGroup}operation groups needed for stack what-if. Existing stack operations continue to use the same (now-deprecated but still functional) method names, so no other call sites needed changes.Config & inputs
whatIfas a validoperationvalue fordeploymentStackconfig (previously onlycreate,validate,delete).What-if execution
stackWhatIfinstacks.ts, which computes the deployment stack ARM resource ID from the configured scope/name, creates a transientDeploymentStacksWhatIfResultresource (with a minimal 1-day retention interval) to trigger the computation, then fetches the result with full property-level changes.Presentation & output
DeploymentStacksWhatIfChangeresults (change legend, stack-level changes, per-resource changes, property diffs, summary), modeled after the Azure CLI's stack what-if formatter.whatIfoperation intohandler.ts, logging the formatted result and diagnostics.hasChangesaction output, set for both deployment and deployment stackwhatIfoperations, so subsequent workflow steps can conditionally decide whether to runcreate:Docs
action.ymland README to document the newwhatIfoperation for deployment stacks and thehasChangesoutput.