Commit 7237053
authored
feat: Add multi-provider support (#488)
* feat: implement MultiProvider class with placeholder methods for feature resolution
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add BaseEvaluationStrategy and MultiProvider classes for multi-provider feature flag evaluation
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: implement MultiProvider methods for feature flag resolution using evaluation strategy
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add ComparisonStrategy, FirstMatchStrategy, and FirstSuccessfulStrategy classes for feature flag evaluation
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: implement EvaluateAsync method in FirstMatchStrategy for type-specific feature resolution
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: enhance error handling in FirstMatchStrategy for feature flag resolution
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: implement EvaluateAsync method in FirstSuccessfulStrategy for multi-type feature resolution
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: refactor feature resolution strategies to use EvaluateAsync method for improved multi-provider support
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* Removed ComparisonStrategy.cs
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add unit tests for FirstMatchStrategy and FirstSuccessfulStrategy to enhance multi-provider support
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add unit tests for FirstSuccessfulStrategy to validate multi-provider evaluation logic
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add unit tests for MultiProvider and ProviderExtensions to validate multi-provider functionality
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add unit tests for MultiProvider to validate functionality and strategy delegation
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: update GetMetadata method to return non-nullable Metadata type
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: implement ShutdownAsync method to gracefully shut down all providers
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: implement InitializeAsync method to initialize all providers
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* Move to Extensions folder
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add initialization and shutdown tests for MultiProvider
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: enhance ShutdownAsync to handle exceptions from multiple providers
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: implement ComparisonStrategy for evaluating provider values with fallback and mismatch handling
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add constructor to MultiProvider for default evaluation strategy
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: update ComparisonStrategy and MultiProviderTests for improved clarity and consistency
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: rename namespaces from OpenFeature.Extensions.MultiProvider to OpenFeature.Providers.MultiProvider
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* Removed old files
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add multi-provider support with evaluation strategies
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* Revert "Move to Extensions folder"
This reverts commit 9ffd149.
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: use 'this' keyword for clarity in constructors across multiple models
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: add missing space in ProviderStatus exception handling for consistency
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: enhance ProviderResolutionResult to include exception details in resolution results
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: add error collection method and refine ProviderError to use Exception type
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: simplify error handling in FirstMatchStrategy and FirstSuccessfulStrategy
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for FirstSuccessfulStrategy behavior and result determination
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for FirstMatchStrategy behavior and result determination
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: simplify tests
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for ComparisonStrategy RunMode behavior
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for ComparisonStrategy functionality
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for ProviderEntry, ProviderStatus, and RegisteredProvider classes
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for FinalResult and ProviderError classes
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for ProviderExtensions functionality
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for MultiProvider functionality
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add unit tests for BaseEvaluationStrategy functionality
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* test: add multi-provider endpoint and evaluation logic
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: update RegisteredProvider to use internal access modifiers and enhance status management; add unit test for SetStatus method
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* docs: add Multi-Provider section to README with usage examples and evaluation strategies
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: change properties in StrategyPerProviderContext to use read-only accessors
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* docs: update summary comments in FirstMatchStrategy and FirstSuccessfulStrategy to clarify provider evaluation order
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* Refactor StrategyEvaluationContext to use generic types
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: simplify flag resolution logic in EvaluateAsync method
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: replace hardcoded provider name with constant in MultiProvider strategies
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: Rename Exception property to Error in ProviderStatus class
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* feat: Improved the thread safety for Multiprovider.
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Update exception object name in MultiProvider tests
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Update ObjectDisposedException object name in MultiProvider tests
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Remove volatile modifier from status fields in RegisteredProvider and MultiProvider
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* docs: Clarify evaluation strategy parameter description in MultiProvider constructor
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Update shutdown logic to allow shutdown in Ready or Fatal status and add corresponding tests
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* refactor: Move fallback provider resolution logic to a more appropriate location in ComparisonStrategy
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Simplify multi-provider endpoint response and improve error handling
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Improve dispose pattern handling in MultiProvider to ensure correct async initialization and shutdown
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Mark _disposed as volatile to ensure thread-safe access in async methods
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
* fix: Update MultiProvider to implement IAsyncDisposable and improve dispose pattern handling
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---------
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>1 parent 417f3fe commit 7237053
File tree
29 files changed
+4572
-1
lines changed- samples/AspNetCore
- src/OpenFeature/Providers/MultiProvider
- Models
- Strategies
- Models
- test/OpenFeature.Tests/Providers/MultiProvider
- Models
- Strategies
- Models
29 files changed
+4572
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
436 | 527 | | |
437 | 528 | | |
438 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
88 | 142 | | |
89 | 143 | | |
90 | 144 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments