Skip to content

[Internal] Tooling: Adds msdata/direct sync Copilot agent and helper script#5681

Merged
microsoft-github-policy-service[bot] merged 7 commits intomasterfrom
users/nalutripician/msdata-direct-sync-agent
Mar 18, 2026
Merged

[Internal] Tooling: Adds msdata/direct sync Copilot agent and helper script#5681
microsoft-github-policy-service[bot] merged 7 commits intomasterfrom
users/nalutripician/msdata-direct-sync-agent

Conversation

@NaluTripician
Copy link
Copy Markdown
Contributor

Pull Request Template

Description

This PR adds a Copilot agent and PowerShell helper script to automate the msdata/direct branch sync workflow, which merges the v3 master branch into msdata/direct and syncs files from the internal msdata CosmosDB repository.

Problem

The msdata/direct sync process (documented here) is a manual, multi-step workflow involving branch creation, merging, conflict resolution, file syncing via msdata_sync.ps1, build validation, and PR creation. This process is error-prone and time-consuming when done manually.

Solution

Two new automation tools:

1. Copilot Agent (.github/agents/msdata-direct-sync-agent.agent.md)

A structured agent with 5 workflow phases:

Phase Description
Phase 1: Environment Setup Validates prerequisites (git, dotnet, gh CLI), prompts for msdata repo path
Phase 2: Branch Preparation Creates feature branch from msdata/direct, merges latest master, resolves conflicts
Phase 3: msdata File Sync Configures and runs msdata_sync.ps1 with user-provided repo path, handles missing files
Phase 4: Build Validation Runs dotnet build to verify sync succeeded, provides troubleshooting guidance
Phase 5: PR Creation Stages, commits, pushes, creates draft PR with proper format and reviewers

Usage:

Follow the msdata/direct sync agent plan in .github/agents/msdata-direct-sync-agent.agent.md
Sync the msdata/direct branch with the latest v3 master and msdata direct codebase.

2. PowerShell Helper Script (tools/msdata-direct-sync-helper.ps1)

Automates the mechanical parts of the workflow. Can run the full workflow or individual phases:

# Full workflow
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB"

# Individual phases
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Setup
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Branch
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Sync
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Build
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase PR

Key features:

  • Prompts for msdata repo path at runtime (no hardcoded paths)
  • Auto-detects GitHub username for branch naming
  • Branch naming: users/<username>/update_msdata_direct_<mm_dd_yyyy>
  • Automatically reverts msdata_sync.ps1 path changes after sync
  • Creates draft PR with standard reviewers and description
  • Phase-by-phase execution for debugging or re-running failed steps

3. Documentation Update (docs/sync_up_msdata_direct.md)

