Skip to content

[ChangeSafety] First preview release for module Az.ChangeSafety#29651

Open
henryzdai wants to merge 5 commits into
Azure:mainfrom
henryzdai:feature/az-changesafety-module
Open

[ChangeSafety] First preview release for module Az.ChangeSafety#29651
henryzdai wants to merge 5 commits into
Azure:mainfrom
henryzdai:feature/az-changesafety-module

Conversation

@henryzdai
Copy link
Copy Markdown
Member

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Henry Dai and others added 3 commits January 23, 2026 14:59
- 12 cmdlets for StageMap, ChangeRecord, and StageProgression resources
- Custom cmdlets with simplified -Targets parameter
- 26 tests passing in both Live and Playback modes
- Full documentation and examples for all cmdlets
- B1: Scrub Microsoft tenant ID, subscription IDs, and aliases from env.json and all 12 *.Recording.json files (replaced with placeholder zero-GUIDs and 'testuser')
- B2: Remove localEnv.json from working tree and add to .gitignore (per-developer override, should not be committed)
- B5: Register Az.ChangeSafety in tools/AzPreview/AzPreview.psd1 and documentation/azure-powershell-modules.md (table row + 3 link sections)
- S2: Set Prerelease = 'preview' in Az.ChangeSafety.psd1 so v0.1.0 publishes to PSGallery as a prerelease

Note: B3 (spec input-file references 2026-01-01-preview which only exists in
azure-rest-api-specs-pr:RPSaaSMaster) and B4 (commit: RPSaaSMaster is not a SHA)
require manual decision — see drafts/azure-change-control/az-changesafety-pr-review.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per CONTRIBUTING.md guidance: changes for the upcoming release should
go under the '## Upcoming Release' header in past tense. Release tooling
fills in '## YYYY.MM.DD - Version 0.1.0' at publish time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 20, 2026 14:15
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

# Conflicts:
#	tools/CreateMappings_rules.json
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Introduces the first preview (private preview) release of the new Az.ChangeSafety Azure PowerShell module, including module packaging, generated help/docs, AutoRest assets, and Pester tests/recordings.

Changes:

  • Adds Az.ChangeSafety module project/manifest/changelog plus markdown help for cmdlets.
  • Adds AutoRest-generated module content, UX metadata, example docs, and custom cmdlets for simplified -Targets handling.
  • Wires the module into repo tooling (preview bundle dependency, module mappings, static analysis exceptions, module listing doc).

Reviewed changes

