Skip to content

Comments

added yaml file update with copilot fallback#56267

Merged
radhgupta merged 13 commits intoAzure:mainfrom
radhgupta:GeneratorAgent
Feb 20, 2026
Merged

added yaml file update with copilot fallback#56267
radhgupta merged 13 commits intoAzure:mainfrom
radhgupta:GeneratorAgent

Conversation

@radhgupta
Copy link
Member

@radhgupta radhgupta commented Feb 13, 2026

This pull request introduces new Copilot-powered automation capabilities to the Azure SDK Generator Agent tool, focusing on integrating Copilot for migration guidance and specification path discovery. It also adds a utility service for YAML configuration file manipulation and updates package dependencies to support these features.

Copilot integration for migration and analysis:

  • Added a new CopilotService class to encapsulate all interactions with the GitHub Copilot SDK, including initializing sessions, sending prompts, and retrieving responses for Azure SDK migration tasks and specification path discovery. This service manages Copilot client lifecycle and error handling.
  • Introduced the CopilotPrompts static class to centralize prompt engineering logic, providing standardized system messages and prompts for migration guidance and Typespec specification path analysis.

YAML configuration file utilities:

  • Added a new FileService class that provides methods for reading and updating fields in tsp-location.yaml files using simple string operations, including robust error handling and logging.

@github-actions github-actions bot added the CodeGen Issues that relate to code generation label Feb 13, 2026
@github-actions
Copy link

github-actions bot commented Feb 13, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.GeneratorAgent

@radhgupta radhgupta marked this pull request as ready for review February 13, 2026 20:45
Copilot AI review requested due to automatic review settings February 13, 2026 20:45
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

This pull request refactors the Azure.GeneratorAgent tool to use the GitHub API instead of local git commands, introduces a new FileService for YAML file manipulation, and implements a migration workflow that updates tsp-location.yaml files. The changes involve significant architectural improvements including moving from the Azure.GeneratorAgent.Services namespace to the root namespace, renaming SdkValidator to ValidationService with enhanced validation capabilities, and adding comprehensive test coverage for the new services.

Changes:

  • Refactored GitService to use GitHub REST API via HttpClient for retrieving commit information from remote repositories
  • Added FileService to read and update YAML configuration files using string-based parsing
  • Implemented migration workflow that validates SDK structure, reads repository paths from tsp-location.yaml, fetches latest commits, and updates configuration fields
  • Enhanced ValidationService with security-focused path validation including checks for path traversal patterns and invalid characters
  • Updated dependency injection configuration to register HttpClient with GitHub API headers and added Microsoft.Extensions.Http package

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
sdk/tools/ci.generator.yml Formatting change: Added newline at end of file
sdk/tools/ci.analyzers.yml Formatting change: Added newline at end of file
sdk/tools/Azure.GeneratorAgent/tests/ValidationServiceTests.cs Updated tests for renamed ValidationService, removed namespace reference, simplified test structure
sdk/tools/Azure.GeneratorAgent/tests/ServiceCollectionTests.cs Expanded DI tests to cover all new services with lifecycle verification and comprehensive integration checks
sdk/tools/Azure.GeneratorAgent/tests/GitServiceTests.cs Completely rewrote tests to use mocked HttpClient for GitHub API calls instead of local git repository tests
sdk/tools/Azure.GeneratorAgent/tests/FileServiceTests.cs New comprehensive test suite covering YAML reading/writing edge cases, quote handling, and cancellation scenarios
sdk/tools/Azure.GeneratorAgent/src/ValidationService.cs Renamed from SdkValidator, moved to root namespace, added tsp-location.yaml validation and repository path security checks
sdk/tools/Azure.GeneratorAgent/src/ServiceConfiguration.cs Added HttpClient configuration for GitService with GitHub API headers and registered new FileService
sdk/tools/Azure.GeneratorAgent/src/SdkValidator.cs Deleted (renamed to ValidationService)
sdk/tools/Azure.GeneratorAgent/src/RootCommandFactory.cs Implemented complete migrate command workflow with multi-step validation, commit fetching, and YAML updates
sdk/tools/Azure.GeneratorAgent/src/GitService.cs Replaced local git command execution with GitHub REST API calls, added JSON parsing and response validation
sdk/tools/Azure.GeneratorAgent/src/FileService.cs New service for reading and writing YAML fields using string operations with quote handling and error wrapping
sdk/tools/Azure.GeneratorAgent/src/Azure.GeneratorAgent.csproj Added Microsoft.Extensions.Http package reference for HttpClient factory support
eng/Packages.Data.props Added Microsoft.Extensions.Http version 10.0.1 to centralized package management

@radhgupta radhgupta changed the title added yaml file service and git service for migration added yaml file update with copilot fallback Feb 17, 2026
@radhgupta radhgupta enabled auto-merge (squash) February 18, 2026 20:45
@radhgupta radhgupta requested a review from jsquire February 20, 2026 16:20
@radhgupta radhgupta dismissed jsquire’s stale review February 20, 2026 20:21

Since we already discussed, I am dismissing it :)

@radhgupta radhgupta disabled auto-merge February 20, 2026 20:30
@radhgupta radhgupta merged commit 89110de into Azure:main Feb 20, 2026
49 checks passed
Copy link
Member

@jsquire jsquire left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CodeGen Issues that relate to code generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants