Skip to content

Commit a027cbf

Browse files
Merge branch 'master' into copilot/fix-cosmos-clientbuilder-issue
2 parents 145a7ac + 7dbe8c2 commit a027cbf

25 files changed

Lines changed: 9076 additions & 4715 deletions

.github/agents/msdata-direct-sync-agent.agent.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
name: 'MsdataDirectSyncAgent'
3+
description: 'Orchestrates syncing the msdata/direct branch with the latest v3 master and msdata direct codebase.'
4+
tools:
5+
- read
6+
- search
7+
- edit
8+
- terminal
9+
---
10+
111
# Copilot Agent: msdata/direct Branch Sync
212
## Azure Cosmos DB .NET SDK (azure-cosmos-dotnet-v3)
313

.github/agents/release-copilot-agent.agent.md

Lines changed: 186 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
name: 'ReleaseCopilotAgent'
3+
description: 'Guides the team through full releases and hotfix releases of the Cosmos DB .NET SDK.'
4+
tools:
5+
- read
6+
- search
7+
- edit
8+
- terminal
9+
---
10+
111
# Release Copilot Agent
212
## Azure Cosmos DB .NET SDK (azure-cosmos-dotnet-v3)
313

@@ -12,6 +22,9 @@
1222
```
1323
@ReleaseCopilotAgent start hotfix
1424
```
25+
```
26+
@ReleaseCopilotAgent add missed PRs
27+
```
1528

1629
**In the Copilot CLI (terminal):**
1730
```
@@ -20,19 +33,23 @@ I want to start a minor release
2033
```
2134
I want to start a hotfix release
2235
```
36+
```
37+
I need to add missed PRs to a release
38+
```
2339

2440
> **Note:** The Copilot CLI loads these instructions via `.github/copilot-instructions.md`. All GitHub MCP tools, PowerShell, and file editing tools are built-in — no additional extensions needed.
2541
2642
**What the agent will do:**
27-
1. Ask whether to run in **Minor Mode** or **Hotfix Mode**
43+
1. Ask whether to run in **Minor Mode**, **Hotfix Mode**, or **Add Missed PRs**
2844
2. Verify environment setup (.NET SDK, `gh` CLI, GenAPI tool)
2945
3. Determine current and target versions from `Directory.Build.props`
3046
4. Generate changelog entries from merged PRs (filtering out `[Internal]`)
31-
5. Bump version numbers following versioning rules
32-
6. Build the SDK and generate API contract files via GenAPI
33-
7. Create a release PR with API diff in the description
34-
8. Ensure that a full test suite passes, including contract enforcement tests.
35-
9. Guide through post-merge pipeline queuing and NuGet publish
47+
5. Prompt for any additional PRs that were missed by automatic discovery
48+
6. Bump version numbers following versioning rules
49+
7. Build the SDK and generate API contract files via GenAPI
50+
8. Create a release PR with API diff in the description
51+
9. Ensure that a full test suite passes, including contract enforcement tests.
52+
10. Guide through post-merge pipeline queuing and NuGet publish
3653

3754
---
3855

@@ -74,6 +91,7 @@ When the agent is invoked, ask the user:
7491
> **Which release mode would you like to run?**
7592
> 1. **Minor Mode** — Minor release (GA + Preview)
7693
> 2. **Hotfix Mode** — Patch release on an existing release branch (GA + Preview)
94+
> 3. **Add Missed PRs** — Add PRs that were missed in a previous release changelog
7795
7896
Based on the selection, proceed to the corresponding section below.
7997

@@ -130,7 +148,25 @@ Or use the GitHub MCP `list_pull_requests` tool to fetch merged PRs.
130148
- `Removes`**Removed** section
131149
- `Refactors`**Fixed** section (or a separate section if preferred)
132150

133-
#### 2.3.3 Format Changelog Entries
151+
#### 2.3.3 Review & Add Missed PRs
152+
153+
After generating the filtered PR list, present it to the user and ask:
154+
155+
> **Here are the PRs that will be included in the changelog. Are there any additional PRs that should be included that weren't automatically discovered?**
156+
> Provide PR numbers separated by commas, or type 'none'.
157+
158+
For each additional PR number provided:
159+
160+
```powershell
161+
# Fetch details for each missed PR
162+
gh pr view <PR_NUMBER> --json number,title,mergedAt
163+
```
164+
165+
Add the missed PRs to the appropriate changelog category based on their title verb (`Adds`, `Fixes`, `Removes`, `Refactors`). If the PR title doesn't follow the standard format, ask the user which category it belongs to.
166+
167+
Re-display the final combined PR list for confirmation before proceeding.
168+
169+
#### 2.3.4 Format Changelog Entries
134170

135171
Follow the existing format in `changelog.md`:
136172

@@ -204,10 +240,21 @@ git diff --no-index "Microsoft.Azure.Cosmos\contracts\API_PREV_PREVIEW.txt" "Mic
204240

205241
#### 2.6.1 Create Feature Branch
206242

243+
First, determine the GitHub username for branch naming:
244+
207245
```powershell
208-
git checkout -b release/X.Y.Z
246+
# Get the GitHub username
247+
gh api user --jq '.login'
209248
```
210249

250+
Then create the feature branch:
251+
252+
```powershell
253+
git checkout -b users/<username>/release-X.Y.Z
254+
```
255+
256+
Where `<username>` is the GitHub username obtained above (e.g., `users/nalutripician/release-3.58.0`).
257+
211258
> **🚫 NEVER push directly to `master`.** Always create a feature branch and PR.
212259
213260
#### 2.6.2 Commit Changes
@@ -365,19 +412,27 @@ Where `X.Y.PATCH` is the user-confirmed hotfix version (e.g., `3.55.2`) and `X.Y
365412

366413
### 3.5 Cherry-Pick PRs
367414

415+
First, determine the GitHub username for branch naming (if not already known):
416+
417+
```powershell
418+
gh api user --jq '.login'
419+
```
420+
368421
For each PR selected by the user:
369422

370423
```powershell
371424
# Get the merge commit SHA for the PR
372425
gh pr view <PR_NUMBER> --json mergeCommit --jq '.mergeCommit.oid'
373426
374427
# Create a working branch for cherry-picks
375-
git checkout -b hotfix/X.Y.Z+1 releases/X.Y.Z+1
428+
git checkout -b users/<username>/hotfix-X.Y.Z+1 releases/X.Y.Z+1
376429
377430
# Cherry-pick each commit
378431
git cherry-pick <MERGE_COMMIT_SHA>
379432
```
380433

434+
Where `<username>` is the GitHub username (e.g., `users/nalutripician/hotfix-3.55.2`).
435+
381436
If there are conflicts, notify the user and assist with resolution.
382437

383438
### 3.6 Version Bump on Hotfix Branch
@@ -386,7 +441,7 @@ Update `Directory.Build.props` on the hotfix branch with the user-confirmed hotf
386441

387442
### 3.7 Changelog Update
388443

389-
Add hotfix entries to `changelog.md` on the hotfix branch. Only include the PRs being cherry-picked:
444+
Add hotfix entries to `changelog.md` on the hotfix branch. Start with the PRs being cherry-picked:
390445

391446
```markdown
392447
### <a name="X.Y.Z+1"/> [X.Y.Z+1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/X.Y.Z+1) - YYYY-M-DD
@@ -395,6 +450,13 @@ Add hotfix entries to `changelog.md` on the hotfix branch. Only include the PRs
395450
- [PR#](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/PR#) PR Title
396451
```
397452

453+
After generating the initial changelog entries, ask the user:
454+
455+
> **Are there any additional PRs that should be included in this hotfix changelog beyond the cherry-picked ones?**
456+
> Provide PR numbers separated by commas, or type 'none'.
457+
458+
For any additional PR numbers, fetch their details and add them to the changelog. Present the final changelog for confirmation.
459+
398460
### 3.8 Generate API Contract Files
399461

400462
Both GA and preview contract files must be generated for the hotfix.
@@ -437,15 +499,24 @@ git diff --no-index "Microsoft.Azure.Cosmos\contracts\API_PREV_PREVIEW.txt" "Mic
437499

