[Infra] Remove redundant System.Text.Json / update to 8.0.5 where needed#4154
Conversation
Remove references to System.Text.Json from target frameworks where it is already included in-box for the shared framework.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4154 +/- ##
==========================================
- Coverage 74.99% 74.95% -0.04%
==========================================
Files 467 467
Lines 18441 18429 -12
==========================================
- Hits 13830 13814 -16
- Misses 4611 4615 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR removes redundant System.Text.Json package references for TFMs where System.Text.Json is already provided by the shared framework (.NET 8+), while keeping conditional references for older TFMs that still need the NuGet package.
Changes:
- Removed unconditional
System.Text.JsonPackageReferenceentries from several projects. - Added/converted conditional
PackageReference Include="System.Text.Json"entries for TFMs< net8.0(usingIsTargetFrameworkCompatibleor.NETStandardconditions). - Adjusted
Update-style overrides toIncludewhere the unconditional reference was removed.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/OpenTelemetry.Sampler.AWS/OpenTelemetry.Sampler.AWS.csproj | Drops unconditional System.Text.Json; keeps it only for TFMs < net8.0 with VersionOverride. |
| src/OpenTelemetry.Resources.Gcp/OpenTelemetry.Resources.Gcp.csproj | Drops unconditional System.Text.Json; keeps it only for .NETStandard TFMs with VersionOverride. |
| src/OpenTelemetry.Resources.Azure/OpenTelemetry.Resources.Azure.csproj | Drops unconditional System.Text.Json; keeps it only for .NETStandard TFMs with VersionOverride. |
| src/OpenTelemetry.Resources.AWS/OpenTelemetry.Resources.AWS.csproj | Replaces identifier-based condition with < net8.0 compatibility check; keeps System.Text.Json only when needed. |
| src/OpenTelemetry.Instrumentation.ElasticsearchClient/OpenTelemetry.Instrumentation.ElasticsearchClient.csproj | Moves System.Text.Json reference into a conditional ItemGroup for TFMs < net8.0. |
| src/OpenTelemetry.Instrumentation.AWSLambda/OpenTelemetry.Instrumentation.AWSLambda.csproj | Drops unconditional System.Text.Json; keeps it only for TFMs < net8.0 with VersionOverride. |
| src/OpenTelemetry.Exporter.InfluxDB/OpenTelemetry.Exporter.InfluxDB.csproj | Makes System.Text.Json reference conditional for TFMs < net8.0 (removing it for net8+). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
Remove references to System.Text.Json from target frameworks where it is already included in-box for the shared framework (.NET 8+).
Merge requirement checklist
Unit tests added/updatedAppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)