Copilot reviewed 81 out of 83 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/StaticAnalysis/Exceptions/Az.ChangeSafety/SignatureIssues.csv Adds static analysis exception baselines for initial module surface.
tools/CreateMappings_rules.json Registers ChangeSafety module-to-alias mapping for tooling.
tools/AzPreview/AzPreview.psd1 Adds Az.ChangeSafety to the AzPreview required modules list.
src/ChangeSafety/ChangeSafety/help/Update-AzChangeSafetyStageProgression.md Adds cmdlet help markdown for updating stage progressions.
src/ChangeSafety/ChangeSafety/help/Update-AzChangeSafetyStageMap.md Adds cmdlet help markdown for updating stage maps.
src/ChangeSafety/ChangeSafety/help/Remove-AzChangeSafetyStageProgression.md Adds cmdlet help markdown for removing stage progressions.
src/ChangeSafety/ChangeSafety/help/Remove-AzChangeSafetyStageMap.md Adds cmdlet help markdown for removing stage maps.
src/ChangeSafety/ChangeSafety/help/Remove-AzChangeSafetyChangeRecord.md Adds cmdlet help markdown for removing change records.
src/ChangeSafety/ChangeSafety/help/New-AzChangeSafetyStageProgression.md Adds cmdlet help markdown for creating stage progressions.
src/ChangeSafety/ChangeSafety/help/New-AzChangeSafetyStageMap.md Adds cmdlet help markdown for creating stage maps.
src/ChangeSafety/ChangeSafety/help/Get-AzChangeSafetyStageProgression.md Adds cmdlet help markdown for getting/listing stage progressions.
src/ChangeSafety/ChangeSafety/help/Get-AzChangeSafetyStageMap.md Adds cmdlet help markdown for getting/listing stage maps.
src/ChangeSafety/ChangeSafety/help/Get-AzChangeSafetyChangeRecord.md Adds cmdlet help markdown for getting/listing change records.
src/ChangeSafety/ChangeSafety/help/Az.ChangeSafety.md Adds module landing page for cmdlet documentation.
src/ChangeSafety/ChangeSafety/Properties/AssemblyInfo.cs Defines assembly metadata for the module wrapper project.
src/ChangeSafety/ChangeSafety/ChangeSafety.csproj Adds the module wrapper project for build/packaging and help assets.
src/ChangeSafety/ChangeSafety/ChangeLog.md Adds module changelog with upcoming release notes.
src/ChangeSafety/ChangeSafety/Az.ChangeSafety.psd1 Adds the module manifest defining exports and dependencies.
src/ChangeSafety/ChangeSafety.Autorest/utils/Unprotect-SecureString.ps1 Adds utility script to convert SecureString to plaintext.
src/ChangeSafety/ChangeSafety.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 Adds helper to get subscription id safely for tests.
src/ChangeSafety/ChangeSafety.Autorest/test/utils.ps1 Adds Pester test utilities and environment setup helpers.
src/ChangeSafety/ChangeSafety.Autorest/test/loadEnv.ps1 Adds environment loader for test playback/live modes.
src/ChangeSafety/ChangeSafety.Autorest/test/env.json Adds committed test environment defaults for playback.
src/ChangeSafety/ChangeSafety.Autorest/test/Update-AzChangeSafetyStageProgression.Tests.ps1 Adds Pester tests for updating stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/test/Update-AzChangeSafetyStageMap.Tests.ps1 Adds Pester tests for updating stage maps.
src/ChangeSafety/ChangeSafety.Autorest/test/Update-AzChangeSafetyStageMap.Recording.json Adds recorded HTTP interactions for stage map update tests.
src/ChangeSafety/ChangeSafety.Autorest/test/Update-AzChangeSafetyChangeRecord.Tests.ps1 Adds Pester tests for updating change records.
src/ChangeSafety/ChangeSafety.Autorest/test/Update-AzChangeSafetyChangeRecord.Recording.json Adds recorded HTTP interactions for change record update tests.
src/ChangeSafety/ChangeSafety.Autorest/test/Remove-AzChangeSafetyStageProgression.Tests.ps1 Adds Pester tests for removing stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/test/Remove-AzChangeSafetyStageMap.Tests.ps1 Adds Pester tests for removing stage maps.
src/ChangeSafety/ChangeSafety.Autorest/test/Remove-AzChangeSafetyStageMap.Recording.json Adds recorded HTTP interactions for stage map remove tests.
src/ChangeSafety/ChangeSafety.Autorest/test/Remove-AzChangeSafetyChangeRecord.Tests.ps1 Adds Pester tests for removing change records.
src/ChangeSafety/ChangeSafety.Autorest/test/README.md Adds documentation for test modes and authoring guidance.
src/ChangeSafety/ChangeSafety.Autorest/test/New-AzChangeSafetyStageProgression.Tests.ps1 Adds Pester tests for creating stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/test/New-AzChangeSafetyStageMap.Tests.ps1 Adds Pester tests for creating stage maps.
src/ChangeSafety/ChangeSafety.Autorest/test/New-AzChangeSafetyStageMap.Recording.json Adds recorded HTTP interactions for stage map create tests.
src/ChangeSafety/ChangeSafety.Autorest/test/New-AzChangeSafetyChangeRecord.Tests.ps1 Adds Pester tests for creating change records.
src/ChangeSafety/ChangeSafety.Autorest/test/Get-AzChangeSafetyStageProgression.Tests.ps1 Adds Pester tests for getting/listing stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/test/Get-AzChangeSafetyStageMap.Tests.ps1 Adds Pester tests for getting/listing stage maps.
src/ChangeSafety/ChangeSafety.Autorest/test/Get-AzChangeSafetyChangeRecord.Tests.ps1 Adds Pester tests for getting/listing change records.
src/ChangeSafety/ChangeSafety.Autorest/resources/README.md Adds guidance for non-packaged resource artifacts.
src/ChangeSafety/ChangeSafety.Autorest/resources/CmdletSurface-__NoProfiles.md Captures the cmdlet surface snapshot for review/auditing.
src/ChangeSafety/ChangeSafety.Autorest/how-to.md Adds developer how-to documentation for building/testing/packing.
src/ChangeSafety/ChangeSafety.Autorest/generate-info.json Adds generator run metadata for reproducibility.
src/ChangeSafety/ChangeSafety.Autorest/examples/Update-AzChangeSafetyStageProgression.md Adds examples for updating stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/examples/Update-AzChangeSafetyStageMap.md Adds examples for updating stage maps.
src/ChangeSafety/ChangeSafety.Autorest/examples/Update-AzChangeSafetyChangeRecord.md Adds examples for updating change records.
src/ChangeSafety/ChangeSafety.Autorest/examples/Remove-AzChangeSafetyStageProgression.md Adds examples for removing stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/examples/Remove-AzChangeSafetyStageMap.md Adds examples for removing stage maps.
src/ChangeSafety/ChangeSafety.Autorest/examples/Remove-AzChangeSafetyChangeRecord.md Adds examples for removing change records.
src/ChangeSafety/ChangeSafety.Autorest/examples/New-AzChangeSafetyStageProgression.md Adds examples for creating stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/examples/New-AzChangeSafetyStageMap.md Adds examples for creating stage maps.
src/ChangeSafety/ChangeSafety.Autorest/examples/New-AzChangeSafetyChangeRecord.md Adds examples for creating change records.
src/ChangeSafety/ChangeSafety.Autorest/examples/Get-AzChangeSafetyStageProgression.md Adds examples for getting/listing stage progressions.
src/ChangeSafety/ChangeSafety.Autorest/examples/Get-AzChangeSafetyStageMap.md Adds examples for getting/listing stage maps.
src/ChangeSafety/ChangeSafety.Autorest/examples/Get-AzChangeSafetyChangeRecord.md Adds examples for getting/listing change records.
src/ChangeSafety/ChangeSafety.Autorest/docs/README.md Adds documentation guidance for generated docs output.
src/ChangeSafety/ChangeSafety.Autorest/custom/Update-AzChangeSafetyChangeRecord_Targets.ps1 Adds a custom cmdlet variant to update change records via simplified -Targets.
src/ChangeSafety/ChangeSafety.Autorest/custom/README.md Adds guidance for implementing and exporting custom cmdlets.
src/ChangeSafety/ChangeSafety.Autorest/custom/New-AzChangeSafetyChangeRecord_Targets.ps1 Adds a custom cmdlet variant to create change records via simplified -Targets.
src/ChangeSafety/ChangeSafety.Autorest/custom/Az.ChangeSafety.custom.psm1 Loads private/internal modules and exports custom script cmdlets.
src/ChangeSafety/ChangeSafety.Autorest/custom/Any.cs Fixes serialization for free-form IAny model values.
src/ChangeSafety/ChangeSafety.Autorest/UX/Microsoft.ChangeSafety/stageMaps.json Adds UX/help metadata for StageMap commands.
src/ChangeSafety/ChangeSafety.Autorest/UX/Microsoft.ChangeSafety/changeRecords.json Adds UX/help metadata for ChangeRecord commands.
src/ChangeSafety/ChangeSafety.Autorest/UX/Microsoft.ChangeSafety/changeRecords-stageProgressions.json Adds UX/help metadata for StageProgression commands.
src/ChangeSafety/ChangeSafety.Autorest/README.md Adds AutoRest module readme and generation directives.
src/ChangeSafety/ChangeSafety.Autorest/Properties/AssemblyInfo.cs Adds assembly metadata for AutoRest-generated private assembly.
src/ChangeSafety/ChangeSafety.Autorest/.gitignore Adds ignores for generated/build artifacts under AutoRest module folder.
src/ChangeSafety/ChangeSafety.Autorest/.gitattributes Adds attributes baseline for text normalization.
documentation/azure-powershell-modules.md Registers Az.ChangeSafety in the repo’s module inventory documentation.
Comments suppressed due to low confidence (6)

