test(php): cover OpenFeature in all weblog environments - #7393
test(php): cover OpenFeature in all weblog environments#7393leoromanovsky wants to merge 10 commits into
Conversation
|
|
|
|
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. |
…enfeature-all-environments
…enfeature-all-environments # Conflicts: # manifests/php.yml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54a205d2c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
nccatoni
left a comment
There was a problem hiding this comment.
LGTM (for @DataDog/system-tests-core) but you should get a review from someone more familiar with the php tracer
Split supported and unavailable-provider contracts, and avoid installing the OpenFeature SDK in parametric images. Environment: Datadog workspace
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.