Common functions added for auto-release scenario#16293
Conversation
There was a problem hiding this comment.
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-DevOpsLoggingValueandSet-PipelineVariablehelpers to centralize Azure Pipelines variable emission. - Extend
Invoke-GitHubAPI.ps1with helpers to fetch PRs associated with a commit SHA and to list PR files with pagination. - Introduce
AutoRelease-Operations.ps1implementing the auto-release PR selection policy and generating adiff.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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
|
||
| do { | ||
| $uri = "$GithubAPIBaseURI/$RepoId/pulls/$PullRequestNumber/files?per_page=$pageSize&page=$page" | ||
| $response = Invoke-RestMethod ` |
There was a problem hiding this comment.
[not blocking] Current versions of the GH CLI will get results and do paging for you.
|
The following pipelines have been queued for testing: |
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-GitHubPullRequestsForCommitto retrieve pull requests associated with a commit SHA, andGet-GitHubPullRequestFilesto fetch all files changed in a pull request with pagination support.Introduced
ConvertTo-DevOpsLoggingValueandSet-PipelineVariablefunctions to safely set pipeline variables and handle value escaping for Azure DevOps logging.