Updated to reference the new agent and helper script as recommended automated alternatives, and added the latest sample PR (#5612).

Design Decisions

  • msdata repo path prompted at runtime: Different developers have the repo at different local paths
  • [Internal] PR prefix: This is internal tooling, not customer-facing
  • Draft PR by default: Follows repository convention of creating drafts first
  • Conflict resolution strategy: Accept incoming master changes by default, with manual review flagged for critical files

Type of change

  • New feature (non-breaking change which adds functionality)

Does this pull request offer a public API change?

No - this is internal tooling only (agent + script), no SDK API changes.

…script

Creates a Copilot agent and PowerShell helper script to automate the
msdata/direct branch sync workflow.

New files:
- .github/agents/msdata-direct-sync-agent.agent.md: Copilot agent with
  5-phase workflow (environment setup, branch prep, msdata file sync,
  build validation, PR creation)
- tools/msdata-direct-sync-helper.ps1: PowerShell automation script
  that can run the full workflow or individual phases

Updated files:
- docs/sync_up_msdata_direct.md: Added references to the new agent and
  script as recommended automated workflow options, plus latest sample PR

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NaluTripician NaluTripician self-assigned this Mar 3, 2026
@NaluTripician NaluTripician marked this pull request as ready for review March 5, 2026 19:42
Comment thread .github/agents/msdata-direct-sync-agent.agent.md
After running msdata_sync.ps1, the agent and helper script now scan all
msdata source directories for .cs files not yet present in v3's direct/
folder and auto-copy them. This addresses the known issue where new files
added in the msdata repo are silently missed by the sync script.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot merged commit bd1ea0d into master Mar 18, 2026
32 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot deleted the users/nalutripician/msdata-direct-sync-agent branch March 18, 2026 01:10
Meghana-Palaparthi pushed a commit that referenced this pull request Mar 19, 2026
…script (#5681)

# Pull Request Template

## Description

This PR adds a **Copilot agent** and **PowerShell helper script** to
automate the `msdata/direct` branch sync workflow, which merges the v3
`master` branch into `msdata/direct` and syncs files from the internal
msdata CosmosDB repository.

### Problem

The msdata/direct sync process ([documented
here](docs/sync_up_msdata_direct.md)) is a manual, multi-step workflow
involving branch creation, merging, conflict resolution, file syncing
via `msdata_sync.ps1`, build validation, and PR creation. This process
is error-prone and time-consuming when done manually.

### Solution

Two new automation tools:

#### 1. Copilot Agent
(`.github/agents/msdata-direct-sync-agent.agent.md`)

A structured agent with 5 workflow phases:

| Phase | Description |
|-------|-------------|
| **Phase 1: Environment Setup** | Validates prerequisites (git, dotnet,
gh CLI), prompts for msdata repo path |
| **Phase 2: Branch Preparation** | Creates feature branch from
`msdata/direct`, merges latest `master`, resolves conflicts |
| **Phase 3: msdata File Sync** | Configures and runs `msdata_sync.ps1`
with user-provided repo path, handles missing files |
| **Phase 4: Build Validation** | Runs `dotnet build` to verify sync
succeeded, provides troubleshooting guidance |
| **Phase 5: PR Creation** | Stages, commits, pushes, creates draft PR
with proper format and reviewers |

**Usage:**
```
Follow the msdata/direct sync agent plan in .github/agents/msdata-direct-sync-agent.agent.md
Sync the msdata/direct branch with the latest v3 master and msdata direct codebase.
```

#### 2. PowerShell Helper Script (`tools/msdata-direct-sync-helper.ps1`)

Automates the mechanical parts of the workflow. Can run the full
workflow or individual phases:

```powershell
# Full workflow
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB"

# Individual phases
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Setup
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Branch
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Sync
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase Build
.\tools\msdata-direct-sync-helper.ps1 -MsdataRepoPath "Q:\CosmosDB" -Phase PR
```

**Key features:**
- Prompts for msdata repo path at runtime (no hardcoded paths)
- Auto-detects GitHub username for branch naming
- Branch naming: `users/<username>/update_msdata_direct_<mm_dd_yyyy>`
- Automatically reverts `msdata_sync.ps1` path changes after sync
- Creates draft PR with standard reviewers and description
- Phase-by-phase execution for debugging or re-running failed steps

#### 3. Documentation Update (`docs/sync_up_msdata_direct.md`)

Updated to reference the new agent and helper script as recommended
automated alternatives, and added the latest sample PR (#5612).

### Design Decisions

- **msdata repo path prompted at runtime**: Different developers have
the repo at different local paths
- **`[Internal]` PR prefix**: This is internal tooling, not
customer-facing
- **Draft PR by default**: Follows repository convention of creating
drafts first
- **Conflict resolution strategy**: Accept incoming master changes by
default, with manual review flagged for critical files

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Does this pull request offer a public API change?

No - this is internal tooling only (agent + script), no SDK API changes.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
kirankumarkolli added a commit that referenced this pull request Mar 19, 2026
…5710)

## Summary

Merges latest master commits into the release-3.58.0-v2 branch to
include:

- [#5614](#5614)
**ThinClient Integration**: Adds support for QueryPlan in thinclient
mode
- [#5682](#5682)
**[Internal] Query**: Adds
SubstringAfter/LastSubstringAfter/SubstringBefore/LastSubstringBefore to
SDK
- [#5681](#5681)
**[Internal] Tooling**: Adds msdata/direct sync Copilot agent and helper
script

### Changelog Update
- Added PR #5614 to 3.58.0 changelog under **Added** section

This updates the existing release PR #5698.

---------

Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: yaoce <139432479+yaoce-YC@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Integration auto-merge Enables automation to merge PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants