Sync eng/common directory with azure-sdk-tools for PR 16606 - #49970
Open
azure-sdk-automation[bot] wants to merge 1 commit into
Open
Sync eng/common directory with azure-sdk-tools for PR 16606#49970azure-sdk-automation[bot] wants to merge 1 commit into
azure-sdk-automation[bot] wants to merge 1 commit into
Conversation
Copilot agent(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
Contributor
There was a problem hiding this comment.
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 bycondition. - 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: 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. |
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.
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#16606 See eng/common workflow