Skip to content

Fix TypeSpec Python regenerate workflow: apply README template from generated-tests branch layout#47491

Merged
msyyc merged 8 commits into
mainfrom
copilot/fix-regenerate-typespec-python-tests
Jun 15, 2026
Merged

Fix TypeSpec Python regenerate workflow: apply README template from generated-tests branch layout#47491
msyyc merged 8 commits into
mainfrom
copilot/fix-regenerate-typespec-python-tests

Conversation

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The "Regenerate TypeSpec Python tests" job failed at the Apply README template step with Template README not found at eng/tools/azure-sdk-tools/emitter/generated/template/README.md. PR #47288 removed emitter/generated/ from main by design, leaving the template only on the typespec-python-generated-tests branch, but the workflow still expected it in the main checkout.

Changes

  • .github/workflows/typespec-python-regenerate.yml — the workflow now stages regenerated azure and unbranded test packages in $RUNNER_TEMP, checks out the typespec-python-generated-tests branch layout, and applies the existing in-branch template/README.md directly:
    • Stage regenerated outputs before switching branches so they are preserved safely
    • Check out the source branch from typespec-python-generated-tests before copying regenerated files into eng/tools/azure-sdk-tools/emitter/generated
    • Reuse eng/tools/azure-sdk-tools/emitter/generated/template/README.md from that branch layout instead of fetching the template into a temp file
    • Update the missing-branch error message to clarify that the generated-tests branch history must contain the template path
    • Harden cleanup of the staged temp directory
GENERATED_STAGE_DIR="${RUNNER_TEMP}/typespec-python-generated"
cp -r "_typespec/packages/http-client-python/tests/generated/azure" "$GENERATED_STAGE_DIR/azure"
cp -r "_typespec/packages/http-client-python/tests/generated/unbranded" "$GENERATED_STAGE_DIR/unbranded"

git fetch --no-tags --depth=1 origin "$TARGET_BRANCH"
git checkout -B "$SOURCE_BRANCH" "origin/$TARGET_BRANCH"

cp -r "$GENERATED_STAGE_DIR/azure" "$TARGET/azure"
cp -r "$GENERATED_STAGE_DIR/unbranded" "$TARGET/unbranded"

TEMPLATE="$TARGET/template/README.md"
find "$TARGET" -type f -name README.md \
  ! -path "$TARGET/README.md" \
  ! -path "$TARGET/template/*" \
  -print -exec cp -f "$TEMPLATE" {} \;

… typespec-python-generated-tests branch

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot finished work on behalf of msyyc June 15, 2026 02:08
Copilot AI requested a review from msyyc June 15, 2026 02:08
@msyyc msyyc marked this pull request as ready for review June 15, 2026 02:13
@msyyc msyyc requested a review from tadelesh as a code owner June 15, 2026 02:13
Copilot AI review requested due to automatic review settings June 15, 2026 02:13
@msyyc msyyc requested review from a team, ChenxiJiang333 and iscai-msft as code owners June 15, 2026 02:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the TypeSpec Python test regeneration workflow by sourcing the README template from the typespec-python-generated-tests branch (where it now lives after PR #47288), rather than expecting it to exist in the main checkout.

Changes:

  • Update the “Apply README template” step to git fetch the typespec-python-generated-tests branch and git show the template into a temporary file.
  • Improve the failure message to indicate the branch/path to check when the template can’t be retrieved.
  • Clean up the temporary README template file after copying.

Comment thread .github/workflows/typespec-python-regenerate.yml
Comment thread .github/workflows/typespec-python-regenerate.yml Outdated
msyyc and others added 2 commits June 15, 2026 11:03
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>
Comment thread .github/workflows/typespec-python-regenerate.yml Outdated
Copilot AI and others added 4 commits June 15, 2026 03:50
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot AI changed the title Fix TypeSpec Python regenerate workflow: source README template from generated-tests branch Fix TypeSpec Python regenerate workflow: apply README template from generated-tests branch layout Jun 15, 2026
Copilot finished work on behalf of msyyc June 15, 2026 03:59
Copilot AI requested a review from msyyc June 15, 2026 03:59
@msyyc msyyc requested a review from Copilot June 15, 2026 04:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@msyyc msyyc merged commit 10579f9 into main Jun 15, 2026
18 checks passed
@msyyc msyyc deleted the copilot/fix-regenerate-typespec-python-tests branch June 15, 2026 05:21
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.

4 participants