test(php): cover OpenFeature in all weblog environments - #7393
Draft
leoromanovsky wants to merge 4 commits into
Draft
test(php): cover OpenFeature in all weblog environments#7393leoromanovsky wants to merge 4 commits into
leoromanovsky wants to merge 4 commits into
Conversation
Contributor
|
|
Contributor
|
Contributor
Author
|
Validated against the current PHP fix build.
Local results: The current GitHub Actions run does not use this PHP build:
Therefore, the PHP fix will unblock the FFE failures. It will not make every PHP job green because the AppSec failures are separate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A customer found that an application error handler can convert a provider warning into an exception. OpenFeature then returns the code default with a
GENERALerror.The existing PHP FFE tests called the native Datadog client. They did not cross the OpenFeature provider and logger boundary where this failure occurred.
flowchart LR App["Application"] --> Client["OpenFeature client"] Client --> Provider["Datadog provider"] Provider --> Evaluator["Datadog evaluator"] Provider -. "warning" .-> Handler["Application error handler"] Handler --> Exception["Exception"] Exception --> Error["Code default plus GENERAL error"] Test["Previous FFE test"] --> Endpoint["POST /ffe"] Endpoint --> Native["Native Datadog client"] Native --> Evaluator Test -. "missed this boundary" .-> ProviderThe OpenFeature PHP SDK requires PHP 8 or later. System tests still support PHP 7. PHP 7 must keep the
/ffecontract when the SDK is unavailable.Changes and Decisions
The
/ffeendpoint now uses OpenFeature by default. Tests that need the native client can setevaluationApitonative.The generic test omits
evaluationApi. An available provider must return the configured value. An unavailable provider must return the supplied default withERRORandPROVIDER_NOT_READY.flowchart TD Test["Generic FFE test"] --> Endpoint["POST /ffe"] Endpoint --> Default["Default to OpenFeature"] Default --> Available{"Provider available?"} Available -->|"Yes"| Success["Configured value and no error"] Available -->|"No"| Fallback["Supplied default<br/>ERROR<br/>PROVIDER_NOT_READY"] Success --> Contract["Contract passes"] Fallback --> ContractThe shared PHP installer adds the OpenFeature SDK on PHP 8 and later. Laravel and Symfony use the shared
/ffehandler. PHP 7 marks provider-dependent tests as unavailable but keeps the generic contract test enabled.The PHP 8 success path depends on DataDog/dd-trace-php#4071.
Validation
These local runs used this PR at
0dad5d48bec63cffdd206b724013d26f497c0c8c. They used the CI-built ARM64 package fromdd-trace-phpbf360ef80839f483179e37215536d1713116167c.The PHP-FPM 8.2 image used PHP
8.2.32. All four images reported tracer version1.24.0+dev.bf360ef80839f483179e37215536d1713116167c.