Skip to content

Sync eng/common directory with azure-sdk-tools for PR 16606 - #49970

Open
azure-sdk-automation[bot] wants to merge 1 commit into
mainfrom
sync-eng-common-jeremymeng-fix-ado-shell-arg-warning-16606
Open

Sync eng/common directory with azure-sdk-tools for PR 16606#49970
azure-sdk-automation[bot] wants to merge 1 commit into
mainfrom
sync-eng-common-jeremymeng-fix-ado-shell-arg-warning-16606

Conversation

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#16606 See eng/common workflow

Copilot agent :copilot: (on behalf of @jeremymeng): The non-PR branch of
eng/common/pipelines/templates/steps/save-package-properties.yml passed
`-AddDevVersion:($env:SETDEVVERSION -eq 'true')` in the Powershell@2 task
`arguments:`. The parentheses, `$`, and quotes trip the ADO agent argument
sanitizer, producing:

  ##[warning]Detected characters in arguments that may not be executed
  correctly by the shell. (https://aka.ms/ado/75787)

`-AddDevVersion` is a [switch] on Save-Package-Properties.ps1, and
`SetDevVersion` is a runtime pipeline variable (set in
daily-dev-build-variable.yml), so a compile-time `${{ if }}` cannot read it.

Fix: split the task into two condition-gated variants keyed off
`variables['SetDevVersion']` -- one that omits `-AddDevVersion` and one that
passes it as a bare switch. Exactly one variant runs, preserving the original
behavior while keeping the arguments free of parenthesized `$env:` expressions
so the sanitizer no longer warns.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78fef37c-2ea7-4e0f-aa89-a70a62e059b9
Copilot AI review requested due to automatic review settings July 28, 2026 21:36
@azure-sdk-automation
azure-sdk-automation Bot requested a review from a team as a code owner July 28, 2026 21:36
@azure-sdk-automation azure-sdk-automation Bot added EngSys This issue is impacting the engineering system. Central-EngSys This issue is owned by the Engineering System team. labels Jul 28, 2026

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

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Updates the Azure DevOps pipeline step for saving package properties to avoid agent argument sanitization issues by splitting execution into two runtime-gated PowerShell tasks.

Changes:

  • Replaces a parenthesized PowerShell expression passed via arguments: with two separate tasks gated by condition.
  • Adds inline documentation explaining the sanitizer workaround and behavior parity goal.

Comment on lines 84 to +90
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion:($env:SETDEVVERSION -eq 'true')
pwsh: true
workingDirectory: '${{ parameters.WorkingDirectory }}'

- task: Powershell@2
Comment on lines +95 to +98
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion
# -AddDevVersion:($env:SETDEVVERSION -eq 'true') behavior.
- task: Powershell@2
displayName: Save package properties
condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'))

- task: Powershell@2
displayName: Save package properties (with dev version)
condition: and(succeeded(), eq(variables['SetDevVersion'], 'true'))
Comment on lines 79 to 80
- task: Powershell@2
displayName: Save package properties
Comment on lines +90 to +91
- task: Powershell@2
displayName: Save package properties (with dev version)
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
34 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Labels

Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants