-
Notifications
You must be signed in to change notification settings - Fork 321
Azure Split - Step 2 - New Files #3904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request is Step 2 of the Azure split effort, adding new Abstractions and Azure extension packages to decouple Azure dependencies from the main Microsoft.Data.SqlClient package. The PR introduces two new packages with their source code, tests, documentation, and CI/CD pipeline configurations while standardizing CLS compliance across projects.
Changes:
- Added new Microsoft.Data.SqlClient.Extensions.Abstractions package with base types for authentication and related abstractions
- Added new Microsoft.Data.SqlClient.Extensions.Azure package containing Azure authentication implementations moved from MDS
- Standardized CLS compliance by using AssemblyAttribute declarations instead of embedded assembly attributes
- Added comprehensive CI/CD pipeline support for building and testing both new packages across multiple platforms
Reviewed changes
Copilot reviewed 69 out of 69 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/targets/GenerateThisAssemblyCs.targets | Simplified to unconditionally generate ThisAssembly.cs with configurable namespace |
| tools/props/Versions.props | Added imports for Abstractions and Azure version properties |
| src/Microsoft.Data.SqlClient/tests/tools/TDS/**/*.csproj | Removed ClsCompliant property (standardization) |
| src/Microsoft.Data.SqlClient/**/Microsoft.Data.SqlClient.csproj | Added CLS compliance via AssemblyAttribute |
| src/Microsoft.Data.SqlClient.sln | Added folder structure and projects for Abstractions and Azure packages |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/** | Complete Abstractions package with source, tests, and documentation |
| src/Microsoft.Data.SqlClient.Extensions/Azure/** | Complete Azure package with source, tests, and documentation |
| eng/pipelines/** | New CI/CD stages, jobs, and variables for building/testing new packages |
| build.proj | Added targets for building Abstractions and Azure packages |
| Directory.Packages.props | Added package version management for new packages |
| BUILDGUIDE.md | Updated documentation with new build targets |
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderException.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/TDS.Servers.csproj
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 72 out of 72 changed files in this pull request and generated no new comments.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #3904 +/- ##
==========================================
- Coverage 74.93% 67.52% -7.41%
==========================================
Files 269 263 -6
Lines 43247 66191 +22944
==========================================
+ Hits 32407 44696 +12289
- Misses 10840 21495 +10655
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 72 out of 72 changed files in this pull request and generated 3 comments.
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 72 out of 72 changed files in this pull request and generated 8 comments.
src/Microsoft.Data.SqlClient.Extensions/Azure/test/StringExtensions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProvider.Internal.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderException.cs
Show resolved
Hide resolved
- Added the new Abstractions and Azure source files and associated pipeline files. - Setup build.proj targets and default version numbers. - Standardized project CLS compliance.
- Added ThisAssembly generation to Abstractions. - Fixed branch wildcards in PR pipeline and CodeQL workflow triggers.
- Fixed paratemer name typo.
- Fixed cyclic dependency.
- Inhibited some Azure tests that won't pass yet. - Addressed Copilot comments in the PR.
- Addressed Copilot suggestions.
30140f6 to
18ac28b
Compare
- Fixed a couple of rebase artifacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 72 out of 72 changed files in this pull request and generated 5 comments.
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderException.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/test/StringExtensions.cs
Outdated
Show resolved
Hide resolved
mdaigle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One required change. Others are suggestions for future.
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProvider.cs
Outdated
Show resolved
Hide resolved
benrr101
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of my comments are probably unactionable today, but I'd at least like to see some todo's added to address them later.
| public DateTimeOffset ExpiresOn { get; } | ||
|
|
||
| /// <include file='../doc/SqlAuthenticationToken.xml' path='docs/members[@name="SqlAuthenticationToken"]/ctor/*'/> | ||
| public SqlAuthenticationToken( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constructors go before properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paradigm I've implemented for partial is the files should have a . between the class and the contents of the partial (see SqlCommand for example)
Ideally the block comment for the class should have a tag to explain what's in this particular partial. But if that interferes with the official docs, no worries about omitting it.
| as SqlAuthenticationProvider; | ||
| } | ||
| catch (Exception ex) | ||
| when (ex is InvalidOperationException || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this, you an do ex is Abc or Def or Ghi I usually format multiline ones as
ex is Abc
or Def
or Ghi
| // via Theory data so that we detect any new methods that don't meet | ||
| // our expectations. | ||
| foreach (var method in | ||
| #if NET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a nit but I reaaaaaaaaaaly hate precompiler directives within a line. Can we move this to a variable and use the variable in the foreach?
| // methods of the SqlAuthenticationProvider class in the Abstractions | ||
| // package. We're testing this here because this test project uses both of | ||
| // those packages, and this is a convenient place to put such a test. | ||
| [Fact] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a hard time describing what I think it wrong with this test, but something feels off... I'm wondering if this could be a theory, I'm wondering what's the disconnect between testingn every enum value while having only the AAD providers in the list, I'm wondering whether we expect to ever get an enum value outside that list or a provider that is isn't ours when running this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test will end up living in a new MDS test project specifically for testing auth provider integration. I will make a note of that.
| /// </summary> | ||
| internal static class StringExtensions | ||
| { | ||
| internal static bool Empty(this string str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will argue this should be "IsEmpty".
Unless you actually want to "empty" the string and just royally messed up the implementation 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just string::empty() in C++, which I prefer. But I guess C# folks like verbs 😄
- Addressed comments/suggestions in the PR.
- Trying to fix shell argument quoting for --filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 72 out of 72 changed files in this pull request and generated 2 comments.
Description
This PR contains the new Abstractions and Azure package files:
PR series:
Testing