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

Drop custom validation attributes #1351

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Jun 26, 2023

Details on the issue fix or feature implementation

Having custom internal validation attributes causes problems with the code-generator in:
dotnet/extensions#4108

However, after going through these we don't actually need them.

  • TimeSpanAttribute: Can be replaced with RangeAttribute`
  • TimeoutAttribute: Can be replaced with RangeAttribute, while changing the validation behavior slightly. We now enforce valid timeout value in range of 1 second to 24 hours. Defaults to 30 seconds.

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

@martintmk martintmk added the v8 Issues related to the new version 8 of the Polly library. label Jun 26, 2023
@martintmk martintmk added this to the v8.0.0 milestone Jun 26, 2023
@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Merging #1351 (d0920fb) into main (9fb7dab) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1351      +/-   ##
==========================================
- Coverage   83.59%   83.52%   -0.08%     
==========================================
  Files         270      268       -2     
  Lines        6396     6366      -30     
  Branches     1008      999       -9     
==========================================
- Hits         5347     5317      -30     
  Misses        840      840              
  Partials      209      209              
Flag Coverage Δ
linux ?
macos 83.52% <100.00%> (-0.08%) ⬇️
windows 83.52% <100.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...r/AdvancedCircuitBreakerStrategyOptions.TResult.cs 100.00% <ø> (ø)
...re/CircuitBreaker/CircuitBreakerStrategyOptions.cs 100.00% <ø> (ø)
...c/Polly.Core/Retry/RetryStrategyOptions.TResult.cs 100.00% <ø> (ø)
...rc/Polly.Core/Timeout/TimeoutResilienceStrategy.cs 100.00% <ø> (ø)
...eout/TimeoutResilienceStrategyBuilderExtensions.cs 100.00% <ø> (ø)
src/Polly.Core/Timeout/TimeoutUtil.cs 100.00% <ø> (ø)
src/Polly.Core/Timeout/TimeoutStrategyOptions.cs 100.00% <100.00%> (ø)

@martintmk martintmk enabled auto-merge (squash) June 26, 2023 07:09
@martintmk martintmk merged commit a5cc056 into main Jun 26, 2023
@martintmk martintmk deleted the mtomka/drop-custom-validation-attributes branch June 26, 2023 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to the new version 8 of the Polly library.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants