Skip to content

{CI} enforce WinPS 5.1 AutoGen module validation and failure propagation#29545

Draft
YangAn-microsoft wants to merge 2 commits intoAzure:mainfrom
YangAn-microsoft:test/unicode-parse-issue
Draft

{CI} enforce WinPS 5.1 AutoGen module validation and failure propagation#29545
YangAn-microsoft wants to merge 2 commits intoAzure:mainfrom
YangAn-microsoft:test/unicode-parse-issue

Conversation

@YangAn-microsoft
Copy link
Copy Markdown

@YangAn-microsoft YangAn-microsoft commented May 9, 2026

Summary

This change hardens AutoGen module validation in CI so Windows PowerShell 5.1 parse/import issues are detected reliably and fail the job when appropriate.

Problem

A previous issue with non-ASCII operator characters passed CI even though it failed in Windows PowerShell 5.1.
The pipeline behavior allowed gaps where validation steps could still run incorrectly or not propagate failure clearly.

What changed

  • Added/kept explicit WinPS 5.1 AutoGen validation in test flow on Windows agents.
  • Used an explicit Windows PowerShell 5.1 executable path:
    • powershell.exe
  • Updated step conditions to include succeeded() so these validations do not bypass earlier failures.
  • Replaced separator detection logic with System.IO.Path.PathSeparator for WinPS compatibility.
  • Removed continueOnError on the WinPS AutoGen validation step so failures are not tolerated.
  • Captured and checked WinPS process exit code in pipeline script and throw on non-zero to propagate failure.

Why this is safe

  • Scope is limited to CI test orchestration.
  • No product cmdlet/runtime behavior changes.
  • Behavior is stricter only for the intended validation path.

Validation

  • Branch includes reviewer-requested fixes for:
    • condition handling
    • path separator handling in WinPS
    • failure propagation from WinPS child process
  • Expected outcome: parse/import failures in WinPS 5.1 fail CI deterministically.

Notes

  • Experimental test file was removed from the PR branch.
  • PR history was squashed/cleaned before final updates.

If you want, I can also give you a shorter version in the exact Azure PowerShell PR template style.

Copilot AI review requested due to automatic review settings May 9, 2026 03:47
@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.

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

Adds a standalone PowerShell script intended to validate that Az.DataProtection can be loaded and to surface parsing failures (specifically the en-dash U+2013 vs hyphen U+002D operator issue that can break Windows PowerShell 5.1).

Changes:

  • Introduces TEST_MODULE_LOAD.ps1 to validate presence of the built Az.DataProtection manifest and run Test-ModuleManifest against it.

Comment thread TEST_MODULE_LOAD.ps1 Outdated
Comment thread TEST_MODULE_LOAD.ps1 Outdated
Comment thread TEST_MODULE_LOAD.ps1 Outdated
Comment thread TEST_MODULE_LOAD.ps1 Outdated
Comment thread TEST_MODULE_LOAD.ps1 Outdated
YangAn-microsoft added a commit to YangAn-microsoft/azure-powershell that referenced this pull request May 10, 2026
- Add WinPS 5.1 test step to test-steps.yml and test-steps.ps1
- Tests run on Windows agents alongside PowerShell Core tests
- Catches Unicode and parsing errors that only occur in legacy PowerShell
- Fixes CI gap where PR Azure#29545 (with en-dash issue) passed all checks
- Implements Option 2: dual-runtime per-module test coverage
- Estimated pipeline time impact: +2 min (acceptable for comprehensive coverage)
Copilot AI review requested due to automatic review settings May 10, 2026 07:35
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

Comment thread TEST_MODULE_LOAD.ps1 Outdated
Comment thread TEST_MODULE_LOAD.ps1 Outdated
Comment thread .azure-pipelines/util/test-steps.yml
Comment thread .azure-pipelines/util/test-steps.yml Outdated
Comment thread .azure-pipelines/PipelineSteps/test-steps.ps1 Outdated
- Run AutoGen module tests under Windows PowerShell 5.1 on Windows agents\n- Keep existing PowerShell Core coverage\n- Use explicit WinPS 5.1 executable path in test steps\n- Exclude experimental TEST_MODULE_LOAD.ps1
Copilot AI review requested due to automatic review settings May 10, 2026 23:29
@YangAn-microsoft YangAn-microsoft force-pushed the test/unicode-parse-issue branch from 1124ce3 to 19c7b46 Compare May 10, 2026 23:29
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

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

Comment thread .azure-pipelines/util/test-steps.yml
Comment thread .azure-pipelines/util/test-steps.yml Outdated
Comment thread .azure-pipelines/util/test-steps.yml Outdated
Comment thread .azure-pipelines/PipelineSteps/test-steps.ps1
- Add succeeded() to AutoGen step conditions\n- Use PathSeparator in Windows PowerShell step\n- Remove continueOnError from WinPS AutoGen step\n- Propagate non-zero exit code from WinPS child process
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@YangAn-microsoft YangAn-microsoft changed the title [test] Add module load validation test for DataProtection unicode par… {CI}: enforce WinPS 5.1 AutoGen module validation and failure propagation May 11, 2026
@YangAn-microsoft YangAn-microsoft changed the title {CI}: enforce WinPS 5.1 AutoGen module validation and failure propagation {CI} enforce WinPS 5.1 AutoGen module validation and failure propagation May 11, 2026
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.

3 participants