-
Notifications
You must be signed in to change notification settings - Fork 2
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
Move minimum support to sdk 8 #295
Conversation
📝 WalkthroughWalkthroughThis pull request encompasses updates across multiple configuration and project files, primarily focusing on version upgrades and SDK configuration. The changes include updating package versions for Microsoft CodeAnalysis packages to version 4.8, modifying the SDK roll-forward behavior in Changes
Possibly related PRs
Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (7)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 7257 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.
Files not reviewed (3)
- Directory.Packages.props: Language not supported
- global.json: Language not supported
- tests/Moq.Analyzers.Benchmarks/Moq.Analyzers.Benchmarks.csproj: Language not supported
Code Climate has analyzed commit 8fc35c8 and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
Directory.Packages.props
(1 hunks)global.json
(1 hunks)tests/Moq.Analyzers.Benchmarks/Helpers/BenchmarkCSharpCompilationFactory.cs
(2 hunks)tests/Moq.Analyzers.Benchmarks/Moq.Analyzers.Benchmarks.csproj
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
tests/Moq.Analyzers.Benchmarks/Helpers/BenchmarkCSharpCompilationFactory.cs (1)
Pattern **/*.cs
: I need your help tracking down and fixing some bugs that have been reported in this codebase.
I suspect the bugs are related to:
- Incorrect handling of edge cases
- Off-by-one errors in loops or array indexing
- Unexpected data types
- Uncaught exceptions
- Concurrency issues
- Improper configuration settings
To diagnose:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- Suggestions for how to fix it
After analysis, please update the code with your proposed fixes. Try to match the existing code style. Add regression tests if possible to prevent the bugs from recurring.
I appreciate your diligence and attention to detail! Let me know if you need any clarification on the intended behavior of the code.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
tests/Moq.Analyzers.Benchmarks/Helpers/BenchmarkCSharpCompilationFactory.cs (1)
21-22
: Verify WithAnalyzers API compatibility with CancellationToken removal.The removal of
CancellationToken.None
fromWithAnalyzers
calls might affect cancellation behavior. While this aligns with moving to SDK 8+, we should verify the API compatibility.Also applies to: 40-42
✅ Verification successful
CancellationToken removal is safe in WithAnalyzers calls
The removal of
CancellationToken.None
is consistent with the codebase patterns:
- All WithAnalyzers calls in the benchmarks follow this pattern
- Changes are isolated to test infrastructure
- Project already targets modern .NET SDK (8.0+)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check WithAnalyzers API signatures in the codebase rg -A 2 "WithAnalyzers.*CancellationToken" # Check for any existing usages that might be affected rg -A 2 "CreateAsync.*CancellationToken"Length of output: 87
Script:
#!/bin/bash # Check for WithAnalyzers usage patterns rg -l "WithAnalyzers" # Check project SDK versions fd -e csproj . --exec cat {} # Look for test setup patterns rg -A 3 "CompilationWithAnalyzers"Length of output: 13140
Directory.Packages.props (1)
20-22
: Verify package compatibility matrix.The upgrade to Microsoft.CodeAnalysis 4.8 is appropriate for .NET 8 support, but we should verify compatibility with other dependencies.
✅ Verification successful
Package compatibility verified successfully
The upgrade to Microsoft.CodeAnalysis 4.8 is compatible with:
- All project target frameworks (netstandard2.0, net8.0, net9.0)
- Related Microsoft.CodeAnalysis packages (3.11.x family)
- VS 2022 17.8 as intended
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for any version constraints or conflicts rg -l "Microsoft\.CodeAnalysis" | xargs cat | rg "Version|PackageReference" # Check for any direct dependencies on these packages rg --type=csproj -l "Microsoft\.CodeAnalysis\.CSharp"Length of output: 5030
Script:
#!/bin/bash # Find and examine .csproj files and their contents fd -e csproj --exec cat {} # Check for target framework versions fd -e props -e csproj | xargs cat | rg "TargetFramework" # Look for any compatibility-related configuration fd -e props -e csproj | xargs cat | rg -i "support|compatible|require"Length of output: 8815
global.json (1)
3-4
: Verify .NET 9 SDK requirement.The project is using .NET 9.0.100 SDK with patch-level roll-forward. Since .NET 9 is in preview:
- This might introduce instability
- Consider staying on .NET 8 until .NET 9 is released
✅ Verification successful
Using .NET 9 SDK is appropriate for this analyzer project
The .NET 9 SDK usage is justified as this is a Roslyn analyzer project (Moq.Analyzers) that needs to maintain compatibility with upcoming .NET versions. The patch-level roll-forward policy is also appropriate for development tooling.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for .NET SDK version requirements across the solution rg -l "net9" | xargs cat | rg "TargetFramework|RuntimeIdentifier" # Check for any preview package dependencies cat Directory.Packages.props | rg "preview|beta|alpha"Length of output: 447
Script:
#!/bin/bash # Check project type and purpose fd -e csproj | xargs cat | rg -A 2 "ProjectTypeGuids|OutputType|PackageId" # Check for analyzer/SDK development indicators rg -l "Microsoft\.CodeAnalysis" | xargs cat | rg "using Microsoft\.CodeAnalysis|ISourceGenerator|ISyntaxReceiver"Length of output: 2151
tests/Moq.Analyzers.Benchmarks/Moq.Analyzers.Benchmarks.csproj (1)
5-5
: Verify package compatibility with .NET 9.While upgrading the test project to .NET 9 is less risky, we should verify that all package dependencies support this version:
- BenchmarkDotNet
- Microsoft.CodeAnalysis packages
- Microsoft.CodeAnalysis.AnalyzerUtilities
✅ Verification successful
Dependencies are compatible with .NET 9
The benchmark project's dependencies are compatible with .NET 9:
- BenchmarkDotNet 0.13.12 has .NET 9 support
- Microsoft.CodeAnalysis packages are build-time only (PrivateAssets="all")
- Microsoft.CodeAnalysis.AnalyzerUtilities is using a .NET 9 compatible beta version
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check package versions and their .NET support cat Directory.Packages.props | rg "PackageVersion.*Include=\"(BenchmarkDotNet|Microsoft\.CodeAnalysis)" # Look for any framework-specific conditions rg "net9" --type=csprojLength of output: 496
Script:
#!/bin/bash # Search for csproj files and their content find . -name "*.csproj" -exec cat {} \; # Look for framework-specific conditions in all files rg "Condition.*net9|net9.*Condition" --type-add 'proj:*.{csproj,props,targets}' --type=projLength of output: 8143
For v1.0 release, Moq.Analyzers will move to support the latest stable .NET LTS SDK
Changes:
Microsoft.CodeAnalysis.CSharp
andMicrosoft.CodeAnalysis.CSharp.Workspaces
updated to 4.8. This is the earliest .NET 8 SDK we can support. See https://github.com/dotnet/roslyn/blob/main/docs/wiki/NuGet-packages.md?plain=1#L49CancellationToken
parameters in benchmark helper methods as a result of the package updates