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

remove unnecessary System.Text.Json dependency on modern .NET#2930

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
mdaigle merged 3 commits intodotnet:mainfrommus65:rm_systemtextjson
Oct 31, 2024

Conversation

mus65
Copy link
Contributor

Partial revert of#2921 . System.Text.Json is part of the framework on modern .NET, so this dependency is unnecessary and wil just cause false positives in NuGet audit.

campersau and mungojam reacted with thumbs up emoji
@mus65
Copy link
ContributorAuthor

@dotnet-policy-service agree

@David-Engel
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Member

@cheenamalhotracheenamalhotra left a comment
edited
Loading

Choose a reason for hiding this comment

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

I don't agree with the changes, as this is added purposely. What false positives are you concerned about?

@mus65
Copy link
ContributorAuthor

I don't agree with the changes, as this is added purposely. What false positives are you concerned about?

This dependency is simply not necessary since the .NET runtime itself already contains System.Text.Json . This causes false positives in NuGet Audit because if a library like Microsoft.Data.SqlClient e.g. depends on the vulnerable System.Text.Json 8.0.4, but I'm actually using the latest .NET runtime which contains the fixed 8.0.5, the SDK will use the latest version. Meaning I'm not actually affected by the vulnerability, but NuGet Audit will still claim that I am.

NuGet is actually working on fixing this, so it considers the runtime dependencies (seeSupplied by Platform ). But even when they fix this, not having this unnecessary dependency in the first place is imho the better option.

mungojam reacted with thumbs up emoji

@codecovCodecov
Copy link

codecovbot commentedOct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.94%. Comparing base(39c4604) to head(1569786).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #2930      +/-   ##==========================================+ Coverage   71.92%   75.94%   +4.02%==========================================  Files         294      246      -48       Lines       60342    40260   -20082     ==========================================- Hits        43398    30577   -12821+ Misses      16944     9683    -7261
FlagCoverage Δ
addons92.90% <ø> (ø)
netcore75.81% <ø> (-0.02%)⬇️
netfx?

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.

@cheenamalhotra
Copy link
Member

Based on commentNuGet/Home#7344 (comment), I believe Supplied by Platform is not yet available in .NET 8 or 9. Can you confirm my understanding?

@ErikEJ
Copy link
Contributor

@cheenamalhotra that is correct, but only affects potential nuget audit warnings. Adding this as an explicit reference with .NET 8 is wrong.

@cheenamalhotracheenamalhotra added this to the6.0-preview3 milestoneOct 29, 2024
@mungojam
Copy link

I hope this can be backported unless v6 is coming very soon and in ef SQL by default. Every time a system.text.json vuln comes up we're having to update it explicitly just because of SQL client lib, other Ms libs don't show the same explicit dependency

@ErikEJ
Copy link
Contributor

@mungojam Why backported? This was introduced in 6.x

@mungojam
Copy link

Partial revert of#2921 . System.Text.Json is part of the framework on modern .NET, so this dependency is unnecessary and wil just cause false positives in NuGet audit.

It will still be needed for .net framework consumers so you might need a conditional package reference instead

@mus65
Copy link
ContributorAuthor

@mungojam

It will still be needed for .net framework consumers so you might need a conditional package reference instead

The .NET Framework reference is still there, it was already conditional because .NET Framework/.NET have different csproj files.

mungojam reacted with thumbs up emoji

@mdaiglemdaigle merged commit08a2433 intodotnet:mainOct 31, 2024
1 check passed
@mdaiglemdaigle added the Code Health 💊Issues/PRs that are targeted to source code quality improvements. labelNov 1, 2024
@mungojam
Copy link

mungojam commentedNov 1, 2024
edited
Loading

@mungojam Why backported? This was introduced in 6.x

@ErikEJ my mistake, it comes in with sub-dependencies in v5. Hopefully these don't bring it in in v6:

image

Thanks todotnet nuget why ./ System.Text.Json, what a great addition :)

ErikEJ and 0liver reacted with hooray emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@benrr101benrr101benrr101 left review comments

@apoorvdeshmukhapoorvdeshmukhapoorvdeshmukh left review comments

@saurabh500saurabh500saurabh500 approved these changes

@mdaiglemdaiglemdaigle approved these changes

@cheenamalhotracheenamalhotracheenamalhotra approved these changes

@David-EngelDavid-EngelDavid-Engel approved these changes

Assignees
No one assigned
Labels
Code Health 💊Issues/PRs that are targeted to source code quality improvements.
Projects
None yet
Milestone
6.0-preview3
Development

Successfully merging this pull request may close these issues.

9 participants
@mus65@David-Engel@cheenamalhotra@ErikEJ@mungojam@benrr101@saurabh500@mdaigle@apoorvdeshmukh

[8]ページ先頭

©2009-2025 Movatter.jp