Azure / Azure/azure-sdk-tools

eng/common sync pipeline emits 'Detected characters in arguments' warning in Push changes steps

Open Beginner friendly
#16,517 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 2h
Merged PRs (30d)
130

Description

## Summary

The eng/common sync pipeline emits an Azure DevOps warning during the **Push changes for creating Sync PRs** step (and the sibling **Push changes for Queueing Test Pipeline** step):

> `##[warning]Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (\`).`
> More info: https://aka.ms/ado/75787

## Where

`eng/pipelines/templates/steps/sync-directory.yml` — the `PowerShell@2` tasks that invoke `git-branch-push.ps1`:

- **Push changes for creating Sync PRs** (`-SkipCommit $${{ parameters.SkipCheckingForChanges }}` renders to a literal `$false`/`$true`)
- **Push changes for Queueing Test Pipeline** (`-AmendCommit $True`)

The `arguments` string is passed to the ADO `PowerShell@2` task, which flags the literal `$` (from `$false`/`$true`/`$True`) — and potentially other special characters in `-CommitMsg` / `-GitUrl` — as characters that may not be executed correctly by the shell.

## Repro

Observed in the internal `js - sync - eng-common` style sync build for PR #16507:
- Build: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6621392
- Step "Push changes for creating Sync PRs", warning on the "Generating script" line.

This is not specific to that PR — it fires on every eng/common sync run.

## Suggested fix

Avoid passing PowerShell boolean literals (`$true`/`$false`) directly in the ADO task `arguments` field. Options:
- Pass the value as a plain string (e.g. `-SkipCommit true`) and coerce inside `git-branch-push.ps1`, or
- Use a `[switch]` parameter and conditionally include the flag, or
- Escape the special characters per https://aka.ms/ado/75787.

## Impact

Warning only — the sync currently succeeds. Cleaning it up removes noise from every eng/common sync build and avoids future shell-escaping surprises.

Contributor guide

Open the contributing guide

Research direction

Start with eng/pipelines/templates/steps/sync-directory.yml and inspect the PowerShell@2 tasks named "Push changes for creating Sync PRs" and "Push changes for Queueing Test Pipeline". Read the invoked git-branch-push.ps1 parameter handling before choosing how to pass boolean values. Done means the sync pipeline still succeeds and no longer emits the Azure DevOps "Detected characters in arguments" warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, powershell
Domain
ci-cd
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.