Skip to content

Conversation

@martincostello
Copy link
Member

Apply AD0001 and AD0002 code fixes.

Apply `AD0001` and `AD0002` code fixes.
@codecov
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

❌ Patch coverage is 94.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.15%. Comparing base (58a53a8) to head (95a9c70).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Polly/Wrap/AsyncPolicyWrap.cs 80.00% 1 Missing ⚠️
src/Polly/Wrap/AsyncPolicyWrapEngine.cs 75.00% 1 Missing ⚠️
src/Polly/Wrap/PolicyWrap.cs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2740      +/-   ##
==========================================
+ Coverage   96.12%   96.15%   +0.02%     
==========================================
  Files         309      309              
  Lines        7118     7118              
  Branches     1008     1008              
==========================================
+ Hits         6842     6844       +2     
+ Misses        222      221       -1     
+ Partials       54       53       -1     
Flag Coverage Δ
linux 96.15% <94.00%> (+0.02%) ⬆️
macos 96.15% <94.00%> (+0.02%) ⬆️
windows 96.14% <94.00%> (+0.02%) ⬆️

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.

@martincostello
Copy link
Member Author

martincostello commented Sep 6, 2025

Coverage fall suggests not all of these are strictly correct and change the semantics.

Actually, might just be a flaky test.

Update documentation snippets.
Add missing test coverage for `Cache<string>`.
@martincostello martincostello marked this pull request as ready for review September 6, 2025 13:59
Copilot AI review requested due to automatic review settings September 6, 2025 13:59
@martincostello martincostello enabled auto-merge (squash) September 6, 2025 13:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR applies AD0001 and AD0002 code fixes to simplify the codebase by removing unnecessary generic type parameters from method calls where the compiler can infer the types automatically.

  • Removed redundant generic type parameters from various method calls across test and source files
  • Simplified XML documentation references by removing fully qualified namespaces where unnecessary
  • Updated one test method to use CancellationToken.None instead of the fully qualified version

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/Polly.Specs/Caching/CacheTResultSpecs.cs Adds a new test method for cache behavior with ICacheKeyStrategy
test/Polly.RateLimiting.Tests/RateLimiterResiliencePipelineBuilderExtensionsTests.cs Simplified CancellationToken.None reference
test/Polly.Core.Tests/Simmy/Outcomes/ChaosOutcomeStrategyTests.cs Removed generic type parameter from ExecuteAsync call
test/Polly.Core.Tests/Hedging/Controller/TaskExecutionTests.cs Removed generic type parameters from InitializeAsync calls
src/Snippets/Docs/Migration.Registry.cs Simplified TryGetPipeline method call
src/Snippets/Docs/Migration.Execute.cs Removed generic type parameters from ExecuteOutcomeAsync calls
src/Snippets/Docs/Fallback.cs Removed generic type parameters from ExecuteOutcomeAsync calls
src/Snippets/Docs/CircuitBreaker.cs Removed generic type parameters from ExecuteOutcomeAsync calls
src/Polly/Wrap/PolicyWrapEngine.cs Removed generic type parameters from Execute method calls
src/Polly/Wrap/PolicyWrap.cs Removed generic type parameters from PolicyWrapEngine.Implementation calls
src/Polly/Wrap/AsyncPolicyWrapEngine.cs Removed generic type parameters from ExecuteAsync method calls
src/Polly/Wrap/AsyncPolicyWrap.cs Removed generic type parameters from AsyncPolicyWrapEngine.ImplementationAsync calls
src/Polly/Timeout/TimeoutStrategy.cs Simplified XML documentation references
src/Polly/PolicyBuilder.cs Simplified XML documentation references
src/Polly/Fallback/AsyncFallbackPolicy.cs Removed generic type parameter from AsyncFallbackEngine.ImplementationAsync call
src/Polly/CircuitBreaker/CircuitBreakerPolicy.cs Removed generic type parameter from CircuitBreakerEngine.Implementation call
src/Polly/CircuitBreaker/AsyncCircuitBreakerPolicy.cs Removed generic type parameter from AsyncCircuitBreakerEngine.ImplementationAsync call
src/Polly/Caching/CacheTResultSyntax.cs Removed generic type parameters from Cache method calls
src/Polly/Caching/CachePolicy.cs Removed generic type parameter from CacheEngine.Implementation call
src/Polly/Caching/AsyncCachePolicy.cs Removed generic type parameters from AsyncCacheEngine.ImplementationAsync calls
src/Polly/AsyncPolicy.NonGenericImplementation.cs Removed generic type parameter from ImplementationAsync call
src/Polly.Core/ResiliencePipelineT.Async.cs Simplified XML documentation reference
src/Polly.Core/ResiliencePipelineBuilderBase.cs Simplified XML documentation references
src/Polly.Core/ResiliencePipeline.AsyncT.cs Simplified XML documentation reference
src/LegacySupport/RequiresUnreferencedCodeAttribute.cs Simplified XML documentation reference
src/LegacySupport/DynamicallyAccessedMembersAttribute.cs Simplified XML documentation reference
docs/strategies/fallback.md Removed generic type parameters from ExecuteOutcomeAsync calls in documentation
docs/strategies/circuit-breaker.md Removed generic type parameters from ExecuteOutcomeAsync calls in documentation
docs/migration-v8.md Removed generic type parameters from ExecuteOutcomeAsync and TryGetPipeline calls in documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@martincostello martincostello merged commit 6598319 into main Sep 6, 2025
27 of 28 checks passed
@martincostello martincostello deleted the fix-analyzer-warnings branch September 6, 2025 14:01
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.

2 participants