Skip to content

Use sdkReleaseType for tagIsStable in TypeSpec projects#45768

Merged
msyyc merged 6 commits intomainfrom
fix/tag-is-stable-typespec
Mar 19, 2026
Merged

Use sdkReleaseType for tagIsStable in TypeSpec projects#45768
msyyc merged 6 commits intomainfrom
fix/tag-is-stable-typespec

Conversation

@msyyc
Copy link
Member

@msyyc msyyc commented Mar 18, 2026

Changes

For TypeSpec projects, determine tagIsStable from sdkReleaseType pipeline input instead of using judge_tag_preview. Swagger projects continue to use judge_tag_preview as before.

What changed

  • Extract sdkReleaseType from pipeline input data
  • Add is_tsp flag to distinguish TypeSpec from Swagger codegen
  • TypeSpec: tagIsStable = (sdkReleaseType == "stable")
  • Swagger: tagIsStable = not judge_tag_preview(...)
  • Add test_sdk_generator.py with 9 test cases covering the new logic

Files changed

  • eng/tools/azure-sdk-tools/packaging_tools/sdk_generator.py — Updated tagIsStable logic
  • eng/tools/azure-sdk-tools/tests/test_sdk_generator.py — New test file

For TypeSpec projects, determine tagIsStable from sdkReleaseType input
instead of using judge_tag_preview. Swagger projects continue to use
judge_tag_preview as before.

- Extract sdkReleaseType from pipeline input data
- Add is_tsp flag to distinguish TypeSpec from Swagger codegen
- TypeSpec: tagIsStable = (sdkReleaseType == 'stable')
- Swagger: tagIsStable = not judge_tag_preview(...)
- Add test_sdk_generator.py with 9 test cases covering the new logic
@msyyc
Copy link
Member Author

msyyc commented Mar 18, 2026

@copilot fix the following ci error:

Run black --check --config eng/black-pyproject.toml eng/tools/azure-sdk-tools --exclude 'templates'
would reformat /home/runner/work/azure-sdk-for-python/azure-sdk-for-python/eng/tools/azure-sdk-tools/tests/test_sdk_generator.py

Oh no! 💥 💔 💥
1 file would be reformatted, 207 files would be left unchanged.
Error: Process completed with exit code 1.

Copy link
Contributor

Copilot AI commented Mar 18, 2026

@msyyc I've opened a new pull request, #45769, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Fix Black formatting in test_sdk_generator.py

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@msyyc msyyc marked this pull request as ready for review March 19, 2026 01:48
@msyyc msyyc requested review from mccoyp and scbedd as code owners March 19, 2026 01:48
Copilot AI review requested due to automatic review settings March 19, 2026 01:49
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

Updates the packaging tooling to compute tagIsStable differently for TypeSpec vs Swagger code generation runs, using the pipeline-provided sdkReleaseType for TypeSpec projects while preserving existing Swagger behavior.

Changes:

  • Read sdkReleaseType from the generator pipeline input and use it to set tagIsStable for TypeSpec projects.
  • Keep Swagger projects’ tagIsStable behavior based on judge_tag_preview(...).
  • Add unit tests covering TypeSpec vs Swagger tagIsStable behavior plus a few helper-function tests.

Reviewed changes

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

File Description
eng/tools/azure-sdk-tools/packaging_tools/sdk_generator.py Updates tagIsStable assignment to use sdkReleaseType for TypeSpec runs and judge_tag_preview for Swagger runs.
eng/tools/azure-sdk-tools/tests/test_sdk_generator.py Adds tests validating the new tagIsStable branching logic and existing helper behaviors.

msyyc and others added 3 commits March 19, 2026 10:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@msyyc msyyc merged commit 08e2b52 into main Mar 19, 2026
19 checks passed
@msyyc msyyc deleted the fix/tag-is-stable-typespec branch March 19, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants