Skip to content

Conversation

@askpt
Copy link
Member

@askpt askpt commented Jul 7, 2025

This PR

This pull request modifies the ProviderRepository class in the src/OpenFeature/ProviderRepository.cs file to improve cancellation support, streamline initialization and shutdown processes, and enhance compatibility across different .NET versions. The most notable changes include adding CancellationToken parameters to several methods, updating method access modifiers, and simplifying object initializations.

Cancellation Support Enhancements:

  • Added CancellationToken parameters to methods such as SetProviderAsync, InitProviderAsync, ShutdownIfUnusedAsync, and SafeShutdownProviderAsync to allow for operation cancellation. [1] [2] [3] [4] [5] [6]

Method Access Modifier Updates:

  • Changed several methods from public to internal, including SetProviderAsync, GetProvider, and ShutdownAsync, to restrict their accessibility and better align with the class's intended usage. [1] [2] [3] [4]

Compatibility Improvements:

  • Added conditional logic to handle string.IsNullOrWhiteSpace differently in .NET Framework and .NET Standard due to nullable compatibility issues. [1] [2]

Code Simplifications:

  • Simplified object initializations by using shorthand syntax, such as replacing explicit constructor calls with {} for ConcurrentDictionary and ReaderWriterLockSlim. [1] [2]

@askpt askpt marked this pull request as ready for review July 7, 2025 20:02
@askpt askpt requested a review from a team as a code owner July 7, 2025 20:02
@codecov
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.34%. Comparing base (2e70072) to head (08c556b).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/OpenFeature/ProviderRepository.cs 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #515      +/-   ##
==========================================
- Coverage   87.35%   87.34%   -0.01%     
==========================================
  Files          47       47              
  Lines        1827     1826       -1     
  Branches      190      190              
==========================================
- Hits         1596     1595       -1     
  Misses        188      188              
  Partials       43       43              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@askpt
Copy link
Member Author

askpt commented Jul 15, 2025

@kinyoklion, can you please have a look at this PR again?

@toddbaert
Copy link
Member

@kinyoklion I'll merge this in the next 2 days unless I hear objections; it seems @askpt has resolved your suggestions. 🙏

@kinyoklion
Copy link
Member

Sorry for the delay. Taking a look now.

@askpt
Copy link
Member Author

askpt commented Jul 28, 2025

Sorry for the delay. Taking a look now.

No worries @kinyoklion! Thank you for the review!

@askpt askpt added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit 2547a57 Jul 28, 2025
17 checks passed
@toddbaert toddbaert deleted the askpt/chore-provider-repository branch July 28, 2025 19:37
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.

6 participants