You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix stale type names after TDS parser namespace move - #4924
Follow-up to #4810. Some string-based references still used old type names, so the compiler did not catch them. This PR fixes them and makes the affected test helpers fail fast.
TdsParserStateObjectHelper: use Parser.TdsParserStateObjectManaged; on .NET, assert the type is found.
FilteredDefaultTraceListener (stress): use Parser.* stack-frame names; validate frame names at startup.
dotnet build src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Tests/SqlClient.Stress.Tests.csproj -f net10.0: passed, with 0 warnings.
dotnet build src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj -f net10.0: passed, with 0 warnings.
A reflection check against the built net10.0 driver confirmed all three stack frames, the SqlFedAuthToken constructor and hash method, and TdsParserStateObjectManaged._sessionHandle resolve.
Not run: net462 builds, and AADFedAuthTokenRefreshTest, which needs an Azure managed identity. That test now compares real token hashes instead of "", so it may surface real refresh behavior.
Guidelines
Please review the contribution guidelines before submitting a pull request:
Update reflection, stack-frame and doc references left behind by #4810, and make
the affected test helpers fail fast instead of silently passing.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
.NET Framework compatibility and the managed-identity refresh test’s newly effective token-hash comparisons remain unverified.
No open issues 🎉
What changed in this PR
Repairs string-based references left behind by #4810’s TDS parser namespace move and makes affected test helpers fail fast. Product behavior remains unchanged.
Changes:
Updates reflection type names and stress-test stack-frame filters, adding lookup validation.
Repairs token hashing and removes catch-all blocks that hid reflection failures.
Updates the protocol guide and a commented-out reflection example.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.15%. Comparing base (7b1184b) to head (1035a44). ⚠️ Report is 74 commits behind head on main.
Returning the real hash exposes an invalid assertion in FedAuthTokenRefreshTest: it requires the old and refreshed hashes to be identical, although UserAssignedManagedIdentityProvider can acquire a new token. A successful refresh can therefore fail the test solely because the token changed. Update AADFedAuthTokenRefreshTest.cs to verify provider invocation and a later cache expiry without requiring identical token hashes.
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
Hotfix 8.0.0PRs that must be backported to release/8.0
7 participants
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.
Description
Follow-up to #4810. Some string-based references still used old type names, so the compiler did not catch them. This PR fixes them and makes the affected test helpers fail fast.
TdsParserStateObjectHelper: useParser.TdsParserStateObjectManaged; on .NET, assert the type is found.FilteredDefaultTraceListener(stress): useParser.*stack-frame names; validate frame names at startup.FedAuthTokenHelper:Parser.Login.SqlFedAuthToken.GetTokenHash, which was already broken before Refactor TDS parser into focused namespaces and files #4810. It used a missing constructor and field, so it always returned"".tds-protocol.instructions.md: replace the deletedTdsParserHelperClasses.cswithParser/Tokens/.TdsParserStateObject.cs: update a type name in a commented-out code example.No product behavior changes.
Issues
Follow-up to #4810.
Testing
dotnet build src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Tests/SqlClient.Stress.Tests.csproj -f net10.0: passed, with 0 warnings.dotnet build src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj -f net10.0: passed, with 0 warnings.net10.0driver confirmed all three stack frames, theSqlFedAuthTokenconstructor and hash method, andTdsParserStateObjectManaged._sessionHandleresolve.net462builds, andAADFedAuthTokenRefreshTest, which needs an Azure managed identity. That test now compares real token hashes instead of"", so it may surface real refresh behavior.Guidelines
Please review the contribution guidelines before submitting a pull request: