Skip to content

[Internal] Tooling: Adds Release Copilot Agent for SDK release automation#5633

Open
NaluTripician wants to merge 14 commits intomasterfrom
users/ntripician/release-copilot-agent
Open

[Internal] Tooling: Adds Release Copilot Agent for SDK release automation#5633
NaluTripician wants to merge 14 commits intomasterfrom
users/ntripician/release-copilot-agent

Conversation

@NaluTripician
Copy link
Contributor

@NaluTripician NaluTripician commented Feb 23, 2026

Summary

Adds a new Release Copilot Agent (@ReleaseCopilotAgent) that guides the team through the Cosmos DB .NET SDK release process. Also bundles the GenAPI tool binaries into the repository so the agent can automate API contract file generation.

Works with both VS Code Copilot Chat and the Copilot CLI (terminal).

Changes

File Description
.github/agents/release-copilot-agent.agent.md New Copilot agent with Minor and Hotfix workflows
.github/copilot-instructions.md Added ReleaseCopilotAgent to Named Copilot Agents section (with CLI guidance)
tools/GenAPI/* GenAPI binaries for API contract file generation (14 files)

Usage Guide

Getting Started

In VS Code Copilot Chat:

@ReleaseCopilotAgent start minor

or

@ReleaseCopilotAgent start hotfix

In the Copilot CLI (terminal):

I want to start a minor release

or

I want to start a hotfix release

The agent will ask you to select a mode and then guide you step-by-step.


Minor Mode (Full Release)

Use this for a standard GA + Preview release from master.

What the agent does:

  1. Reads current versions from Directory.Build.props and confirms the target release version with you
  2. Generates changelog entries by listing all merged PRs since the last release, filtering out [Internal] PRs, and categorizing by verb (Adds → Added, Fixes → Fixed, etc.)
  3. Bumps version numbers in Directory.Build.props following the versioning rules enforced by ContractEnforcementTests
  4. Builds the SDK (dotnet build -c Release for GA, /p:IsPreview=true for preview)
  5. Runs GenAPI (tools/GenAPI/GenAPI.exe) to generate API contract files and places them in Microsoft.Azure.Cosmos/contracts/
  6. Generates API diff (git diff --no-index) between old and new contract files
  7. Creates a release PR with version changes, changelog, and API diff in the description
  8. Provides post-merge guidance for creating the release branch, queuing pipelines, NuGet publish, GitHub Release creation, and metadata XML update

Example flow:

You: start minor release
Agent: Current version is 3.57.0. What version would you like to release? (suggested: 3.58.0)
You: 3.58.0
Agent: [generates changelog from merged PRs, bumps versions, builds SDK, runs GenAPI]
Agent: Here is the generated changelog — please review. [shows entries]
You: Looks good
Agent: [creates PR with all changes and API diff]

Hotfix Mode

Use this to cherry-pick specific PRs into a patch release on any existing release branch (not just the most recent).

What the agent does:

  1. Asks which PR(s) to include in the hotfix
  2. Identifies the release branch to hotfix — can be any previous version (e.g., releases/3.50.0, releases/3.57.0)
  3. Detects existing patches and prompts the user for the target hotfix version (e.g., if 3.55.0 and 3.55.1 exist → suggests 3.55.2)
  4. Cherry-picks the selected PRs onto the hotfix branch
  5. Bumps the patch version in Directory.Build.props (preview version derived from hotfix base, not master)
  6. Updates changelog with only the cherry-picked PR entries
  7. Generates both GA and preview API contract files via GenAPI
  8. Ensures master sync — creates a separate PR to master with both contract files and changelog
  9. Creates the hotfix PR targeting the hotfix branch with API diff in the description
  10. Provides post-merge guidance for pipeline queuing and NuGet publish

Example flow:

You: start hotfix
Agent: Which PR(s) should be included in this hotfix?
You: #5613
Agent: Which release branch should be hotfixed?
You: releases/3.55.0
Agent: Existing versions for 3.55: 3.55.0, 3.55.1. What version should this hotfix target? (suggested: 3.55.2)
You: 3.55.2
Agent: [creates releases/3.55.2, cherry-picks #5613, bumps version, generates GA + preview contract files]
Agent: [creates hotfix PR + master sync PR]

Key Versioning Rules

The agent enforces the versioning rules from ContractEnforcementTests.cs:

Property Rule Example
ClientOfficialVersion The GA release version 3.58.0
ClientPreviewVersion Official minor + 1, build = 0 3.59.0
ClientPreviewSuffixVersion preview.{official_patch} preview.0

Prerequisites

  • Windows (GenAPI.exe is Windows-only)
  • .NET SDK installed
  • GitHub CLI (gh) authenticated
  • GitHub MCP tools (built-in for Copilot CLI; requires GitHub MCP Server extension for VS Code)

NaluTripician and others added 2 commits February 23, 2026 10:57
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion

- Adds .github/agents/release-copilot-agent.agent.md with Release and Hotfix modes
- Adds GenAPI binaries under tools/GenAPI/ for API contract file generation
- Updates .github/copilot-instructions.md with the new agent entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
NaluTripician and others added 3 commits March 4, 2026 11:48
…y hotfix GA+Preview, use Directory.Build.props for previous version

- Renames 'Release Mode' to 'Minor Mode' throughout the agent file
- Clarifies that Hotfix Mode also produces GA + Preview packages
- Simplifies section 2.2 to read previous version from Directory.Build.props on master

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NaluTripician NaluTripician added the auto-merge Enables automation to merge PRs label Mar 10, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot enabled auto-merge (squash) March 10, 2026 17:45
NaluTripician and others added 3 commits March 10, 2026 13:08
- Fixes PR titles to use allowed verb 'Adds' instead of 'Bumps'
  to match the PR lint regex (Adds|Fixes|Refactors|Removes)
- Expands hotfix contract generation (Section 3.8) to produce
  both GA and preview contract files with explicit build/GenAPI steps
- Updates hotfix master-sync to explicitly list both contract files
- Updates hotfix PR body to include preview version changes and
  separate GA/preview API diff sections
- Updates hotfix PR checklist to reference both contract files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Adds Copilot CLI invocation guidance alongside VS Code syntax
- Updates prerequisites to note GitHub MCP tools are built-in for CLI
- Makes tool references context-agnostic (VS Code and CLI)
- Updates copilot-instructions.md with CLI usage guidance
- Supports hotfixing any previous release branch, not just latest
- Prompts user for target hotfix version with existing patch detection
- Clarifies preview version is derived from hotfix base, not master
- Adds examples table for multi-patch hotfix scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants