Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Merge | SqlConnection cosmetic changes#3275

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

edwardneal
Copy link
Contributor

@edwardnealedwardneal commentedApr 13, 2025
edited
Loading

Contributes to#1261.

This is easier to review commit-by-commit - it performs formatting changes, reorders members, synchronises comments and other cosmetic changes. The end result is that SqlConnection is reduced to a -315/+305 diff.

The remaining diff is 1/3 context connection handling, 1/3 logging changes, 1/6 unported performance improvements and 1/6 being the "real" set of behavioural changes.)

Could someone run CI against this please?

@paulmedynski
Copy link
Contributor

/azp run

@paulmedynskipaulmedynski self-assigned thisApr 14, 2025
@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@paulmedynskipaulmedynski left a comment

Choose a reason for hiding this comment

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

Cleanup is always welcome! A couple of minor tweaks.

@codecovCodecov
Copy link

codecovbot commentedApr 14, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is82.75862% with25 lines in your changes missing coverage. Please review.

Project coverage is 66.16%. Comparing base(c5e3c40) to head(62aab14).
Report is 6 commits behind head on main.

Files with missing linesPatch %Lines
...etfx/src/Microsoft/Data/SqlClient/SqlConnection.cs83.70%22 Missing⚠️
...etcore/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs0.00%1 Missing⚠️
...core/src/Microsoft/Data/SqlClient/SqlConnection.cs87.50%1 Missing⚠️
.../netfx/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs0.00%1 Missing⚠️

❗ There is a different number of reports uploaded between BASE (c5e3c40) and HEAD (62aab14). Click for more details.

HEAD has 1 upload less than BASE
FlagBASE (c5e3c40)HEAD (62aab14)
addons10
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3275      +/-   ##==========================================- Coverage   72.98%   66.16%   -6.83%==========================================  Files         299      292       -7       Lines       57215    56691     -524     ==========================================- Hits        41760    37509    -4251- Misses      15455    19182    +3727
FlagCoverage Δ
addons?
netcore68.99% <77.77%> (-6.20%)⬇️
netfx65.21% <83.08%> (-6.28%)⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@cheenamalhotracheenamalhotra added this to the6.1-preview1 milestoneApr 16, 2025
Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

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

I think you goal here is to get one side in line with the other. In that case I can be a lot more forgiving to stuff like order of properties. No need to address the comments, just raising them as things to think on.
Otherwise, glad to get closer to merging the big beasts.

= new(concurrencyLevel: 4 * Environment.ProcessorCount /* default value in ConcurrentDictionary*/,
capacity: 1,
comparer: StringComparer.OrdinalIgnoreCase);

internal bool ForceNewConnection
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 assuming the goal here is just to get it into the same place as it is in netcore? Otherwise I'd be a stickler and say properties belong after constructors

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Exactly - the goal's to make a Visual Studio diff useful. I've tested reordering properties, but it'd rapidly increase the size of the diff: even moving a dozen properties resulted in a 300-line change.

I agree it'd be a good idea to deal with code style fixups though. We could do this after the codebases are merged, or file-by-file through the merged codebase. The WPF repo is going through this at the moment, and the approach they've taken isdotnet/wpf#10270.

/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/CommandTimeout/*' />
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[ResDescription(StringsHelper.ResourceNames.SqlConnection_ConnectionTimeout)]
public int CommandTimeout
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 get this ordering scheme at all.... If we're just trying to get one side in line with the other side, then I won't complain. But if we're not, we've got privates before publics, properties before constructors, properties after constructors...

@@ -178,43 +173,35 @@ public SqlConnection(string connectionString, SqlCredential credential) : this()
{
throw ADP.InvalidMixedArgumentOfSecureCredentialAndIntegratedSecurity();
}

if (UsesContextConnection(connectionOptions))
else if (UsesContextConnection(connectionOptions))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this one is one I've butted heads with people in the past. Technically, the else is redundant here since if the condition is triggered, we exit the method. In my IDE, I get notices about them, soI usually try to avoid them. But I admit, it is tidier to have the else-if chain. Though it would be even better if this could be written as a switch block :/

@benrr101benrr101force-pushed themerge/sqlconnection-preparation branch from6ca56d0 tobdde88eCompareApril 16, 2025 22:59
@benrr101
Copy link
Contributor

@edwardneal ok that was more dangerous, but yeahhhh I just rebased your branch off of main and fixed the merge conflicts (please don't be mad)

edwardneal reacted with rocket emoji

@benrr101
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@benrr101benrr101 added the Code Health 💊Issues/PRs that are targeted to source code quality improvements. labelApr 16, 2025
@edwardneal
Copy link
ContributorAuthor

Thanks rebasing this@benrr101. I noticed that CI was failing on the netfx project, so I've adjusted it slightly.

@cheenamalhotra
Copy link
Member

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mdaiglemdaigle merged commit0eec7e2 intodotnet:mainApr 22, 2025
122 checks passed
@edwardnealedwardneal deleted the merge/sqlconnection-preparation branchApril 22, 2025 17:54
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@benrr101benrr101benrr101 approved these changes

@cheenamalhotracheenamalhotracheenamalhotra approved these changes

@paulmedynskipaulmedynskipaulmedynski approved these changes

@samsharma2700samsharma2700samsharma2700 approved these changes

Assignees

@paulmedynskipaulmedynski

Labels
Code Health 💊Issues/PRs that are targeted to source code quality improvements.
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

6 participants
@edwardneal@paulmedynski@benrr101@cheenamalhotra@samsharma2700@mdaigle

[8]ページ先頭

©2009-2025 Movatter.jp