Skip to content

fix: improve typespec-python regeneration workflow#47051

Open
iscai-msft wants to merge 1 commit into
Azure:mainfrom
iscai-msft:fix/typespec-python-regen-workflow
Open

fix: improve typespec-python regeneration workflow#47051
iscai-msft wants to merge 1 commit into
Azure:mainfrom
iscai-msft:fix/typespec-python-regen-workflow

Conversation

@iscai-msft
Copy link
Copy Markdown
Contributor

Changes

1. Fix README template step for new packages

The previous find -name README.md approach only replaced existing README.md files. Newly generated packages (e.g. typeddict variants) that didn't already have a README never got one, causing test_readme_exists failures in the typespec repo CI.

Changed to iterate all top-level package directories under azure/ and unbranded/, unconditionally copying the template README into each.

2. Add target_branch workflow_dispatch input

Manual workflow runs can now specify a different target branch (defaults to typespec-python-generated-tests). This allows testing regeneration from a PR without overwriting the main baseline branch.

Copilot AI review requested due to automatic review settings May 21, 2026 15:40
@iscai-msft iscai-msft force-pushed the fix/typespec-python-regen-workflow branch from 91b057d to a60f9f6 Compare May 21, 2026 15:47
Copy link
Copy Markdown
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 updates the TypeSpec Python generated-tests regeneration workflow and related documentation to reflect the move of generated test assets to eng/tools/azure-sdk-tools/emitter/generated, and to improve manual regeneration scenarios (including specifying a dedicated target branch).

Changes:

  • Update the regeneration workflow to copy outputs into the new generated-tests folder and apply a README template to each generated package directory.
  • Add a target_branch input for workflow_dispatch to support pushing regenerated outputs to a selectable branch.
  • Refresh emitter documentation to reflect deprecation of the old eng/tools/emitter location and point to the generated-tests branch/folder.

Reviewed changes

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

Show a summary per file
File Description
eng/tools/emitter/README.md Replaces detailed legacy workflow docs with a deprecation notice pointing to the new generated location/branch.
eng/tools/emitter/gen/README.md Updates README to clarify generated tests are maintained on the typespec-python-generated-tests branch and may be force-pushed.
eng/tools/azure-sdk-tools/emitter/generated/template/README.md Adds a template README applied to each generated test package.
eng/tools/azure-sdk-tools/emitter/generated/README.md Adds documentation for the new generated-tests folder structure and regeneration workflow.
.github/workflows/typespec-python-regenerate.yml Implements new copy target, README templating logic, and target_branch push behavior.
.github/skills/emitter-package-update/SKILL.md Updates skill docs to reflect the new branch-based publishing model for regenerated tests.

Comment thread .github/workflows/typespec-python-regenerate.yml Outdated
Comment thread .github/workflows/typespec-python-regenerate.yml
@iscai-msft iscai-msft force-pushed the fix/typespec-python-regen-workflow branch 2 times, most recently from 81141cb to 4bcf749 Compare May 21, 2026 15:55
- Instead of force-pushing regenerated code directly to
  typespec-python-generated-tests, the workflow now creates a PR
  targeting that branch. This provides visibility and review before
  changes land on the baseline.
- Adds target_branch workflow_dispatch input so manual runs can
  target a different branch.
- Uses unique head branches per typespec PR to avoid collisions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@iscai-msft iscai-msft force-pushed the fix/typespec-python-regen-workflow branch from 4bcf749 to 0c05c13 Compare May 21, 2026 15:57
@iscai-msft iscai-msft enabled auto-merge (squash) May 21, 2026 16:04
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