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

V9.0.0/prepare for launch #6

Merged
merged 3 commits into from
Nov 11, 2024
Merged

V9.0.0/prepare for launch #6

merged 3 commits into from
Nov 11, 2024

Conversation

gimlichael
Copy link
Member

@gimlichael gimlichael commented Nov 11, 2024

This pull request includes several changes to the Codebelt.Extensions.Newtonsoft.Json project, focusing on updating dependencies, renaming classes, and improving package management. The most important changes are summarized below.

Breaking Changes and Renaming:

  • Renamed the DynamicJsonConverter class to JsonConverterFactory in the Codebelt.Extensions.Newtonsoft.Json namespace. [1] [2]

Dependency Updates:

  • Updated dependencies to the latest versions and removed version specifications from Directory.Build.props, Directory.Packages.props, and various .csproj files. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Removal of Deprecated Code:

  • Removed the JsonReaderExtensions class from the Codebelt.Extensions.Newtonsoft.Json project.

Documentation and Changelog:

  • Updated the CHANGELOG.md to reflect the release date for version 9.0.0 and added notes on breaking changes and new features. [1] [2]
  • Minor update to README.md to improve readability.

Test Updates:

  • Updated test cases in JsonConverterCollectionExtensionsTest.cs to use DayOfWeek instead of HorizontalDirection. [1] [2] [3] [4]

Summary by CodeRabbit

Release Notes for Version 9.0.0

  • New Features

    • Introduced FailureConverter to convert failure-related data to JSON.
    • Extended JsonConverterCollectionExtensions with AddFailureConverter and AddProblemDetailsConverter methods.
  • Breaking Changes

    • Renamed DynamicJsonConverter to JsonConverterFactory.
    • Removed support for .NET 6 TFM.
    • Deleted JsonReaderExtensions file, removing the ToHierarchy method.
  • Chores

    • Updated project files to use the latest package versions without specific versioning.
    • Added a section in the README to encourage contributions.

@gimlichael gimlichael self-assigned this Nov 11, 2024
Copy link

coderabbitai bot commented Nov 11, 2024

Walkthrough

The pull request introduces significant updates to the Codebelt.Extensions.Newtonsoft.Json package. Key changes include the renaming of the DynamicJsonConverter class to JsonConverterFactory, the removal of support for the .NET 6 target framework, and the addition of a FailureConverter class. The JsonConverterCollectionExtensions class has been enhanced with a new method, AddFailureConverter. Additionally, various project files have been modified to remove specific version references for package dependencies, streamlining version management. The README has been updated to encourage contributions.

Changes

File Change Summary
.nuget/Codebelt.Extensions.Newtonsoft.Json/PackageReleaseNotes.txt Renamed DynamicJsonConverter to JsonConverterFactory, added FailureConverter, extended JsonConverterCollectionExtensions with AddFailureConverter, modified ValidatorExtensions for Sonar compliance.
CHANGELOG.md Updated for version 9.0.0; added FailureConverter, extended JsonConverterCollectionExtensions, renamed DynamicJsonConverter, removed HttpExceptionDescriptorResponseHandlerExtensions, modified ValidatorExtensions.
Directory.Build.props Removed version attributes for several package references in test and non-test projects, updated conditions for target frameworks.
Directory.Packages.props Created to centralize package version management, enabling easier updates across frameworks.
README.md Added a section inviting contributions to the project.
src/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.csproj Removed specific version references for Microsoft.AspNetCore.Mvc.NewtonsoftJson, Cuemon.AspNetCore.Mvc, and Cuemon.Extensions.IO.
src/Codebelt.Extensions.AspNetCore.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.csproj Removed specific version for Cuemon.Extensions.AspNetCore.
src/Codebelt.Extensions.Newtonsoft.Json/Codebelt.Extensions.Newtonsoft.Json.csproj Removed specific versions for Cuemon.Core, Cuemon.IO, and Newtonsoft.Json.
src/Codebelt.Extensions.Newtonsoft.Json/JsonReaderExtensions.cs Deleted file containing ToHierarchy method for JsonReader.
test/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.Tests/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.Tests.csproj Removed specific version for Cuemon.Extensions.AspNetCore.Mvc.
test/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Tests/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Tests.csproj Removed specific version for Cuemon.Extensions.AspNetCore.Authentication.
test/Codebelt.Extensions.Newtonsoft.Json.Tests/Codebelt.Extensions.Newtonsoft.Json.Tests.csproj Removed specific versions for System.Net.Http, Codebelt.Extensions.Xunit, Cuemon.Extensions.Core, and Cuemon.Extensions.IO.
test/Codebelt.Extensions.Newtonsoft.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs Updated test cases to use DayOfWeek enum instead of HorizontalDirection enum.

Possibly related PRs

  • V9.0.0/net9rc1 support #2: Introduces the FailureConverter class and the AddFailureConverter method, directly related to this PR's functionality.
  • V9.0.0/depedency bump #3: Includes updates to Directory.Build.props and project files that are linked to the changes in this PR regarding the FailureConverter.
  • V9.0.0/net9rc2 #4: Discusses the renaming of DynamicJsonConverter to JsonConverterFactory, directly relating to changes made in this PR.

🐰 "In the code where bunnies hop,
New converters make the JSON pop!
With changes made and versions clear,
Our package grows, let's give a cheer!
From factories to failure's grace,
Codebelt's magic finds its place!" 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.01%. Comparing base (03d6356) to head (4774eb8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
+ Coverage   75.82%   78.01%   +2.18%     
==========================================
  Files          25       24       -1     
  Lines         943      905      -38     
  Branches      120      111       -9     
==========================================
- Hits          715      706       -9     
+ Misses        226      197      -29     
  Partials        2        2              

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

Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (6)
src/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.csproj (1)

14-16: Consider documenting minimum required versions in comments

While centralized version management is good practice, it would be helpful to document the minimum required versions in comments for better maintainability and troubleshooting.

Add version comments like this:

 <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
-    <PackageReference Include="Cuemon.AspNetCore.Mvc" />
-    <PackageReference Include="Cuemon.Extensions.IO" />
+    <!-- Minimum required: 8.0.0 -->
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
+    <!-- Minimum required: latest compatible version -->
+    <PackageReference Include="Cuemon.AspNetCore.Mvc" />
+    <!-- Minimum required: latest compatible version -->
+    <PackageReference Include="Cuemon.Extensions.IO" />
 </ItemGroup>
CHANGELOG.md (4)

10-10: Update the release date

The release date is set in the future. Consider using the actual release date or removing the date until the release is published.


Line range hint 14-16: Enhance the Added section description

Consider providing more context about the FailureConverter class:

  • What specific failure data it handles
  • Why it was added
  • Benefits it brings to the project
🧰 Tools
🪛 LanguageTool

[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...er.

[!NOTE]
Changelog entries prior to version 8.4.0 was migrated from previou...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[uncategorized] ~8-~8: The verb “was” doesn’t seem to fit in this context, “were” is probably more formally correct.
Context: ...hangelog entries prior to version 8.4.0 was migrated from previous versions of Cuem...

(AI_HYDRA_LEO_CPT_WAS_WERE)


[uncategorized] ~12-~12: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... introduced with .NET 9 preview releases so the final release is production ready t...

(COMMA_COMPOUND_SENTENCE_2)


Line range hint 18-23: Standardize the Changed section formatting

Consider standardizing the format:

  1. Use consistent verb tense (either "was extended" or just "extended")
  2. Use consistent breaking change marking (either inline or parentheses)

Example format:

- JsonConverterCollectionExtensions class in the Cuemon.Extensions.AspNetCore.Newtonsoft.Json.Converters namespace was extended to include one new extension method: AddProblemDetailsConverter
+ JsonConverterCollectionExtensions class in the Cuemon.Extensions.AspNetCore.Newtonsoft.Json.Converters namespace extended to include one new extension method: AddProblemDetailsConverter
🧰 Tools
🪛 Markdownlint

22-22: null
Bare URL used

(MD034, no-bare-urls)


Line range hint 25-27: Add migration guidance for removed class

For breaking changes like removing HttpExceptionDescriptorResponseHandlerExtensions, consider adding:

  • Impact on existing code
  • Migration path or alternatives for users
  • Reason for removal
🧰 Tools
🪛 Markdownlint

22-22: null
Bare URL used

(MD034, no-bare-urls)

test/Codebelt.Extensions.Newtonsoft.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs (1)

92-92: LGTM! Consider adding test documentation.

The changes maintain test consistency with the previous updates while preserving the distinct purpose of testing camelCase conversion.

Consider adding XML documentation to clarify the difference between this test and the PascalCase variant:

+        /// <summary>
+        /// Verifies that AddStringEnumConverter correctly serializes enums to camelCase strings
+        /// when no naming strategy is specified.
+        /// </summary>
         [Fact]
         public void AddStringEnumConverter_ShouldAddStringEnumConverterToConverterCollection()

Also applies to: 113-114

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 03d6356 and 4774eb8.

📒 Files selected for processing (13)
  • .nuget/Codebelt.Extensions.Newtonsoft.Json/PackageReleaseNotes.txt (1 hunks)
  • CHANGELOG.md (2 hunks)
  • Directory.Build.props (2 hunks)
  • Directory.Packages.props (1 hunks)
  • README.md (1 hunks)
  • src/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.csproj (1 hunks)
  • src/Codebelt.Extensions.AspNetCore.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.csproj (1 hunks)
  • src/Codebelt.Extensions.Newtonsoft.Json/Codebelt.Extensions.Newtonsoft.Json.csproj (1 hunks)
  • src/Codebelt.Extensions.Newtonsoft.Json/JsonReaderExtensions.cs (0 hunks)
  • test/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.Tests/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.Tests.csproj (1 hunks)
  • test/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Tests/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Tests.csproj (1 hunks)
  • test/Codebelt.Extensions.Newtonsoft.Json.Tests/Codebelt.Extensions.Newtonsoft.Json.Tests.csproj (1 hunks)
  • test/Codebelt.Extensions.Newtonsoft.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs (4 hunks)
💤 Files with no reviewable changes (1)
  • src/Codebelt.Extensions.Newtonsoft.Json/JsonReaderExtensions.cs
✅ Files skipped from review due to trivial changes (2)
  • src/Codebelt.Extensions.Newtonsoft.Json/Codebelt.Extensions.Newtonsoft.Json.csproj
  • test/Codebelt.Extensions.Newtonsoft.Json.Tests/Codebelt.Extensions.Newtonsoft.Json.Tests.csproj
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~29-~29: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...BUTING.md) are welcome and encouraged. Feel free to submit issues, feature requests, or pul...

(FEEL_FREE_TO_STYLE_ME)

🔇 Additional comments (14)
test/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Tests/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Tests.csproj (1)

9-9: Consider adding version constraints for the authentication package

While removing specific versions aligns with the PR objectives, having no version constraints for a security-sensitive authentication package could introduce risks. Consider:

  1. Adding a version constraint that matches the main project
  2. Ensuring compatibility when moving from preview version 9.0.0-preview.11 to the release version

Let's verify the version compatibility:

test/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.Tests/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.Tests.csproj (2)

9-9: Verify package version management strategy

Removing version constraints in test projects could lead to inconsistent test results across different environments. Consider if we should:

  1. Keep a specific version for test stability
  2. Use version ranges to allow patches but prevent major updates
  3. Implement version control through central package management
✅ Verification successful

Package versioning is properly managed centrally

The removal of explicit version constraints in the test project is actually following best practices, as versions are managed centrally through Directory.Packages.props which specifies version 9.0.0-rc.1 for Cuemon.Extensions.AspNetCore.Mvc. This ensures consistent versioning across all projects while maintaining a single source of truth for package versions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Directory.Packages.props exists and contains version for this package
fd -t f "Directory.Packages.props" -x grep -l "Cuemon.Extensions.AspNetCore.Mvc"

# Check other test projects for consistent version management
fd -t f "*.Tests.csproj" -x grep -A 1 -B 1 "Cuemon.Extensions.AspNetCore.Mvc"

Length of output: 477


Script:

#!/bin/bash
# Check Directory.Packages.props content
cat Directory.Packages.props

# Check test projects for package references using proper glob pattern
fd --glob "*.Tests.csproj" --exec grep -A 1 -B 1 "Cuemon.Extensions.AspNetCore.Mvc" {}

Length of output: 2224


Line range hint 4-4: Verify .NET 9.0 test stability

Since .NET 9.0 is still in preview, ensure that:

  1. CI pipeline is configured to handle preview SDKs
  2. Test results are stable across both .NET 8.0 and 9.0
✅ Verification successful

✅ .NET 9.0 test configuration appears stable and well-supported

The verification shows that:

  1. CI pipeline is properly configured with includePreview: true for .NET SDK installation
  2. Tests are consistently targeting .NET 9.0 across all test projects
  3. Build matrix includes .NET 9.0 framework testing on both Windows and Linux
  4. Common build properties in Directory.Build.props properly handle multi-targeting including .NET 9.0
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if other test projects also target .NET 9.0
fd -t f "*.Tests.csproj" -x grep -l "net9.0"

# Check if CI workflow files exist and handle .NET 9.0
fd -t f "*.yml" -t f "*.yaml" -p ".github/workflows" -x grep -l "net9.0"

Length of output: 747


Script:

#!/bin/bash
# Check if other test projects also target .NET 9.0
fd --glob "*.Tests.csproj" --type f --exec grep -l "net9.0" {} \;

# Check CI workflow files for .NET 9.0 handling
fd --glob "*.{yml,yaml}" --type f --base-directory .github/workflows --exec grep -l "net9.0" {} \;

# Also check global.json for SDK version constraints
if [ -f "global.json" ]; then
    cat global.json
fi

# Check Directory.Build.props for common build properties
if [ -f "Directory.Build.props" ]; then
    cat Directory.Build.props
fi

Length of output: 4761


Script:

#!/bin/bash
# Check the CI pipeline configuration for .NET 9.0 SDK setup
cat .github/workflows/pipelines.yml

# Check if there are any failing tests or issues reported in recent commits
fd --glob "*.Tests.csproj" --type f --exec dirname {} \; | while read -r dir; do
    if [ -f "$dir/TestResults" ]; then
        ls -la "$dir/TestResults"
    fi
done

# Look for any SDK version constraints or configurations
find . -type f -name "*.props" -o -name "*.targets" -o -name "global.json" | xargs grep -l "net9\|SDK"

Length of output: 6871

src/Codebelt.Extensions.AspNetCore.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Newtonsoft.Json.csproj (2)

Line range hint 3-5: Verify .NET 9.0 preview compatibility.

The project targets .NET 9.0 which is currently in preview. Ensure all dependencies are compatible with .NET 9.0 preview and consider documenting any preview-related considerations.

Run the following script to check .NET 9.0 compatibility across dependencies:

#!/bin/bash
# Description: Check .NET 9.0 compatibility in package references
# Look for target framework specifications and package references

# Check target frameworks across solution
echo "Checking target frameworks across solution:"
fd -e csproj -x grep -A 1 "TargetFrameworks\|TargetFramework"

# Check package references that might have framework constraints
echo -e "\nChecking package references with framework constraints:"
fd -e csproj -x grep -A 1 "PackageReference.*Condition"

14-14: Consider adding version constraints for package stability.

While removing explicit version numbers aligns with the PR objectives, consider using version constraints (e.g., minimum version or version range) to prevent potential compatibility issues with future package updates.

Run the following script to check current package version constraints across the solution:

src/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json/Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.csproj (1)

14-16: Verify package versions are properly managed in Directory.Packages.props

The removal of explicit version specifications aligns with centralized package management practices. However, we should ensure these dependencies are properly configured.

Let's verify the version management setup:

✅ Verification successful

Package versions are properly managed in Directory.Packages.props

All the package versions are correctly defined in Directory.Packages.props:

  • Microsoft.AspNetCore.Mvc.NewtonsoftJson: 9.0.0-rc.2.24474.3 (for .NET 9.0) and 8.0.10 (for .NET 8.0)
  • Cuemon.AspNetCore.Mvc: 9.0.0-rc.1
  • Cuemon.Extensions.IO: 9.0.0-rc.1

The removal of version specifications from the .csproj file is appropriate as the versions are centrally managed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if package versions are defined in Directory.Packages.props
# and verify the presence of version constraints for critical packages

# Check Directory.Packages.props for package versions
echo "Checking Directory.Packages.props for package versions..."
rg -A 1 "Microsoft\.AspNetCore\.Mvc\.NewtonsoftJson|Cuemon\.AspNetCore\.Mvc|Cuemon\.Extensions\.IO" Directory.*.props

# List all props files to ensure we're not missing any version definitions
echo -e "\nListing all props files in the repository..."
fd -e props

Length of output: 1159

Directory.Packages.props (4)

2-4: LGTM! Good practice using centralized package management.

Setting ManagePackageVersionsCentrally to true helps maintain consistent package versions across the solution.


16-20: Verify security implications of core dependencies

Critical dependencies need security verification:

  • Microsoft.NET.Test.Sdk (17.11.1)
  • Newtonsoft.Json (13.0.3)
  • System.Net.Http (4.3.4)
#!/bin/bash
# Check for known vulnerabilities in critical packages
for package in "Newtonsoft.Json" "System.Net.Http"
do
  echo "Checking $package..."
  gh api graphql -f query='
  {
    securityVulnerabilities(first: 5, ecosystem: NUGET, package: "'$package'") {
      nodes {
        advisory {
          summary
          severity
          publishedAt
        }
        vulnerableVersionRange
        firstPatchedVersion {
          identifier
        }
      }
    }
  }'
done

27-32: Verify framework compatibility and version stability

The conditional targeting is good, but there are some concerns:

  1. .NET 9 is using RC version (9.0.0-rc.2.24474.3)
  2. Ensure .NET 8 version (8.0.10) is the latest stable release
#!/bin/bash
# Check latest versions for Microsoft.AspNetCore.Mvc.NewtonsoftJson
curl -s https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.newtonsoftjson/index.json | jq '.versions[]' | grep -E "8\.0\.|9\.0\."

6-15: ⚠️ Potential issue

Caution: Using release candidate versions in production

Multiple packages are using version 9.0.0-rc.1. Consider waiting for the stable release before deploying to production, as release candidates may contain breaking changes or undiscovered issues.

Run this script to check for any reported issues with these RC versions:

Directory.Build.props (3)

76-84: Coverage tool configuration looks good

The configuration for coverlet tools is well-structured:

  • Correct use of PrivateAssets="all" to prevent dependency flow
  • Appropriate IncludeAssets specification for build integration

72-75: Verify test framework compatibility

The removal of version attributes for test framework packages aligns with centralized version management. However, ensure version constraints in Directory.Packages.props maintain compatibility between:

  • Microsoft.NET.Test.Sdk
  • xunit
  • xunit runners

Let's verify the test framework setup:

#!/bin/bash
# Check version constraints in Directory.Packages.props
if [ -f "Directory.Packages.props" ]; then
    echo "Checking test framework version constraints..."
    rg -A 2 "Microsoft\.NET\.Test\.Sdk|xunit" "Directory.Packages.props"
fi

# Check for any remaining explicit versions in test projects
fd -e csproj -x rg "Microsoft\.NET\.Test\.Sdk|xunit"

45-46: Verify version constraints in Directory.Packages.props

The removal of version attributes for build-time tools is good for centralized version management. However, ensure that appropriate version constraints are defined in Directory.Packages.props to maintain consistent builds.

Let's verify the version management setup:

✅ Verification successful

Version constraints are properly defined in Directory.Packages.props

The version constraints for both packages are correctly defined in Directory.Packages.props:

  • Microsoft.SourceLink.GitHub: 8.0.0
  • MinVer: 6.0.0

The removal of version attributes from Directory.Build.props is consistent with the centralized version management approach, and no other references with conflicting versions were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Directory.Packages.props exists and contains version constraints
if [ -f "Directory.Packages.props" ]; then
    echo "Checking version constraints in Directory.Packages.props..."
    rg -A 2 "Microsoft\.SourceLink\.GitHub|MinVer" "Directory.Packages.props"
else
    echo "Warning: Directory.Packages.props not found"
fi

# Check if these packages are referenced elsewhere with versions
rg -g "*.props" -g "*.csproj" "Microsoft\.SourceLink\.GitHub|MinVer" .

Length of output: 1344

test/Codebelt.Extensions.Newtonsoft.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs (1)

25-25: LGTM! Test updates align with PR objectives.

The change from HorizontalDirection to DayOfWeek maintains the test's intent while using a more standard .NET enum. The assertions are correctly updated to match the new expected values.

Let's verify the test coverage for all enum values:

Also applies to: 47-48

✅ Verification successful

Let me check the test file content to better understand the test coverage and assertions.


Test coverage for enum serialization is sufficient

The test file demonstrates comprehensive coverage of the DayOfWeek enum serialization:

  • Tests both PascalCase ("Saturday") and camelCase ("saturday") serialization
  • Verifies converter capabilities (CanRead, CanWrite, CanConvert)
  • Tests the core functionality of string enum conversion in both default and custom naming strategy scenarios

The change from HorizontalDirection to DayOfWeek is appropriate as:

  1. It maintains the same test coverage and assertions
  2. Uses a standard .NET enum which is more relatable
  3. Properly tests both naming conventions which is the primary purpose of these tests
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if there are tests covering other DayOfWeek enum values
# to ensure comprehensive test coverage

rg -A 5 "DayOfWeek\." test/

Length of output: 1867


Script:

#!/bin/bash
# Get the full test file content to analyze test methods and assertions
cat test/Codebelt.Extensions.Newtonsoft.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs

Length of output: 12118

Comment on lines +8 to +9
# Breaking Changes
- RENAMED DynamicJsonConverter class in the Codebelt.Extensions.Newtonsoft.Json namespace to JsonConverterFactory
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider restructuring breaking changes section for better visibility.

The removal of .NET 6 support is a significant breaking change that should be prominently listed in the "Breaking Changes" section rather than under "ALM". This helps users quickly identify all breaking changes that might affect their applications.

Apply this diff to restructure the breaking changes section:

 # Breaking Changes
 - RENAMED DynamicJsonConverter class in the Codebelt.Extensions.Newtonsoft.Json namespace to JsonConverterFactory
+- REMOVED Support for TFM .NET 6 (LTS) - Upgrade to .NET 8 or higher is required
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Breaking Changes
- RENAMED DynamicJsonConverter class in the Codebelt.Extensions.Newtonsoft.Json namespace to JsonConverterFactory
# Breaking Changes
- RENAMED DynamicJsonConverter class in the Codebelt.Extensions.Newtonsoft.Json namespace to JsonConverterFactory
- REMOVED Support for TFM .NET 6 (LTS) - Upgrade to .NET 8 or higher is required

Comment on lines +8 to +10
# Breaking Changes
- RENAMED DynamicJsonConverter class in the Codebelt.Extensions.Newtonsoft.Json namespace to JsonConverterFactory

Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Breaking change details for ValidatorExtensions should be added

Based on the evidence from the codebase:

  1. The change was made to comply with SonarSource rule S3343 (Caller information parameters should come at the end of the parameter list)
  2. The breaking change affects the parameter order in InvalidJsonDocument methods where paramName was moved to be consistent with Microsoft's guard improvements
  3. Users need to update their code if they're explicitly naming the paramName parameter in their method calls

Add these details to the breaking changes section:

# Breaking Changes
- RENAMED DynamicJsonConverter class in the Codebelt.Extensions.Newtonsoft.Json namespace to JsonConverterFactory
- REORDERED parameters in ValidatorExtensions.InvalidJsonDocument methods to comply with SonarSource rule S3343 - caller information parameters must be at the end. Update any code explicitly using named parameters.
🔗 Analysis chain

Provide more context for ValidatorExtensions breaking change.

The Quality Analysis section mentions a breaking change in ValidatorExtensions to comply with SonarSource rule S3343, but it doesn't explain the actual impact on consumers. Consider adding details about:

  1. What changed in the ValidatorExtensions class
  2. How this affects existing code
  3. What actions users need to take to migrate

Let's check the SonarSource rule and related changes:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find ValidatorExtensions changes and related files

# Find ValidatorExtensions implementation
ast-grep --pattern 'class ValidatorExtensions {
  $$$
}'

# Find tests that might show usage examples
rg -l "ValidatorExtensions" | grep -i "test"

Length of output: 175


Script:

#!/bin/bash
# Let's examine the test file to understand the changes
cat test/Codebelt.Extensions.Newtonsoft.Json.Tests/ValidatorExtensionsTest.cs

# Also search for any git history of this file
git log -p -- test/Codebelt.Extensions.Newtonsoft.Json.Tests/ValidatorExtensionsTest.cs

# Look for the actual ValidatorExtensions implementation
rg -g "!*.Test*" "ValidatorExtensions" -A 5

Length of output: 9162

@gimlichael gimlichael merged commit 09aa801 into main Nov 11, 2024
21 checks passed
@gimlichael gimlichael deleted the v9.0.0/prepare-for-launch branch November 11, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant