Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Description

Implements consumption of SdkReleaseType from input JSON to automatically manage package version suffixes in TypeSpec-generated SDKs. Previously, a warning was emitted when this field was provided; now it drives version updates.

Changes

  • Added Update-PackageVersionSuffix function in eng/scripts/Invoke-GenerateAndBuildV2.ps1:

    • beta → adds -beta.1 suffix if not present (e.g., 1.0.01.0.0-beta.1)
    • stable → removes beta suffix (e.g., 1.0.0-beta.51.0.0)
    • Invoked after TypeSpec generation, before build/pack
    • XML manipulation via InnerText property for robust csproj updates
  • Added unit tests in eng/scripts/tests/Update-PackageVersionSuffix.tests.ps1:

    • Covers add/remove suffix scenarios, idempotency, and edge cases
    • Includes link to Pester documentation for developers unfamiliar with the testing framework

Follows pattern established in PR #53750 (api-version consumption). Changelog updates are out of scope per issue requirements.


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • 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.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.
Original prompt

This section details on the original issue you should resolve

<issue_title>Consume SdkReleaseType in automation script</issue_title>
<issue_description>Similar to how we consumed the api-version in #53156
We need to read in the SdkReleaseType value from the input JSON. If it is beta, we should ensure that the csproj that for the package has the corresponding beta suffix,e.g. 1.0.0-beta.1. Usually this will be what the csproj is set to already. If the value is stable, then we should remove the beta suffix. We don't need to validate the input, it is either beta or stable so we can use an if/else. Updating the changelog is out of scope. </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 7, 2025 23:13
@JoshLove-msft JoshLove-msft marked this pull request as ready for review November 7, 2025 23:20
Copilot AI review requested due to automatic review settings November 7, 2025 23:20
Copy link
Contributor

Copilot AI left a comment

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 functionality to automatically update package version suffixes based on the SDK release type (beta or stable). The implementation includes a new Update-PackageVersionSuffix function that modifies .csproj files to add or remove beta version suffixes.

Key changes:

  • Introduced Update-PackageVersionSuffix function to handle version suffix updates based on release type
  • Integrated the function into the TypeSpec generation workflow to automatically update package versions
  • Added comprehensive unit tests covering various scenarios including edge cases

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
eng/scripts/tests/Update-PackageVersionSuffix.tests.ps1 New test file with comprehensive unit tests for the Update-PackageVersionSuffix function
eng/scripts/Invoke-GenerateAndBuildV2.ps1 Added Update-PackageVersionSuffix function and integrated it into the TypeSpec generation workflow

Copilot AI changed the title [WIP] Consume SdkReleaseType in automation script Consume SdkReleaseType in automation script to update package versions Nov 7, 2025
Copilot AI requested a review from JoshLove-msft November 7, 2025 23:24
Copilot finished work on behalf of JoshLove-msft November 7, 2025 23:24
@JoshLove-msft JoshLove-msft enabled auto-merge (squash) November 7, 2025 23:34
Copilot finished work on behalf of JoshLove-msft November 10, 2025 17:17
@JoshLove-msft
Copy link
Member

/check-enforcer evaluate

@JoshLove-msft JoshLove-msft merged commit 5c4bb61 into main Nov 10, 2025
21 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/consume-sdk-release-type branch November 10, 2025 19:13
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.

Consume SdkReleaseType in automation script

4 participants