438500
**Important:** Contract file changes and changelog updates must also be reflected on `master`.
439501

440-
1. Create a separate PR targeting `master` that includes:
502+
1. Create a working branch from `master` for the sync PR:
503+
```powershell
504+
git checkout master && git pull
505+
git checkout -b users/<username>/hotfix-X.Y.Z+1-master-sync
506+
```
507+
2. Add the following to the branch:
441508
- The new GA API contract file (`API_X.Y.Z+1.txt`)
442509
- The new preview API contract file (`API_X.Y+1.0-preview.Z+1.txt`)
443510
- Changelog entries for the hotfix version
444-
2. This ensures `master` stays in sync with released versions
511+
3. Create a PR targeting `master`:
512+
```powershell
513+
gh pr create --base master --title "[Internal] Contracts: Adds hotfix X.Y.Z+1 contract files and changelog" --body "Syncs master with hotfix release X.Y.Z+1 contract files and changelog entries."
514+
```
515+
4. This ensures `master` stays in sync with released versions
445516

446517
### 3.10 Create Hotfix PR
447518

448-
Create a PR from the working branch targeting the hotfix release branch:
519+
Create a PR from the working branch (`users/<username>/hotfix-X.Y.Z+1`) targeting the hotfix release branch:
449520

450521
```powershell
451522
gh pr create --base releases/X.Y.Z+1 --title "Hotfix: Adds version X.Y.Z+1" --body "## Hotfix X.Y.Z+1
@@ -575,3 +646,105 @@ If `ContractEnforcementTests` fails after version bump, verify:
575646
dotnet clean Microsoft.Azure.Cosmos\src -c Release
576647
dotnet build Microsoft.Azure.Cosmos\src -c Release
577648
```
649+
650+
---
651+
652+
## 6. Add Missed PRs to Existing Release
653+
654+
This mode allows adding PRs that were missed in a previous release's changelog. It can be invoked standalone via:
655+
656+
**In VS Code Copilot Chat:**
657+
```
658+
@ReleaseCopilotAgent add missed PRs
659+
```
660+
661+
**In the Copilot CLI (terminal):**
662+
```
663+
I need to add missed PRs to a release
664+
```
665+
666+
### 6.1 Identify the Target Release
667+
668+
Ask the user:
669+
670+
> **Which release version needs missed PRs added?**
671+
> (e.g., `3.58.0`, `3.55.2`)
672+
673+
### 6.2 Locate the Release PR
674+
675+
Search for the existing release PR:
676+
677+
```powershell
678+
# Search for the release PR by title
679+
gh pr list --repo Azure/azure-cosmos-dotnet-v3 --state all --limit 50 --json number,title,state --jq '.[] | select(.title | test("Release:.*X.Y.Z|Hotfix:.*X.Y.Z"))'
680+
```
681+
682+
Or use the GitHub MCP `search_pull_requests` tool.
683+
684+
Determine whether the PR is **open** or **merged**.
685+
686+
### 6.3 Collect Missed PRs
687+
688+
Ask the user:
689+
690+
> **Which PR(s) should be added to the X.Y.Z changelog?**
691+
> Provide PR numbers separated by commas.
692+
693+
For each PR number, fetch its details:
694+
695+
```powershell
696+
gh pr view <PR_NUMBER> --json number,title,mergedAt
697+
```
698+
699+
Categorize each PR by its title verb (`Adds` → Added, `Fixes` → Fixed, `Removes` → Removed, `Refactors` → Fixed). If the title doesn't match the standard format, ask the user which category it belongs to.
700+
701+
### 6.4 Update the Changelog
702+
703+
#### If the release PR is still open:
704+
705+
1. Check out the existing PR branch:
706+
```powershell
707+
gh pr checkout <PR_NUMBER>
708+
```
709+
2. Edit `changelog.md` to add the missed entries under the appropriate version heading and category
710+
3. Commit and push:
711+
```powershell
712+
git add changelog.md
713+
git commit -m "Release: Adds missed PRs to X.Y.Z changelog"
714+
git push
715+
```
716+
717+
#### If the release PR is already merged:
718+
719+
First, determine the GitHub username:
720+
721+
```powershell
722+
gh api user --jq '.login'
723+
```
724+
725+
Then create a new branch and PR:
726+
727+
1. Create a new branch:
728+
```powershell
729+
git checkout master && git pull
730+
git checkout -b users/<username>/changelog-fix-X.Y.Z
731+
```
732+
2. Edit `changelog.md` to add the missed entries under the existing X.Y.Z version heading
733+
3. If the release branch (`releases/X.Y.Z`) also needs the changelog fix, cherry-pick the commit there too
734+
4. Commit, push, and create a PR:
735+
```powershell
736+
git add changelog.md
737+
git commit -m "Changelog: Adds missed PRs to X.Y.Z changelog"
738+
git push origin users/<username>/changelog-fix-X.Y.Z
739+
gh pr create --base master --title "Changelog: Adds missed PRs to X.Y.Z release notes" --body "## Changelog Fix for X.Y.Z
740+
741+
### Added PRs
742+
- #PR1: Title
743+
- #PR2: Title
744+
745+
These PRs were missed during the original X.Y.Z release changelog generation."
746+
```
747+
748+
### 6.5 Verify
749+
750+
Present the updated changelog section to the user for final review and confirmation.

