Skip to content

Commit b458350

Browse files
authored
Merge branch 'main' into tests/flaky-tests
2 parents 358301c + c724554 commit b458350

21 files changed

Lines changed: 489 additions & 103 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ This project includes several key products and libraries that facilitate SQL Ser
5050
- **Data Encryption**: Supports data encryption for secure data transmission.
5151
- **Logging and Diagnostics**: Provides event source tracing diagnostic capabilities for troubleshooting.
5252
- **Failover Support**: Handles automatic failover scenarios for high availability.
53+
- Compatibility switch: `Switch.Microsoft.Data.SqlClient.UseLegacyFailoverAlternationOnLoginSqlErrors` (default `false`) can restore legacy alternation behavior in `LoginWithFailover` for login-phase SQL errors.
5354
- **Cross-Platform Support**: Compatible with both .NET Framework and .NET Core, allowing applications to run on Windows, Linux, and macOS.
5455
- **Column Encryption AKV Provider**: Supports Azure Key Vault (AKV) provider for acquiring keys from Azure Key Vault to be used for encryption and decryption.
5556

.github/instructions/features.instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ AppContext switches allow runtime behavior changes without modifying connection
246246
| `Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault` | `false` | Sets `MultiSubnetFailover=true` as the default for all connections |
247247
| `Switch.Microsoft.Data.SqlClient.EnableUserAgent` | varies | Controls sending user agent information to SQL Server |
248248
| `Switch.Microsoft.Data.SqlClient.IgnoreServerProvidedFailoverPartner` | `false` | Ignores failover partner information sent by the server |
249+
| `Switch.Microsoft.Data.SqlClient.UseLegacyFailoverAlternationOnLoginSqlErrors` | `false` | Restores legacy `LoginWithFailover` alternation for login-phase SQL errors when parser state is not `Closed` |
249250
| `Switch.Microsoft.Data.SqlClient.LegacyRowVersionNullBehavior` | `false` | Restores legacy null handling for rowversion columns |
250251
| `Switch.Microsoft.Data.SqlClient.LegacyVarTimeZeroScaleBehaviour` | `false` | Restores legacy zero-scale behavior for time/datetime2/datetimeoffset |
251252
| `Switch.Microsoft.Data.SqlClient.MakeReadAsyncBlocking` | `false` | Makes ReadAsync behave synchronously (legacy compat) |

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ jobs:
7272
uses: actions/setup-dotnet@v5.2.0
7373
with:
7474
global-json-file: global.json
75+
76+
- name: Restore dotnet tools
77+
shell: bash
78+
run: dotnet tool restore
7579

7680
# Initializes the CodeQL tools for scanning.
7781
- name: Initialize CodeQL

.vscode/mcp.json

Lines changed: 0 additions & 75 deletions
This file was deleted.

AGENTS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ Do **not** create branches directly under `main`, `dev/`, or any other top-level
7979
### Bug Fix Workflow
8080
1. Understand the issue from the bug report
8181
2. Locate relevant code in `src/Microsoft.Data.SqlClient/src/` (do NOT modify legacy `netcore/src/` or `netfx/src/`)
82-
3. Write a failing test that reproduces the issue
83-
4. Implement the fix
84-
5. Ensure all tests pass
85-
6. Update documentation if behavior changes
82+
3. Check `.github/instructions/features.instructions.md` for existing AppContext switches (including failover compatibility switches) before introducing behavior changes
83+
4. Write a failing test that reproduces the issue
84+
5. Implement the fix
85+
6. Ensure all tests pass
86+
7. Update documentation if behavior changes
8687

8788
### Feature Implementation
8889
1. Review the feature specification

BUILDGUIDE.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@ on operating systems that do not support .NET Framework. As such, it is not nece
1919

2020
### Miscellaneous
2121

22-
**PowerShell** is required to run several miscellaneous tasks as part of building and packaging. On
23-
Windows systems, either the built-in `powershell.exe` will be used, or if installed, the modern
24-
`pwsh` will be used. On Linux and macOS systems, the `pwsh` command is required to be in the `$PATH`
25-
environment variable. For specific instructions see: [Install
26-
PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell)
22+
**PowerShell** is included as a .NET local tool in this repository. Running `dotnet tool restore`
23+
(see below) will make it available via `dotnet tool run pwsh -- <args>`. Note that `pwsh` is not
24+
added to PATH — it must be invoked through `dotnet tool run`. Build targets handle this
25+
automatically; manual invocation is only needed for ad-hoc scripting.
2726

2827
The **NuGet** binary is optional for inspection and feed-management workflows, but build and packaging flows in this
2928
repository are run through `dotnet build` against `build.proj`.
3029

30+
### .NET Tools
31+
32+
This repository uses .NET local tools (e.g. PowerShell) that must be restored before building. Run the following from the repository root:
33+
34+
```bash
35+
dotnet tool restore
36+
```
37+
3138
## Developer Workflow
3239

3340
Once you've cloned the repository and made your changes to the codebase, it is time to build, test, and optionally

dotnet-tools.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
"apicompat"
1616
],
1717
"rollForward": false
18+
},
19+
"powershell": {
20+
"version": "7.6.0",
21+
"commands": [
22+
"pwsh"
23+
],
24+
"rollForward": false
1825
}
1926
}
2027
}

eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ jobs:
134134
# Install the .NET SDK.
135135
- template: /eng/pipelines/steps/install-dotnet.yml@self
136136

137+
# Restore dotnet CLI tools (e.g. pwsh, apicompat) before building.
138+
- template: /eng/pipelines/steps/restore-dotnet-tools.yml@self
139+
137140
# When we're performing a Debug build, we still want to try _compiling_ the
138141
# code in Release mode to ensure downstream pipelines don't encounter
139142
# compilation errors. We won't use the Release artifacts for anything else

eng/pipelines/common/templates/jobs/ci-run-tests-job.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ jobs:
222222
${{ else }}:
223223
runtimes: [8.x, 9.x]
224224

225+
# Restore dotnet CLI tools (e.g. pwsh, apicompat) before building.
226+
- template: /eng/pipelines/steps/restore-dotnet-tools.yml@self
227+
225228
- ${{ if ne(parameters.prebuildSteps, '') }}:
226229
- ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration
227230

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#################################################################################
2+
# Licensed to the .NET Foundation under one or more agreements. #
3+
# The .NET Foundation licenses this file to you under the MIT license. #
4+
# See the LICENSE file in the project root for more information. #
5+
#################################################################################
6+
7+
# Restores dotnet CLI tools defined in dotnet-tools.json.
8+
# This step should be invoked after install-dotnet.yml and before any build
9+
# steps that depend on the restored tools (e.g. pwsh, apicompat).
10+
11+
steps:
12+
- script: dotnet tool restore
13+
displayName: Restore .NET Tools
14+
workingDirectory: $(Build.SourcesDirectory)

0 commit comments

Comments
 (0)