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

Fix bunch of annontations #1959

Merged
merged 5 commits into from Jul 12, 2023
Merged

Conversation

kant2002
Copy link
Contributor

Actually remove some trimming issues completely.

@kant2002
Copy link
Contributor Author

I prefer this PR to land before #1958 because this PR has really remove some warnings, and that prevents trimming issues to slip ito.

/cc @Wraith2

@@ -1232,6 +1237,11 @@ override public IEnumerator GetEnumerator()
}

/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/GetFieldType/*' />
#if NET6_0_OR_GREATER
[SuppressMessage("ReflectionAnalysis", "IL2093:MismatchOnMethodReturnValueBetweenOverrides",
Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of annotations? and were they shipped in 7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think issue was that ref assembly was missing this annotations.
https://github.com/dotnet/runtime/blame/main/src/libraries/System.Data.Common/ref/System.Data.Common.cs#L2323-L2324

and yes, it was fixed in .NET 7 (or even .NET 8)

@@ -942,6 +964,9 @@ ParameterDirection direction
byte scale,
long localeId,
SqlCompareOptions compareOptions,
#if NET6_0_OR_GREATER
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like that this isn't clear that it applies to the parameter following the #endif but i can't see another way to format the code to make it clear :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's unfortunate.

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 81.81% and project coverage change: +0.74 🎉

Comparison is base (bcba97c) 69.89% compared to head (dfbf46a) 70.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1959      +/-   ##
==========================================
+ Coverage   69.89%   70.64%   +0.74%     
==========================================
  Files         305      305              
  Lines       61944    61977      +33     
==========================================
+ Hits        43297    43783     +486     
+ Misses      18647    18194     -453     
Flag Coverage Δ
addons 92.88% <ø> (ø)
netcore 73.36% <81.81%> (-0.01%) ⬇️
netfx 69.31% <81.81%> (+1.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...core/src/Microsoft/Data/SqlClient/SqlDataReader.cs 70.49% <ø> (ø)
...Microsoft/Data/SqlClient/TdsParserHelperClasses.cs 50.22% <ø> (ø)
...ent/Reliability/SqlConfigurableRetryLogicLoader.cs 85.61% <ø> (ø)
...c/Microsoft/Data/SqlClient/Server/SqlDataRecord.cs 71.72% <ø> (ø)
...oft/Data/SqlClient/Server/SqlDataRecord.netcore.cs 80.55% <ø> (ø)
...c/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs 0.00% <0.00%> (ø)
...ient/src/Microsoft/Data/SqlClient/Server/SqlSer.cs 48.57% <77.77%> (+3.11%) ⬆️
...src/Microsoft/Data/SqlClient/Server/SmiMetaData.cs 76.86% <100.00%> (+0.10%) ⬆️
...src/Microsoft/Data/SqlClient/Server/SqlMetaData.cs 97.56% <100.00%> (+0.03%) ⬆️
...SqlClient/src/Microsoft/Data/SqlClient/SqlEnums.cs 78.14% <100.00%> (+0.36%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kant2002
Copy link
Contributor Author

@lcheunglci May you take a look?

@kant2002
Copy link
Contributor Author

@lcheunglci I still have hopes I catch your attention, and move whole thing a bit forward 😄

@lcheunglci
Copy link
Contributor

@lcheunglci I still have hopes I catch your attention, and move whole thing a bit forward 😄

Sorry I haven't been as active lately. Perhaps, @JRahnama @DavoudEshtehari or @Kaur-Parminder when they have a moment could also take a look.

@kant2002
Copy link
Contributor Author

Okay. Sorry to bother, probably misinterpret your like

@David-Engel
Copy link
Contributor

/azp run CI-SqlClient

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kant2002
Copy link
Contributor Author

It looks like failure are from unreliable tests? I have hard time understand how annotations can be the cause.

@JRahnama
Copy link
Member

It looks like failure are from unreliable tests? I have hard time understand how annotations can be the cause.

The failure is not related to your changes. I am going to rerun them one more time to see the outcome.

@JRahnama
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavoudEshtehari DavoudEshtehari added this to the 5.2.0-preview3 milestone Jul 7, 2023
Copy link
Member

@DavoudEshtehari DavoudEshtehari left a comment

Choose a reason for hiding this comment

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

For the record, can you add more context about the way this change can affect and the justifications here?

@kant2002
Copy link
Contributor Author

kant2002 commented Jul 8, 2023

When not ignoring trimming anotations does not affect runtime behavoir of the code, but affect dev workflow.
If somebody working on SqlClient code and would like to add code which will use reflection he has to annotate that code for trimming and make sure that trimming analyzer would not complain.

For developer who consume SqlClient it will mean that it can use this library with trimming and know that if analyzer do not produce warnings, then they are safe. Right now if you use trimming/NativeAOT you should pray that SqlClient is trimming friendly (I would say it is, but now we will have proof for that)

@DavoudEshtehari DavoudEshtehari merged commit ed0c3a3 into dotnet:main Jul 12, 2023
132 checks passed
@kant2002 kant2002 deleted the kant/fix-annotations branch July 12, 2023 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Enhancement New feature request netcore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants