Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add string overloads to DbDataReader.Get*()#35211

Merged
ajcvickers merged 1 commit intodotnet:masterfrom
TheBlueSky:dbdatareader-string-overloads
Feb 26, 2019
Merged

Add string overloads to DbDataReader.Get*()#35211
ajcvickers merged 1 commit intodotnet:masterfrom
TheBlueSky:dbdatareader-string-overloads

Conversation

@TheBlueSky
Copy link
Contributor

Implement #31595

@TheBlueSky
Copy link
Contributor Author

@roji, any hint regarding the failing checks? :|

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 9, 2019

I think you can ignore the non-ci builds, those are being replaced by the CI versions.
There are actual build failures though,

2019-02-09T18:44:29.0849657Z System\Data\Common\DbDataReaderTest.cs(88,49): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1079635Z System\Data\Common\DbDataReaderTest.cs(103,46): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1111832Z System\Data\Common\DbDataReaderTest.cs(119,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1176328Z System\Data\Common\DbDataReaderTest.cs(138,46): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1181986Z System\Data\Common\DbDataReaderTest.cs(156,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1370569Z System\Data\Common\DbDataReaderTest.cs(175,50): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1371002Z System\Data\Common\DbDataReaderTest.cs(190,49): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1371297Z System\Data\Common\DbDataReaderTest.cs(205,48): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1371582Z System\Data\Common\DbDataReaderTest.cs(251,60): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1371838Z System\Data\Common\DbDataReaderTest.cs(270,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1372129Z System\Data\Common\DbDataReaderTest.cs(285,46): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1372418Z System\Data\Common\DbDataReaderTest.cs(300,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1372696Z System\Data\Common\DbDataReaderTest.cs(315,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1373154Z System\Data\Common\DbDataReaderTest.cs(330,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1373875Z System\Data\Common\DbDataReaderTest.cs(379,48): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1374228Z System\Data\Common\DbDataReaderTest.cs(402,48): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1374599Z System\Data\Common\DbDataReaderTest.cs(451,56): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1374942Z System\Data\Common\DbDataReaderTest.cs(469,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1375318Z System\Data\Common\DbDataReaderTest.cs(483,47): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]
2019-02-09T18:44:29.1375689Z System\Data\Common\DbDataReaderTest.cs(484,46): error CS1503: Argument 1: cannot convert from 'string' to 'int' [D:\a\1\s\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]

try doing build src\System.Data.Common -allconfigurations which will run all the various builds and you'll get errors from some of them. You may have to dabble with the conditional inclusions in the csproj file to include/exclude some things.

@TheBlueSky
Copy link
Contributor Author

Yeah, so those error in the logs, but couldn't figure out why. It looks like the rest class couldn't see the changes in src/System/Data/Common/DbDataReader.cs for some reason.

Would like a hint on where to start looking.

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 10, 2019

Does it repro locally for the failing target? So if you specify the netfx target do you get a clean build locally?

@TheBlueSky
Copy link
Contributor Author

build src\System.Data.Common -allconfigurations didn't work with me; I got the following error:

C:\Users\Essam\.nuget\packages\microsoft.dotnet.corefxtesting\1.0.0-beta.19105.4\build\core\Core.targets(56,5): error MSB3030: Could not copy the file "E:\Projects\.github\corefx\artifacts\bin\runtime/netcoreapp-Windows_NT-Debug-x64/xunit.execution.desktop.dll" because it was not found. [E:\Projects\.github\corefx\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]

And then the errors that are shown in the CI builds; i.e., error CS1503: Argument 1: cannot convert from 'string' to 'int'.

However, when I try to build without specifying the framework or build individual frameworks, the build succeeds; e.g., build -framework netcoreapp, build -framework netfx, and build -framework uap.

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 10, 2019

Have you done build -allconfigurations and build -release from the corefx root? those two should restore all the dependencies.

@TheBlueSky
Copy link
Contributor Author

I ran build -allconfigurations and build -release and both completed successfully. However, I'm still getting the error shown in the CI builds (not the "Could not copy the file" one) when I ran build src\System.Data.Common -allconfigurations.

I followed this document (https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md) to get started. I'm not sure I missed something.

Also, if the build fails in CI pipeline, I'm not sure it's related to dependencies. For some reason, certain configurations cannot see the changes I did to src/System/Data/Common/DbDataReader.cs file.

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 10, 2019

It's not just you, I've replicated the problem and I know my setup works. Started from clean (clean -all) and then ran the allconfigurations and release builds as I asked you to. Then branched and edited in your changes. The tests don't build once they're applied.

What I can't see is how the tests are supposed to be resolving the main library, there's no reference in the project. If it's using nuget then it won't work until the package is rebuilt and I've no good way to do that (when required I edited the nuget package but obviously that won't work in the ci).

So, bat signal time @safern to the rescue! hopefully...

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 14, 2019

Lets see if the area owners can help, /cc @divega, @ajcvickers, @afsanehr, @David-Engel, @tarikulsabbir

@divega
Copy link

divega commented Feb 14, 2019

@karelz Any idea of can help with this? Are checks working normally at the moment? When I click on the Details for the failed checks I get 404s.

@safern
Copy link
Member

safern commented Feb 14, 2019

The thing is that some of the builds doesn’t exist anymore, they where deleted. So we need to close and reopen the PR.

@safern safern closed this Feb 14, 2019
@safern safern reopened this Feb 14, 2019
@safern
Copy link
Member

safern commented Feb 14, 2019

Also it would be great if this PR could be rebased on top of master and push a new commit so that the CI system reboots and the latest changes take effect.

Once I can see the failures I can help to reproduce and find the issue.

@TheBlueSky
Copy link
Contributor Author

TheBlueSky commented Feb 15, 2019

@safern and @divega, I rebased the branch and the build results are accessible now and show the error.

@TheBlueSky
Copy link
Contributor Author

@roji, can you have a look?

@benaadams
Copy link
Member

Does System.Data.Common type forward to inbox on NETFX and UWP?

i.e. do they need to be netcoreapp only?

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 21, 2019

It looks like @benaadams might have found the answer. All corefx assemblies have an inbox attribute applied through metadata [assembly: AssemblyMetadata("PreferInbox", "True")] which the loader will check and then revert to the inbox version if there is one. So on netfx since there's a version of System.Data.Common already it loads that.

The fix is to make the ref class partial and use a second file called System.Data.Common.netcoreapp.cs to hold the new parts and then in the csproj conditionally include that element using a condition like Condition="'$(TargetsNetCoreApp)' == 'true'. You'll also have to make the tests netcoreapp only or they'll fail to compile or fail to run.

I could be wrong but it's worth a try I'd say, the only other option is to keep waiting.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Sorry for not reviewing earlier, I'll be looking at this more closely now.

@TheBlueSky adding to @bgrainger, see some comments from me. Please try @benaadams's and @Wraith2's suggestion to make the build pass, if not we'll involve someone from the team to unblock this.

@TheBlueSky
Copy link
Contributor Author

The fix is to make the ref class partial and use a second file called System.Data.Common.netcoreapp.cs to hold the new parts

@Wraith2, What about uap target? In this case, building against uap will fail because any of the new methods does not exist in the reference but it does exist in the implementation.

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 24, 2019

There's a similar msbuild condition for UAP, if you look in the SqlClient project I know it'll be in there somewhere. It'll just be a case of adding the second condition to prevent the new methods being compiled in.

@TheBlueSky
Copy link
Contributor Author

@Wraith2, excuse my ignorance here. If we want to compile these for netcoreapp only, shouldn't we have something like DbDataReader.netcoreapp.cs file, similar to the ref file you suggested before?

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 24, 2019

yes, same structure for src and ref, ref just contains the null return/throwing versions as you've already done, src contains functioning implementations.

@roji
Copy link
Member

roji commented Feb 25, 2019

@TheBlueSky thanks for the quick fixes - to me this looks ready. The remaining test fix seems related to a Helix infrastructure issue (unrelated to your PR).

@terrajobst @divega what's the next step for this?

@TheBlueSky
Copy link
Contributor Author

@roji, thanks for reviewing this PR; I learnt couple of things along the way.

The next step should be someone to tell me why the macOS build times out, and whether this is a big deal or not :)

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 25, 2019

The mac build failed on my PR yesterday as well, i'm assuming it's a build server problem and someone in engineering will poke it when they get into the office on US time. Given that you're not doing anything platform specific and the linux builds are working i'd probably ignore it.

@roji
Copy link
Member

roji commented Feb 25, 2019

As @Wraith2 wrote, I wouldn't worry about the MacOS build. There's some flakiness in the build infrastructure sometimes.

@divega
Copy link

divega commented Feb 25, 2019

@dotnet-bot test OSX x64 Debug Build please

@safern
Copy link
Member

safern commented Feb 25, 2019

@dotnet-bot test OSX x64 Debug Build please

This comment no longer works. I was going to retry the failing leg manually, but accidentally clicked the wrong button and ran all the legs, sorry about that 😢

@divega
Copy link

divega commented Feb 25, 2019

This comment no longer works.

Well, it worked for me, though not directly :trollface:

@Wraith2
Copy link
Contributor

Wraith2 commented Feb 26, 2019

Linux failed this time. How do you work out what went wrong? all I see is the send to helix step failed but that doesn't mean anything or provide any point to debug from.

@safern
Copy link
Member

safern commented Feb 26, 2019

In the logs you can see the link to test results and a summary of what failed. It seems like infrastructure stuff, trying to download the .zip folder with the test binaries:

  Results will be available from https://mc.dot.net/#/user/dotnet-bot/pr~2Fdotnet~2Fcorefx~2Frefs~2Fpull~2F35211~2Fmerge/test~2Ffunctional~2Fcli~2F/20190225.17
  Sent Helix Job ef41298b-9ac6-4436-83ba-28a034722d3c
  Waiting for completion of job ef41298b-9ac6-4436-83ba-28a034722d3c
  Job ef41298b-9ac6-4436-83ba-28a034722d3c is completed with 209 finished work items.
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.IO.Compression.Brotli.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.IO.Compression.ZipFile.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.IO.Compression.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item XsltCompiler.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.Xml.Xsl.XslTransformApi.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.Net.Ping.Functional.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code 1 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.Runtime.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code 1 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Job 'ef41298b-9ac6-4436-83ba-28a034722d3c' has 5 failed work items. [/__w/1/s/eng/sendtohelix.proj]

Build FAILED.

/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.IO.Compression.Brotli.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.IO.Compression.ZipFile.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.IO.Compression.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item XsltCompiler.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.Xml.Xsl.XslTransformApi.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code -3 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.Net.Ping.Functional.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code 1 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Work item System.Runtime.Tests in job ef41298b-9ac6-4436-83ba-28a034722d3c has Failed with exit code 1 [/__w/1/s/eng/sendtohelix.proj]
/home/vsts_azpcontainer/.nuget/packages/microsoft.dotnet.helix.sdk/2.0.0-beta.19121.4/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(67,5): error : Job 'ef41298b-9ac6-4436-83ba-28a034722d3c' has 5 failed work items. [/__w/1/s/eng/sendtohelix.proj]

@ajcvickers
Copy link

ajcvickers commented Feb 26, 2019

Merging based on sign-off from @divega @roji.

@ajcvickers ajcvickers merged commit b30fc2b into dotnet:master Feb 26, 2019
@TheBlueSky TheBlueSky deleted the dbdatareader-string-overloads branch February 26, 2019 21:00
@divega
Copy link

divega commented Feb 26, 2019

Thank you @TheBlueSky for the contribution and @Wraith2, @safern for all the help getting it in.

@roji is this the first of all the ADO.NET improvements you filed to get fixed? 😄

@TheBlueSky
Copy link
Contributor Author

Yay! :)

Thanks for everyone who helped in this, especially @Wraith2.

@roji
Copy link
Member

roji commented Feb 27, 2019

@roji is this the first of all the ADO.NET improvements you filed to get fixed? 😄

Yeah, I think it is, after all these years :) A sign of more PRs to come :)

@karelz karelz added this to the 3.0 milestone Mar 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants