Skip to content

Add Regenerate feature to Update workflow using shared helper #12066

Merged
samvaity merged 1 commit into
mainfrom
add-regenerate
Sep 15, 2025
Merged

Add Regenerate feature to Update workflow using shared helper #12066
samvaity merged 1 commit into
mainfrom
add-regenerate

Conversation

@samvaity
Copy link
Copy Markdown
Member

@samvaity samvaity commented Sep 12, 2025

  • Extended ITspClientHelper with UpdateGenerationAsync
  • Implemented update command in TspClientHelper invokes [tsp-client update --tspPath ... --output-dir ...]
  • Injected ITspClientHelper into TspClientUpdateTool and replaced placeholder regenerate step with real call to generate new code at provided newGen path location if provided.

@samvaity samvaity self-assigned this Sep 12, 2025
@github-actions github-actions Bot added the azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli label Sep 12, 2025
@samvaity samvaity marked this pull request as ready for review September 12, 2025 19:28
@samvaity samvaity requested a review from benbp as a code owner September 12, 2025 19:28
Copilot AI review requested due to automatic review settings September 12, 2025 19:28
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 adds regeneration capability to the TypeSpec client update workflow by integrating with the tsp-client CLI tool. It replaces the placeholder regeneration step with actual code generation functionality.

Key changes:

  • Extended the ITspClientHelper interface with UpdateGenerationAsync method to invoke tsp-client update commands
  • Refactored TspClientUpdateTool to accept commit SHA instead of spec path and implemented actual regeneration logic
  • Added logic to update tsp-location.yaml files with new commit SHA and handle output directory resolution

Reviewed Changes

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

Show a summary per file
File Description
TspClientUpdateTool.cs Refactored to use commit SHA, added regeneration logic using ITspClientHelper, and improved directory handling
TspClientUpdateResponse.cs Added Failed enum value to UpdateStage for error handling
TspClientHelper.cs Implemented UpdateGenerationAsync method to execute tsp-client update commands
ITspClientHelper.cs Extended interface with UpdateGenerationAsync method and updated documentation
TspClientUpdateToolTests.cs Updated tests to use mock ITspClientHelper and commit SHA values instead of spec paths

Comment thread tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/TspClientHelper.cs
@samvaity samvaity merged commit 6868637 into main Sep 15, 2025
23 checks passed
@samvaity samvaity deleted the add-regenerate branch September 15, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants