Skip to content

Move inlined scripts to checked in files - #50101

Merged
Alan Zimmer (alzimmermsft) merged 4 commits into
Azure:mainfrom
alzimmermsft:AzEng_ReviewYaml
Aug 12, 2026
Merged

Move inlined scripts to checked in files#50101
Alan Zimmer (alzimmermsft) merged 4 commits into
Azure:mainfrom
alzimmermsft:AzEng_ReviewYaml

Conversation

@alzimmermsft

Copy link
Copy Markdown
Member

Description

Updates a few spots where YAML was using inline scripts to use checked in files to reduce YAML sizes. This resolves an issue where a few pipelines are failing due to YAML sizes exceeding limits in Azure DevOps.

This PR has related work in azure-sdk-tools for eng/common scripts: Azure/azure-sdk-tools#16705

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
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.

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

Refactors Azure DevOps pipeline templates to replace several inline PowerShell script blocks with checked-in .ps1 files, reducing YAML size to avoid Azure DevOps YAML size limit failures.

Changes:

  • Replaced inline pwsh: blocks in pipeline templates with PowerShell@2 tasks that reference checked-in scripts.
  • Added new pipeline script files under eng/pipelines/scripts/ to encapsulate previously inlined behavior.
  • Removed the dedicated publish-http-fault-injector-logs.yml steps template and inlined its behavior as a PowerShell@2 file-based task.

Reviewed changes

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

Show a summary per file
File Description
eng/pipelines/templates/steps/publish-http-fault-injector-logs.yml Removed inlined script template (replaced by checked-in script usage).
eng/pipelines/templates/steps/build-and-test.yml Switched inline PowerShell blocks to PowerShell@2 file-based tasks.
eng/pipelines/templates/jobs/live.tests.yml Updated HTTP fault injector log publishing step to use a checked-in script.
eng/pipelines/templates/jobs/ci.versions.tests.yml Replaced inline test-proxy log dumping with a checked-in script.
eng/pipelines/templates/jobs/ci.tests.yml Replaced inline test-proxy log dumping with a checked-in script and adjusted comments.
eng/pipelines/scripts/Write-TestProxyLogs.ps1 New script to emit grouped test-proxy and test-proxy-error logs.
eng/pipelines/scripts/Update-TestNamesForReporting.ps1 New script to rewrite JUnit testcase names for improved reporting.
eng/pipelines/scripts/Set-PowerShellJavaHome.ps1 New script to set PowerShellJavaHome from the Java version selection.
eng/pipelines/scripts/Publish-FaultInjectorLogs.ps1 New script to zip and publish http-fault-injector logs for troubleshooting.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/pipelines/scripts/Publish-FaultInjectorLogs.ps1 Outdated
Comment thread eng/pipelines/templates/jobs/live.tests.yml
Comment thread eng/pipelines/templates/steps/build-and-test.yml
Comment thread eng/pipelines/templates/steps/build-and-test.yml
Comment thread eng/pipelines/scripts/Write-TestProxyLogs.ps1 Outdated

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

eng/pipelines/templates/steps/build-and-test.yml:259

  • workingDirectory is an input of PowerShell@2, not a step-level property (see eng/pipelines/templates/steps/run-and-validate-linting.yml:43-48). At this indentation Azure Pipelines can reject the step as an unexpected property; if it is ignored, the script runs from the repository root and no longer limits its recursive XML scan to sdk. Move it under inputs.
    workingDirectory: $(System.DefaultWorkingDirectory)/sdk

eng/pipelines/scripts/Write-TestProxyLogs.ps1:9

  • The callers pass -LogFileDirectory, but this script has no param block. PowerShell therefore leaves the supplied tokens in $args and $LogFileDirectory remains unset, so the task does not reliably search $(Build.SourcesDirectory) and may fail when binding the null path. Declare the documented parameter before using it.
$files = @(Get-ChildItem -Path $LogFileDirectory -Filter test-proxy.log)

@alzimmermsft
Alan Zimmer (alzimmermsft) merged commit 3c3bd28 into Azure:main Aug 12, 2026
17 of 18 checks passed
@alzimmermsft
Alan Zimmer (alzimmermsft) deleted the AzEng_ReviewYaml branch August 12, 2026 17:18
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