src/ChangeSafety/ChangeSafety.Autorest/test/loadEnv.ps1:1

  • The fallback env path construction and subsequent file read are inconsistent. Line 23 uses single quotes, so $envFile is not expanded (the path becomes literally ..\\$envFile). Also, line 27 ignores $envFilePath and always reads from (Join-Path $PSScriptRoot $envFile), which breaks playback if the file exists only at the computed fallback path. Use $envFilePath consistently for the read, and build the fallback path without single-quoted variable interpolation (e.g., Join-Path (Join-Path $PSScriptRoot '..') $envFile).
    src/ChangeSafety/ChangeSafety/help/Update-AzChangeSafetyStageProgression.md:1
  • The examples use -Name, but the cmdlet syntax/parameters in this same help file indicate the parameter is -StageProgressionName (and StageProgressionName shows no alias). This makes the docs misleading and likely breaks copy/paste. Update the StageProgression examples across help + examples markdown to use -StageProgressionName, or add an alias Name on the StageProgressionName parameter so both forms work.
    src/ChangeSafety/ChangeSafety.Autorest/utils/Unprotect-SecureString.ps1:1
  • This utility converts SecureString to plaintext, which is a high-risk operation if it ships as part of the module (easy to misuse, increases chance of secret exposure in logs/telemetry). If this is only needed for tests/dev tooling, move it under a test-only or non-packaged folder, or ensure it is not included in the built/packed module outputs. If it must remain, consider hardening by clearly marking it as internal-only and avoiding any automatic export/discovery paths.
    src/ChangeSafety/ChangeSafety/Properties/AssemblyInfo.cs:1
  • Correct the product name casing: use 'PowerShell' instead of 'Powershell' in the assembly title.
    src/ChangeSafety/ChangeSafety/ChangeLog.md:1
  • The changelog format doesn’t follow the header convention described in the file’s own template (dated release headings like ## YYYY.MM.DD - Version X.Y.Z). Also, ## Version 0.1.0 is empty. Consider replacing ## Version 0.1.0 with a dated entry and move the current bullets under that entry when publishing, keeping ## Upcoming Release only for unreleased changes.
    src/ChangeSafety/ChangeSafety.Autorest/test/Update-AzChangeSafetyStageMap.Tests.ps1:1
  • This test can leave (or reuse) a real StageMap with the hardcoded name, and it suppresses creation errors. In live/record runs, a pre-existing StageMap with different stages can make the subsequent update assertions flaky. Prefer explicit cleanup (Remove-AzChangeSafetyStageMap -ErrorAction SilentlyContinue) before creation, or generate a unique name per test run and clean it up in AfterAll.

Comment on lines +108 to +133
if (value is decimal dec)
{
return new JsonNumber((double)dec);
}

// Handle arrays/collections
if (value is IList list)
{
var array = new XNodeArray();
foreach (var item in list)
{
array.SafeAdd(SerializeValue(item));
}
return array;
}

// Handle object arrays
if (value is object[] objArray)
{
var array = new XNodeArray();
foreach (var item in objArray)
{
array.SafeAdd(SerializeValue(item));
}
return array;
}
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

The module manifest (Az.ChangeSafety.psd1) references
FormatsToProcess = 'ChangeSafety.Autorest/Az.ChangeSafety.format.ps1xml'
but autorest did not generate this file (no custom format views).

This caused all CI checks (Analyze, Test linux, Test windows) to fail with:
  The member 'FormatsToProcess' in the module manifest is not valid:
  Cannot find path '...Az.ChangeSafety.format.ps1xml' because it does not exist.

Add a minimal empty format definitions file to satisfy the manifest reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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.

Sync with main branch and only update the files under folers whose names contain "ChangeSafety".

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.

4 participants