Skip to content
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

Add IDBColumnSchemaGenerator interface to netfx SqlDataReader #2967

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MichelZ
Copy link
Contributor

@MichelZ MichelZ commented Nov 2, 2024

Bring IDBColumnSchemaGenerator to netfx for later code base merging

I made sure to enable the respective test for netfx

Part of #2965

@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 2, 2024

/azp run

Copy link

Commenter does not have sufficient privileges for PR 2967 in repo dotnet/SqlClient

@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 2, 2024

@edwardneal Would you mind running the pipeline for me on this one? :)

@edwardneal
Copy link
Contributor

Thanks for this MichelZ. The changes look good to me; would you mind feeding the extra package reference through to the nuspec file and the .NET Framework reference csproj please?

I don't have access to the pipelines, but hopefully the SqlClient team will be able to look at it in a few days. Something's definitely odd there - your PRs didn't run the CI builds, and my commit ran the CI build but encountered a lot more timeouts than normal in the tests.

@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 3, 2024

Will do. I'm not a contributor, that's probably why the pipelines don't run for me (yet)
(Can you try to just do an /azp run and see what happens?)

dbColumnSchema = original.dbColumnSchema;
#else
schemaTable = original.schemaTable;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure about this one. Was the intention here to exclude schemaTable for netcore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this kind of code doesn't make a ton of sense to me (the original, that is). It'd be nice if it came with a comment that explains what's the rationale for whats going on but ... whatever.

As for your change, I'm also not 100% about it either. It basically says we assign the dbColumnSchema in netcore, and assign the schemaTable in netfx. So, I wonder if assigning both in both cases is the right behavior...

@edwardneal
Copy link
Contributor

/azp run

Copy link

Commenter does not have sufficient privileges for PR 2967 in repo dotnet/SqlClient

@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 3, 2024

Thanks for trying :)

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 3, 2024

/azp run

Copy link

Commenter does not have sufficient privileges for PR 2967 in repo dotnet/SqlClient

@benrr101
Copy link
Contributor

benrr101 commented Nov 4, 2024

@ErikEJ @edwardneal @MichelZ We have changed security rules recently such that only contributors can kick off pipeline runs. This is due to the potential for contributors to run code in PRs that could be hazardous to our build agents or cause a DoS.

@benrr101
Copy link
Contributor

benrr101 commented Nov 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Nov 5, 2024
@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 6, 2024

This package needs to be added to the sqlclientdriver nuget feed for this build to succeed:
System.Data.Common: 4.3.0

@benrr101
Copy link
Contributor

@MichelZ I might've mentioned it before but yep, we've got security on the internal nuget feed such that only contributors can pull upstream packages from the feed. I've gone ahead and added System.Data.Common 4.3.0 to the feed, so it should be good to go.

@benrr101
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd need to see @cheenamalhotra 's opinion regarding the System.Data.Common inclusion before I explicitly approve.

dbColumnSchema = original.dbColumnSchema;
#else
schemaTable = original.schemaTable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this kind of code doesn't make a ton of sense to me (the original, that is). It'd be nice if it came with a comment that explains what's the rationale for whats going on but ... whatever.

As for your change, I'm also not 100% about it either. It basically says we assign the dbColumnSchema in netcore, and assign the schemaTable in netfx. So, I wonder if assigning both in both cases is the right behavior...

@@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="System.Data.Common" Version="$(SystemDataCommonVersion)" Condition="'$(TargetFramework)' == 'net462'" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this package not compatible with netcore? I know a lot of packages are still compatible with netcore but just don't do anything in scenarios where they're not needed (eg, System.Memory being part of the netcore).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a netstandard1.2 package, there are no explicit .NET Core versions of it, so I thought better not mess with the .NET Core side

@@ -27,5 +27,6 @@
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="$(AzureIdentityVersion)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
<PackageReference Include="System.Data.Common" Version="$(SystemDataCommonVersion)" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kinda confused about this one - it seems like we've needed to build against System.Data.Common for a long time. So I'm concerned why we're only just now adding it. @cheenamalhotra do you know the history behind how we relate to System.Data.Common?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like System.Data.Common is packaged in-box with .NET Framework 4.7.1 and upwards, but since we're targeting .NET Framework 4.6.2 we need the package reference. .NET Core doesn't have this problem - all the versions we target package it in-box.

@MichelZ MichelZ force-pushed the merge-sqldatareader-IDbColumnSchemaGenerator branch from 283d72a to 7fc9351 Compare November 12, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Project 🚮 Things that relate to the common project project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants