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 | BufferWriterExtensions#3264

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
benrr101 merged 3 commits intomainfromdev/russellben/bufferwriterextensions
Apr 15, 2025

Conversation

benrr101
Copy link
Contributor

@benrr101benrr101 commentedApr 8, 2025
edited
Loading

Description:This one is super easy, move the BufferWriterExtension class to the common project. Specifically, to a new Utilities namespace, with the .netfx suffix. While we're at it, also move the ArrayBufferWriter class to a Utilities namespace and rename it to use the .netfx suffix.

Update: There is now scope creep in this PR... BufferWriterExtension class has now been moved to a new Utilities namespace in the common project. The original change moved ArrayBufferWriter to the utilities namespace, but this was not ideal. Since ArrayBufferWriter is meant to be like a polyfill for netfx (ArrayBufferWriter was not added to dotnet until netstandard2.0), it should (unfortunatly) be in the System.Buffers namespace (otherwise we will need a #if for each time it is used, to change namespace). As such, this file was moved to the System/Buffers folder in the common project. The netfx project was updated as such.

I considered merging the BufferWriterExtension into ArrayBufferWriter but 1) ArrayBufferWriter is an exact copy of the dotnet runtime implementation (since it is not part of net framework), 2) there are no tests for it, 3) we can't add tests because the type isinternal, and 4) ArrayBufferWriter is technically generic, while BufferWriterExtensions is not generic. It just makes it kind of a low roi change, so I'll just live it as-is.

Scope Creep: During CI, a reference to ArrayBufferWriter was failing in the SqlObjectPools class. Since this is definitely a utility, I moved it and the SqlObjectPool classes to the utilities namespace. I then renamed them to drop the "Sql" from the class names. I also think that the thread-safe implementation of SqlObjectPools is a bit overcomplicated, so I replaced it with a much simplerLazy object (which is thread-safe already).

Testing: Moving the files should not have issues, rewriting SqlObjectPool to use Lazy shouldn't have impact (since it's still thread-safe).

@benrr101benrr101 added the Common Project 🚮Things that relate to the common project project labelApr 8, 2025
@benrr101benrr101 requested review froma team andCopilotApril 8, 2025 22:57
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj: Language not supported

@benrr101benrr101 requested a review fromCopilotApril 9, 2025 17:00
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj: Language not supported
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Utilities/ArrayBufferWriter.netfx.cs:12

  • The PR description indicates that ArrayBufferWriter should reside within the System.Buffers namespace; please verify if updating the namespace from 'Microsoft.Data.SqlClient' to 'Microsoft.Data.SqlClient.Utilities' is intentional or if it should be aligned with the description.
namespace Microsoft.Data.SqlClient.Utilities

@benrr101
Copy link
ContributorAuthor

/azp run

@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.

Just one comment about class name.

namespace Microsoft.Data.SqlClient.Utilities
{
/// <summary>
/// This is a collection of general object pools that can be reused as needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem general. It's a pool of ArrayBufferWriters. Should the class name be ArrayBufferWriterPools ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I think the theory is that the class will have more object pools added to it as we go. I'm not sure what other pools might be added, but I think that's the idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see. This class is basically a namespace to hold static instances of a variety of ObjectPool specializations.

More of a "collection of specific ObjectPool instances that can be reused..."

benrr101 reacted with thumbs up emoji
@paulmedynskipaulmedynski self-assigned thisApr 10, 2025
@codecovCodecov
Copy link

codecovbot commentedApr 10, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is87.50000% with2 lines in your changes missing coverage. Please review.

Project coverage is 72.80%. Comparing base(2bb0dc7) to head(76d1d79).
Report is 6 commits behind head on main.

Files with missing linesPatch %Lines
...Client/src/Interop/Windows/Sni/SniNativeWrapper.cs50.00%2 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3264      +/-   ##==========================================- Coverage   72.81%   72.80%   -0.02%==========================================  Files         297      296       -1       Lines       59661    59616      -45     ==========================================- Hits        43444    43405      -39+ Misses      16217    16211       -6
FlagCoverage Δ
addons92.58% <ø> (ø)
netcore75.10% <87.50%> (-0.14%)⬇️
netfx71.57% <86.66%> (+0.11%)⬆️

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.

@benrr101benrr101 merged commit7f30536 intomainApr 15, 2025
251 checks passed
@benrr101benrr101 deleted the dev/russellben/bufferwriterextensions branchApril 15, 2025 15:50
@cheenamalhotracheenamalhotra added this to the6.1-preview1 milestoneApr 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@mdaiglemdaiglemdaigle approved these changes

@paulmedynskipaulmedynskipaulmedynski approved these changes

@samsharma2700samsharma2700samsharma2700 approved these changes

Assignees

@paulmedynskipaulmedynski

Labels
Common Project 🚮Things that relate to the common project project
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

5 participants
@benrr101@mdaigle@paulmedynski@samsharma2700@cheenamalhotra

[8]ページ先頭

©2009-2025 Movatter.jp