Skip to content

Add repository-wide TypeSpec emitter regeneration pipeline - #49609

Draft
Libba Lawrence (l0lawrence) wants to merge 3 commits into
mainfrom
l0lawrence-typespec-regeneration-pipeline
Draft

Libba Lawrence (l0lawrence) wants to merge 3 commits into
mainfrom
l0lawrence-typespec-regeneration-pipeline

Conversation

@l0lawrence

Copy link
Copy Markdown
Member

Description

Fixes #48601.

Add an Azure Pipelines definition that regenerates existing TypeSpec clients when the pinned emitter manifest or lockfile changes. Eight deterministic shards use the pinned tsp-client and install emitter dependencies once per job. Discovery includes tracked nested clients and runs batch members independently, allowing later clients to run after a generation failure. Each job publishes client logs, results, and a binary-capable patch including new and deleted files, even when generation fails.

Recorded specification revisions are preserved. Code differences are retained for human review rather than automatically failing the job. Includes focused tests and documentation for pipeline registration, artifact review, and local reproduction. No SDK API or specification changes are included.

Maintainers must register eng/pipelines/typespec-regeneration.yml as an Azure Pipelines definition and enable its YAML CI/PR triggers. A full Azure-hosted all-SDK run has not been performed.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes. N/A: engineering pipeline only; related contributor documentation is updated.
  • 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.

Validation performed locally:

  • python -m pytest eng\tools\azure-sdk-tools\tests\test_typespec_regeneration.py -q — passed, 25 tests.
  • C:\Users\llawrence\.copilot\session-state\68ccc843-a713-437a-ba7b-4b6740b0f969\files\validation-venv\Scripts\python.exe -m black --check --config eng\black-pyproject.toml eng\scripts\regenerate_typespec.py eng\tools\azure-sdk-tools\tests\test_typespec_regeneration.py — passed.
  • Python 3.10 syntax parsing of both added Python files — passed.
  • git --no-pager diff --cached --check — passed before commit.
  • npm ci --prefix eng\common\tsp-client --no-audit --no-fund --quiet — passed.
  • python eng\scripts\regenerate_typespec.py --repo (Join-Path $env:TEMP 'azsdk-tsp-smoke-68ccc843') --output C:\Users\llawrence\.copilot\session-state\68ccc843-a713-437a-ba7b-4b6740b0f969\files\regeneration-smoke-results — passed in a disposable fixture with the existing Advisor configuration and real pinned emitter dependencies; exit code 0, 88 generated files captured. The Windows ARM setup required PYYAML_FORCE_LIBYAML=0 for generator dependency installation; no repository dependency overrides were made.

Regenerate tracked TypeSpec clients in parallel, retain generation failures and reviewable patches, and document pipeline setup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Allow explicit SDK directories and retain all-client regeneration as an opt-in.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

a regeneration pipeline for all existing tsp-based SDK

1 participant