Skip to content

Common functions added for auto-release scenario#16293

Open
raych1 wants to merge 3 commits into
mainfrom
users/raych1/common-script-for-auto-release
Open

Common functions added for auto-release scenario#16293
raych1 wants to merge 3 commits into
mainfrom
users/raych1/common-script-for-auto-release

Conversation

@raych1

@raych1 raych1 commented Jul 7, 2026

Copy link
Copy Markdown
Member

This pull request introduces shared PowerShell scripts for auto-release operations in Azure SDK repositories, focusing on reusable logic for identifying eligible pull requests and constructing diff objects for release automation. It also adds new utility functions for interacting with the GitHub API and for Azure DevOps pipeline logging.

Key additions and improvements:

  • Added AutoRelease-Operations.ps1, which provides functions to select the correct auto-release pull request for a commit (Get-GitHubAutoReleasePullRequestForCommit) and to construct a standardized diff object from pull request files (New-GitHubPullRequestDiffObject). This centralizes and standardizes auto-release logic across repositories.

  • Added Get-GitHubPullRequestsForCommit to retrieve pull requests associated with a commit SHA, and Get-GitHubPullRequestFiles to fetch all files changed in a pull request with pagination support.

  • Introduced ConvertTo-DevOpsLoggingValue and Set-PipelineVariable functions to safely set pipeline variables and handle value escaping for Azure DevOps logging.

Copilot AI review requested due to automatic review settings July 7, 2026 19:38
@raych1 raych1 requested a review from a team as a code owner July 7, 2026 19:38

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

This PR adds shared PowerShell helpers under eng/common/scripts to support an auto-release workflow by (1) standardizing Azure Pipelines logging/variable setting and (2) providing GitHub API + policy logic to resolve the “eligible PR” and generate a PR-diff-shaped object for downstream package detection.

Changes:

  • Add ConvertTo-DevOpsLoggingValue and Set-PipelineVariable helpers to centralize Azure Pipelines variable emission.
  • Extend Invoke-GitHubAPI.ps1 with helpers to fetch PRs associated with a commit SHA and to list PR files with pagination.
  • Introduce AutoRelease-Operations.ps1 implementing the auto-release PR selection policy and generating a diff.json-compatible object from GitHub PR file data.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
eng/common/scripts/logging.ps1 Adds Azure Pipelines logging/variable helper functions.
eng/common/scripts/Invoke-GitHubAPI.ps1 Adds GitHub REST helpers needed for commit→PR resolution and PR files listing.
eng/common/scripts/AutoRelease-Operations.ps1 Adds auto-release policy logic and PR-diff object shaping for package detection.

Comment thread eng/common/scripts/logging.ps1 Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@raych1 raych1 self-assigned this Jul 7, 2026
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow


do {
$uri = "$GithubAPIBaseURI/$RepoId/pulls/$PullRequestNumber/files?per_page=$pageSize&page=$page"
$response = Invoke-RestMethod `

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[not blocking] Current versions of the GH CLI will get results and do paging for you.

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

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