[Internal] Tooling: Adds msdata/direct sync Copilot agent and helper script#5681
Merged
microsoft-github-policy-service[bot] merged 7 commits intomasterfrom Mar 18, 2026
Conversation
…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>
kirankumarkolli
previously approved these changes
Mar 11, 2026
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>
aavasthy
approved these changes
Mar 17, 2026
kirankumarkolli
approved these changes
Mar 17, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
This PR adds a Copilot agent and PowerShell helper script to automate the
msdata/directbranch sync workflow, which merges the v3masterbranch intomsdata/directand 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:
msdata/direct, merges latestmaster, resolves conflictsmsdata_sync.ps1with user-provided repo path, handles missing filesdotnet buildto verify sync succeeded, provides troubleshooting guidanceUsage:
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:
Key features:
users/<username>/update_msdata_direct_<mm_dd_yyyy>msdata_sync.ps1path changes after sync3. 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
[Internal]PR prefix: This is internal tooling, not customer-facingType of change
Does this pull request offer a public API change?
No - this is internal tooling only (agent + script), no SDK API changes.