Skip to content

Conversation

@alexeyzimarev
Copy link
Member

@alexeyzimarev alexeyzimarev commented Nov 15, 2025

User description

Description

Update build pipelines to use .NET 10 GA


PR Type

Enhancement


Description

  • Update build pipelines to use .NET 10 GA instead of preview

  • Add net10.0 target framework to test matrix

  • Consolidate .NET 10 setup into main dotnet-version configuration

  • Add conditional code for ReadExactly API availability in .NET 10

  • Update GitHub Actions to latest versions (v5)


Diagram Walkthrough

flowchart LR
  A["Previous: .NET 10 Preview"] -->|"Upgrade to GA"| B["Current: .NET 10 GA"]
  C["Separate Setup Steps"] -->|"Consolidate"| D["Single dotnet-version config"]
  E["net48, net8.0, net9.0"] -->|"Add target"| F["net48, net8.0, net9.0, net10.0"]
  G["Read method"] -->|"Conditional compilation"| H["ReadExactly for .NET 10+"]
Loading

File Walkthrough

Relevant files
Configuration changes
build-dev.yml
Update workflow to .NET 10 GA                                                       

.github/workflows/build-dev.yml

  • Update actions/checkout from v4 to v5
  • Update actions/setup-dotnet from v4 to v5
  • Change dotnet-version from 9.0.x to 10.0.x
+3/-3     
pull-request.yml
Add .NET 10 GA to test matrices                                                   

.github/workflows/pull-request.yml

  • Add net10.0 to Windows test matrix
  • Add net10.0 to Linux test matrix
  • Consolidate .NET 10 setup into main dotnet-version configuration
  • Remove separate "Setup .NET 10" step with preview quality flag
  • Reformat YAML step syntax for consistency
+11/-30 
Directory.Build.props
Add net10.0 target framework                                                         

test/Directory.Build.props

  • Add net10.0 to TargetFrameworks property
  • Add CS8002 to NoWarn suppression list
+2/-2     
Enhancement
DownloadFileTests.cs
Add conditional code for ReadExactly API                                 

test/RestSharp.Tests.Integrated/DownloadFileTests.cs

  • Add conditional compilation directives for .NET 10+
  • Use ReadExactly method for .NET 10 and later
  • Fall back to Read method for earlier frameworks
  • Add blank line after using statements
+5/-0     

@qodo-merge-for-open-source
Copy link
Contributor

qodo-merge-for-open-source bot commented Nov 15, 2025

PR Compliance Guide 🔍

(Compliance updated until commit 7ab10a2)

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Previous compliance checks

Compliance check up to commit 12fe934
Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Missing error handling: The ReadExactly and Read operations lack error handling for potential stream read failures
or incomplete reads.

Referred Code
#if NET
                response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().ReadExactly(buf);
#else
                response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().Read(buf, 0, buf.Length);
#endif

Learn more about managing compliance generic rules or creating your own custom rules

@qodo-merge-for-open-source
Copy link
Contributor

qodo-merge-for-open-source bot commented Nov 15, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use a more specific preprocessor directive
Suggestion Impact:The suggestion impacted the commit by prompting a change to the preprocessor directive. However, instead of using #if NET7_0_OR_GREATER as suggested, the commit used #if NET8_0_OR_GREATER (line 27). Additionally, the code was refactored to extract the stream into a using variable before calling ReadExactly on it.

code diff:

-#if NET
-                response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().ReadExactly(buf);
-#else
-                response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().Read(buf, 0, buf.Length);
+                using var stream = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult();
+#if NET8_0_OR_GREATER
+                stream.ReadExactly(buf);
+#else                
+                stream.Read(buf, 0, buf.Length);
 #endif

Refine the preprocessor directive from #if NET to the more specific #if
NET7_0_OR_GREATER to accurately target frameworks where the Stream.ReadExactly
method is available.

test/RestSharp.Tests.Integrated/DownloadFileTests.cs [36-40]

-#if NET
+#if NET7_0_OR_GREATER
                 response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().ReadExactly(buf);
 #else
                 response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().Read(buf, 0, buf.Length);
 #endif

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that #if NET is too broad for Stream.ReadExactly, which was introduced in .NET 7, and proposes the more accurate #if NET7_0_OR_GREATER directive to prevent future build failures.

Medium
  • Update

# Conflicts:
#	.github/workflows/pull-request.yml
#	test/RestSharp.Tests.Integrated/DownloadFileTests.cs
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 15, 2025

Deploying restsharp with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7ab10a2
Status: ✅  Deploy successful!
Preview URL: https://d8948f30.restsharp.pages.dev
Branch Preview URL: https://net-10-ga.restsharp.pages.dev

View logs

@github-actions
Copy link

Test Results

   35 files     35 suites   15m 46s ⏱️
  453 tests   453 ✅ 0 💤 0 ❌
3 062 runs  3 062 ✅ 0 💤 0 ❌

Results for commit 7ab10a2.

@alexeyzimarev alexeyzimarev merged commit 5487cfd into dev Nov 15, 2025
11 checks passed
@alexeyzimarev alexeyzimarev deleted the net-10-ga branch November 15, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants