Skip to content

Commit 1e6d562

Browse files
committed
Merge remote-tracking branch 'upstream/main' into GetColumnSchemaKeyInfo
2 parents 2a6a1ce + 3ae3274 commit 1e6d562

182 files changed

Lines changed: 6946 additions & 6179 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ When a new issue is created, follow these steps:
129129
- Suggest release note entries for fixes by updating files under `release-notes/` or by using the `release-notes` prompt (instead of editing `CHANGELOG.md` directly).
130130
- Tag reviewers based on `CODEOWNERS` file
131131

132+
## 🌿 Branch Naming
133+
- All branches created by AI agents **must** use the `dev/automation/` prefix (e.g. `dev/automation/fix-connection-timeout`).
134+
- Do **not** create branches directly under `main`, `dev/`, or any other top-level prefix.
135+
132136
## 🧠 Contextual Awareness
133137
- All source code is in `src/Microsoft.Data.SqlClient/src/`. Do NOT add code to legacy `netfx/src/` or `netcore/src/` directories.
134138
- Only `ref/` folders in `netcore/ref/` and `netfx/ref/` remain active for defining the public API surface.

.github/instructions/onebranch-pipeline-design.instructions.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Defined in `stages/build-stages.yml`. Four build stages plus validation, ordered
3636
- **`build_addons`** (Stage 4) — AKV Provider; `dependsOn: build_dependent`; downloads SqlClient + Abstractions + Logging artifacts
3737
- **`mds_package_validation`** — Validates signed SqlClient package; `dependsOn: build_dependent`; runs in parallel with Stage 4
3838

39+
Each build job copies PDB files into `$(JOB_OUTPUT)/symbols/` so they are included in the auto-published pipeline artifact alongside the NuGet packages in `$(JOB_OUTPUT)/packages/`.
40+
3941
Stage conditional rules:
4042
- Wrap stages/jobs in `${{ if }}` compile-time conditionals based on build parameters
4143
- `buildSqlClient` controls Stages 2, 3, validation, and Logging (when AKV is disabled)
@@ -45,17 +47,32 @@ Stage conditional rules:
4547

4648
## Job Templates
4749

48-
- **`build-signed-csproj-package-job.yml`** — Generic job for csproj-based packages (Logging, SqlServer.Server, Abstractions, Azure, AKV Provider). Flow: Build DLLs → ESRP DLL signing → NuGet pack (`NoBuild=true`) → ESRP NuGet signing
49-
- **`build-signed-sqlclient-package-job.yml`** — SqlClient-specific job (nuspec-based). Flow: Build all configurations → ESRP DLL signing (main + resource DLLs) → NuGet pack via nuspec → ESRP NuGet signing
50+
- **`build-signed-csproj-package-job.yml`** — Generic job for csproj-based packages (Logging, SqlServer.Server, Abstractions, Azure, AKV Provider). Flow: Build DLLs → ESRP DLL signing → NuGet pack (`NoBuild=true`) → ESRP NuGet signing → Copy PDBs to artifact
51+
- **`build-signed-sqlclient-package-job.yml`** — SqlClient-specific job (nuspec-based). Flow: Build all configurations → ESRP DLL signing (main + resource DLLs) → NuGet pack via nuspec → ESRP NuGet signing → Copy PDBs to artifact
5052
- **`validate-signed-package-job.yml`** — Validates signed MDS package (signature, strong names, folder structure, target frameworks)
5153
- **`publish-nuget-package-job.yml`** — Reusable release job using OneBranch `templateContext.type: releaseJob` with `inputs` for artifact download; pushes via `NuGetCommand@2`
54+
- **`publish-symbols-job.yml`** — Reusable symbols job: downloads a build artifact, locates PDBs under `symbols/`, and invokes `publish-symbols-step.yml`
5255

5356
When adding a new csproj-based package:
5457
- Use `build-signed-csproj-package-job.yml` with appropriate `packageName`, `packageFullName`, `versionProperties`, and `downloadArtifacts`
5558
- Add build and pack targets to `build.proj`
5659
- Add version variables to `variables/common-variables.yml`
5760
- Add artifact name variable to `variables/onebranch-variables.yml`
5861

62+
## Symbols Publishing Stage
63+
64+
- Defined in `stages/publish-symbols-stage.yml`; produces stage `publish_symbols`
65+
- Entire stage excluded at compile time when `publishSymbols` is false
66+
- `dependsOn` is conditional based on which `build*` parameters are set, mirroring the build stage dependency graph
67+
- One job per package (`publish-symbols-job.yml`), each downloading its build artifact and publishing PDBs from `symbols/`
68+
- Each package's PDBs are published separately with unique artifact names and version information
69+
- Build jobs copy PDBs into `$(JOB_OUTPUT)/symbols/` so they are included in the auto-published artifact
70+
- The `publish-symbols-step.yml` accepts a `symbolsFolder` parameter to point at the downloaded PDB location
71+
- The publish step calls an extracted `publish-symbols.ps1` script with structured error handling and diagnostic logging
72+
- Symbols publishing credentials come from the `Symbols Publishing` variable group
73+
- In the official pipeline, symbol server destination follows `releaseToProduction`: Production when true, PPE when false
74+
- Non-official pipeline always targets the PPE symbol server
75+
5976
## Release Stage
6077

6178
- Defined in `stages/release-stages.yml`; produces stage `release_production` (official) or `release_test` (non-official) via `stageNameSuffix` parameter
@@ -84,7 +101,9 @@ Release parameters (all boolean, default `false`):
84101
- `releaseSqlServerServer`, `releaseLogging`, `releaseAbstractions`, `releaseSqlClient`, `releaseAzure`, `releaseAKVProvider`
85102

86103
Official-only parameter:
87-
- `releaseToProduction` — push to NuGet Production feed (default `false`)
104+
- `releaseToProduction` — controls both NuGet target feed and symbol server destination (default `false`):
105+
- `true` → NuGet Production feed + Production symbol server
106+
- `false` → NuGet Test feed + PPE symbol server
88107

89108
When `isPreview` is true, pipeline resolves `effective*Version` variables to preview versions; otherwise GA versions. All versions defined in `variables/common-variables.yml`.
90109

@@ -98,8 +117,7 @@ When `isPreview` is true, pipeline resolves `effective*Version` variables to pre
98117
- When adding a new package, add GA version, preview version, and assembly file version entries
99118

100119
Variable groups:
101-
- `Release Variables` — release configuration (in `common-variables.yml`)
102-
- `Symbols publishing` — symbol publishing credentials (in `common-variables.yml`)
120+
- `Symbols Publishing` — symbol publishing credentials (in `onebranch-variables.yml`)
103121
- `ESRP Federated Creds (AME)` — ESRP signing credentials (in `common-variables.yml`)
104122

105123
## Code Signing (ESRP)
@@ -115,15 +133,19 @@ Variable groups:
115133

116134
- TSA: enabled only in official pipeline; disabled in non-official to avoid spurious alerts
117135
- ApiScan: enabled in both; currently `break: false` pending package registration
118-
- Each build job sets `ob_sdl_apiscan_*` variables pointing to `$(Build.SourcesDirectory)/apiScan/<PackageName>/`
136+
- Each build job sets `ob_sdl_apiscan_softwareFolder` to `$(JOB_OUTPUT)/assemblies` and `ob_sdl_apiscan_symbolsFolder` to `$(JOB_OUTPUT)/symbols`
119137
- CodeQL, SBOM, Policheck (`break: true`): enabled in both pipelines
120138
- asyncSdl `enabled: false` in both; individual sub-tools (CredScan, BinSkim, Armory, Roslyn) configured underneath
121139
- Policheck exclusions: `$(REPO_ROOT)\.config\PolicheckExclusions.xml`
122140
- CredScan suppressions: `$(REPO_ROOT)/.config/CredScanSuppressions.json`
123141

124142
## Artifact Conventions
125143

126-
- `ob_outputDirectory` set to `$(PACK_OUTPUT)` (= `$(REPO_ROOT)/output`) — OneBranch auto-publishes this directory
144+
- `ob_outputDirectory` set to `$(JOB_OUTPUT)` (= `$(REPO_ROOT)/output`) — OneBranch auto-publishes this directory
145+
- Each published artifact uses subdirectories to separate file types:
146+
- `assemblies/` — DLL assemblies for APIScan (preserving TFM folder structure)
147+
- `packages/` — NuGet packages (`.nupkg`, `.snupkg`)
148+
- `symbols/` — PDB symbol files (preserving TFM folder structure, shared by APIScan and symbol publishing)
127149
- Artifact names follow `drop_<stageName>_<jobName>` — defined in `variables/onebranch-variables.yml`
128150
- Downstream jobs download artifacts via `DownloadPipelineArtifact@2` into `$(Build.SourcesDirectory)/packages`
129151
- Downloaded packages serve as a local NuGet source for `dotnet restore`

.github/prompts/code-review.prompt.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
22
name: code-review
3-
description: AI-assisted code review for a pull request in Microsoft.Data.SqlClient.
3+
description: AI-assisted code review for a pull request or branch in Microsoft.Data.SqlClient.
44
argument-hint: <PR number or branch name>
55
agent: agent
6-
tools: ['github/search_issues', 'read/readFile', 'codebase/search']
6+
tools: ['github/search_issues', 'github/pull_request_read', 'github/get_file_contents', 'github/run_secret_scanning', 'read/readFile', 'search']
77
---
88

9-
Review the pull request "${input:pr}" in `dotnet/SqlClient`.
9+
Review the changes in "${input:target}" for `dotnet/SqlClient`.
10+
11+
The target may be either a **PR number** (e.g., `4106`) or a **branch name** (e.g., `dev/user/my-feature`). Determine which by checking whether the value is purely numeric.
1012

1113
Follow this structured review process:
1214

1315
## 1. Understand the Change
14-
- Fetch the PR details: title, description, linked issue(s), and diff.
1516
- Read the PR description to understand the intent and scope of the change.
17+
- Check for linked issues referenced in the description (e.g., `Fixes #...`).
1618
- Check which files are modified and categorize them:
1719
- **Source code** (`src/Microsoft.Data.SqlClient/src/`) — the main review focus
1820
- **Tests** (`tests/`) — verify coverage

.github/prompts/generate-doc-comments.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: doc-comments
2+
name: generate-doc-comments
33
description: Generate XML documentation comments for C# code following .NET best practices.
44
argument-hint: <code>
55
agent: agent

.github/prompts/generate-prompt.prompt.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: generate-prompt
33
description: Generates high-quality VS Code Copilot prompt files (.prompt.md) based on user descriptions, leveraging available skills.
44
argument-hint: Describe the prompt you want to create (e.g., "A prompt to generate unit tests for C#")
5+
tools: [read, edit, search, todo]
56
---
67
You are an expert AI prompt developer specialized in creating **Visual Studio Code Copilot Prompt Files (`.prompt.md`)**.
78

@@ -34,6 +35,7 @@ Before generating the prompt, review the available skills in the `.github/skills
3435
* `name`: A concise, kebab-case name for the prompt.
3536
* `description`: A clear, short description of what the prompt does.
3637
* `argument-hint`: (Optional) A hint for what arguments the user can provide when using the prompt.
38+
* `tools`: (Recommended) A list of tool identifiers the prompt is allowed to use. See the **Tool Scoping** section below.
3739
* **Body Structure**:
3840
* **Role**: Define the AI's persona (e.g., "You are an expert C# developer...").
3941
* **Context**: Include specific context instructions or references.
@@ -50,19 +52,78 @@ Before generating the prompt, review the available skills in the `.github/skills
5052
* Use `${input:variableName}` for user inputs (e.g., `${input:methodName}`).
5153
* Use built-in variables like `${selection}`, `${file}`, or `${workspaceFolder}` where appropriate context is needed.
5254

53-
6. **Best Practices**:
55+
6. **Scope Tools**: Restrict the tools available to each prompt using the `tools` frontmatter field. See the **Tool Scoping** section below for detailed guidance.
56+
57+
7. **Best Practices**:
5458
* Be specific and explicit.
5559
* Encourage chain-of-thought reasoning if the task is complex.
5660
* Reference workspace files using Markdown links `[path/to/file.cs](path/to/file.cs)` only if they are static and necessary for *all* invocations of this prompt.
5761
* Prefer referencing skills over duplicating instructions that already exist in skills.
5862

63+
## Tool Scoping
64+
65+
Every generated prompt **should** include a `tools` list in its YAML frontmatter. Scoping tools keeps the model focused by limiting it to approved, known-effective tools for the task. Without tool scoping, the model may invoke irrelevant tools, waste context, or produce unpredictable results.
66+
67+
### Why scope tools?
68+
- **Focus**: Fewer tools means the model spends less reasoning on tool selection and more on the task.
69+
- **Reliability**: Restricting to tested tools avoids unexpected side effects (e.g., a read-only review prompt shouldn't have edit tools).
70+
- **Safety**: Prevents prompts from accidentally running terminal commands or making file changes when they shouldn't.
71+
72+
### How to choose tools
73+
Apply the **principle of least privilege** — include only the tools the prompt actually needs:
74+
75+
| Prompt type | Recommended tools |
76+
|---|---|
77+
| **Read-only analysis** (review, triage, explain) | `read/readFile`, `search/codebase`, `search/textSearch` |
78+
| **Code editing** (bug fix, feature, refactor) | `edit/editFiles`, `edit/createFile`, `read/readFile`, `search/codebase` |
79+
| **Needs terminal** (build, test, scripts) | All of the above + `execute/runInTerminal`, `execute/getTerminalOutput` |
80+
| **Needs GitHub data** (triage, release notes) | All of the above + `github/search_issues` or other GitHub tools |
81+
| **Needs web content** (docs lookup) | `web/fetch` |
82+
83+
### Available built-in tool identifiers
84+
85+
You can specify individual tools or tool sets (which include all tools in that group).
86+
87+
**Tool sets** (use these to include all tools in a category):
88+
- `edit` — File creation and editing tools
89+
- `read` — File and notebook reading tools
90+
- `search` — Codebase, text, and file search tools
91+
- `execute` — Terminal, task, and notebook execution tools
92+
- `web` — Web content fetching tools
93+
94+
**Commonly used individual tools:**
95+
96+
| Tool identifier | Purpose |
97+
|---|---|
98+
| `edit/editFiles` | Apply edits to existing files |
99+
| `edit/createFile` | Create a new file |
100+
| `read/readFile` | Read file contents |
101+
| `read/problems` | Get workspace problems/diagnostics |
102+
| `search/codebase` | Semantic code search |
103+
| `search/textSearch` | Text/regex search in files |
104+
| `search/fileSearch` | Search for files by glob pattern |
105+
| `search/listDirectory` | List directory contents |
106+
| `search/usages` | Find references and implementations |
107+
| `execute/runInTerminal` | Run a shell command |
108+
| `execute/getTerminalOutput` | Get terminal output |
109+
| `execute/testFailure` | Get test failure details |
110+
| `web/fetch` | Fetch a web page |
111+
112+
**Extension / MCP tools** can also be included using their identifier (e.g., `github/search_issues`). Use `<server-name>/*` to include all tools from an MCP server.
113+
114+
### Frontmatter syntax
115+
```yaml
116+
tools: ['read/readFile', 'search/codebase', 'edit/editFiles']
117+
```
118+
59119
## Example Output Structure (with skill reference)
60120
61121
```markdown
62122
---
63123
name: my-new-prompt
64124
description: specialized task description
65125
argument-hint: input parameter hint
126+
tools: ['edit/editFiles', 'read/readFile', 'search/codebase', 'execute/runInTerminal']
66127
---
67128
You are a specialized agent for...
68129

@@ -89,6 +150,7 @@ Use ${input:param1} to...
89150
name: my-new-prompt
90151
description: specialized task description
91152
argument-hint: input parameter hint
153+
tools: ['read/readFile', 'search/codebase']
92154
---
93155
You are a specialized agent for...
94156

.github/prompts/generate-skill.prompt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name: generate-skill
33
description: Generate a GitHub Copilot Agent Skill (SKILL.md) following best practices and official documentation
44
argument-hint: Describe the skill you want to create (e.g., "debugging SQL connection issues")
5+
agent: agent
6+
tools: ['read/readFile', 'edit/createFile', 'search']
57
---
68
You are an expert developer specialized in creating **GitHub Copilot Agent Skills**.
79

.github/prompts/refine-test-overlap.prompt.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
name: test-minimize-overlap
2+
name: refine-test-overlap
33
description: Run coverage overlap analysis and suggest test suite optimizations
44
argument-hint: Test filter (e.g. FullyQualifiedName~MyTests) or describe the tests you want to analyze
5+
agent: agent
6+
tools: ['edit/editFiles', 'read/readFile', 'search/codebase', 'execute/runInTerminal', 'execute/getTerminalOutput']
57
---
68
You are an expert .NET Test Engineer specialized in optimizing test coverage and reducing technical debt.
79

@@ -10,19 +12,19 @@ Your task is to analyze the user's test suite using the `AnalyzeTestOverlap.ps1`
1012

1113
## Skills
1214
This prompt leverages the following skills for specific sub-tasks:
13-
- [generate-mstest-filter](../skills/generate-mstest-filter/SKILL.md) - For generating well-formed MSTest filter expressions
15+
- [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) - For generating well-formed MSTest filter expressions
1416

1517
## Tools
16-
You have access to the analysis script at `[AnalyzeTestOverlap.ps1](./scripts/AnalyzeTestOverlap.ps1)`.
18+
You have access to the analysis script at [AnalyzeTestOverlap.ps1](.github/prompts/scripts/AnalyzeTestOverlap.ps1).
1719

1820
## Workflow
1921
1. **Parse or Generate Test Filter**:
2022
* If `${input:filter}` is a valid MSTest filter expression (e.g., `FullyQualifiedName~MyTests`), use it directly.
21-
* If `${input:filter}` is a loose description (e.g., "connection tests" or "SqlCommand class"), follow the instructions in the [generate-mstest-filter](../skills/generate-mstest-filter/SKILL.md) skill to generate a proper filter expression.
23+
* If `${input:filter}` is a loose description (e.g., "connection tests" or "SqlCommand class"), follow the instructions in the [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) skill to generate a proper filter expression.
2224
* If `${input:filter}` is empty, ask the user for a test filter or description to target specific tests.
2325

2426
2. **Run Analysis**:
25-
* Run the script using the filter: `.\scripts\AnalyzeTestOverlap.ps1 -Filter "<filter>"`.
27+
* Run the script from the workspace root: `.\.github\prompts\scripts\AnalyzeTestOverlap.ps1 -Filter "<filter>"`.
2628
* *Note*: The script produces a console summary and a `test-coverage-analysis.json` file.
2729

2830
3. **Review Overlap**:

.github/prompts/update-build-pipelines.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: update-build-pipelines
33
description: Guided workflow for updating Azure DevOps CI/CD pipelines for Microsoft.Data.SqlClient.
44
argument-hint: <describe the pipeline change needed>
55
agent: agent
6-
tools: ['edit/createFile', 'edit/editFiles', 'read/readFile', 'codebase/search']
6+
tools: ['edit/createFile', 'edit/editFiles', 'read/readFile', 'search']
77
---
88

99
Update the Azure DevOps build pipelines for: "${input:change}".

0 commit comments

Comments
 (0)