Skip to content

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

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#4903
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
@azure-pipelines

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

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 pipeline step to avoid Azure DevOps agent argument sanitization issues by removing a parenthesized $env: expression from arguments and gating behavior via runtime conditions.

Changes:

  • Split “Save package properties” into two Powershell@2 tasks with mutually exclusive conditions.
  • Pass -AddDevVersion only when SetDevVersion == 'true'.
  • Added inline comments documenting the sanitizer workaround and intended behavior parity.

Comment on lines 84 to +88
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion:($env:SETDEVVERSION -eq 'true')
pwsh: true
workingDirectory: '${{ parameters.WorkingDirectory }}'
# -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 100
- task: Powershell@2
displayName: Save package properties
condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'))
inputs:
filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion:($env:SETDEVVERSION -eq 'true')
pwsh: true
workingDirectory: '${{ parameters.WorkingDirectory }}'

- task: Powershell@2
displayName: Save package properties (with dev version)
condition: and(succeeded(), eq(variables['SetDevVersion'], 'true'))
inputs:
filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion
pwsh: true
workingDirectory: '${{ parameters.WorkingDirectory }}'
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