.github/copilot-instructions.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ Purpose: quick, actionable context so an AI coding assistant can be immediately
5555
- Includes: environment setup, issue investigation, fix implementation, testing requirements, PR workflow, and learnings capture.
5656
- Start with: `@IssueFixAgent investigate issue #XXXX` or see Quick Start in the agent file.
5757
- **ReleaseCopilotAgent** (`.github/agents/release-copilot-agent.agent.md`) — Guides the team through full releases and hotfix releases of the Cosmos DB .NET SDK. Automates changelog generation, version bumping, API contract file generation (GenAPI), and PR creation.
58-
- Two modes: **Minor Mode** (full GA + Preview release) and **Hotfix Mode** (cherry-pick patch release on any previous version).
59-
- In VS Code Copilot Chat: `@ReleaseCopilotAgent start minor` or `@ReleaseCopilotAgent start hotfix`.
60-
- In the Copilot CLI: describe the task naturally (e.g., "I want to start a minor release" or "start hotfix"). The agent instructions are loaded automatically via this file.
58+
- Three modes: **Minor Mode** (full GA + Preview release), **Hotfix Mode** (cherry-pick patch release on any previous version), and **Add Missed PRs** (add PRs that were missed in a previous changelog).
59+
- In VS Code Copilot Chat: `@ReleaseCopilotAgent start minor`, `@ReleaseCopilotAgent start hotfix`, or `@ReleaseCopilotAgent add missed PRs`.
60+
- In the Copilot CLI: describe the task naturally (e.g., "I want to start a minor release", "start hotfix", or "I need to add missed PRs to a release"). The agent instructions are loaded automatically via this file.
61+
- **MsdataDirectSyncAgent** (`.github/agents/msdata-direct-sync-agent.agent.md`) — Orchestrates syncing the msdata/direct branch with the latest v3 master and msdata direct codebase.
62+
- In VS Code Copilot Chat: `@MsdataDirectSyncAgent sync msdata/direct`.
63+
- In the Copilot CLI: describe the task naturally (e.g., "sync the msdata/direct branch with master").
6164

6265
If anything here is unclear or you want the file to include additional examples (specific files, common refactor targets, or typical PR reviewers), tell me what to add and I will iterate.

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
3-
<ClientOfficialVersion>3.57.0</ClientOfficialVersion>
4-
<ClientPreviewVersion>3.58.0</ClientPreviewVersion>
3+
<ClientOfficialVersion>3.58.0</ClientOfficialVersion>
4+
<ClientPreviewVersion>3.59.0</ClientPreviewVersion>
55
<ClientPreviewSuffixVersion>preview.0</ClientPreviewSuffixVersion>
66
<DirectVersion>3.42.2</DirectVersion>
77
<FaultInjectionVersion>1.0.0</FaultInjectionVersion>

0 commit comments

Comments
 (0)