Skip to content

Prepare PHP serial ID flag metadata test activation - #7857

Draft
hhan2024 wants to merge 9 commits into
mainfrom
ffe-php-serial-id-metadata
Draft

hhan2024 wants to merge 9 commits into
mainfrom
ffe-php-serial-id-metadata

Conversation

@hhan2024

@hhan2024 hhan2024 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked directly on ffe-serial-id-metadata-system-test (#7820).

  • Serialize PHP flag metadata as a JSON object, including the empty map.
    The adapter forwards SDK metadata unchanged; it does not synthesize serial IDs.
  • Track the SDK/release dependency in the PHP manifest. This remains draft and
    missing_feature until the SDK fix is merged and its release is known.

SDK dependency

PHP currently exposes native serialId only in exposure data. A tested SDK patch
adds __dd_split_serial_id to flag metadata when span enrichment is enabled,
preserves zero, and omits missing/null IDs. Existing metadata is preserved.
The native evaluator passes the existing enrichment gate to its result mapper.

SDK dependency: DataDog/dd-trace-php#4247, branch
ffe-serial-id-flag-metadata, signed commit e3226c4f, based on PHP master
d98de1ed. Repository access is resolved and the SDK PR is now published.
Do not merge/activate this draft until that dependency and release gate are set.

Validation

  • PHP SDK FeatureFlags unit suite: 39 passed, 111 assertions.
  • New positive/zero/camel-case cases fail against the original mapper (3 failures)
    and pass with the patch; also covers missing/null IDs and disabled enrichment.
  • SDK composer ci-lint: passed.
  • System-tests ./format.sh --check: passed.
  • Focused serial-ID system tests: 5 passed with PHP 1.25.1 native extension
    plus the patched PHP SDK sources. Exact command:
TEST_LIBRARY=php venv/bin/pytest -S PARAMETRIC --skip-parametric-build -n=2 \
  -p no:warnings tests/parametric/test_ffe/test_serial_id_metadata.py \
  -F tests/parametric/test_ffe/test_serial_id_metadata.py

Candidate image recipe (local validation only, not committed): use the existing
PHP 1.25.1 parametric image, copy the patched SDK src into /ffe-sdk/src, set
DD_TRACE_SOURCES_PATH=/ffe-sdk/src and DD_AUTOLOAD_NO_COMPILE=true, then copy
this branch's server.php into /binaries/server.php. No native changes needed.
The normal image tag was restored after testing.

hhan2024 and others added 8 commits September 24, 2026 18:30
Every UFC split has a stable per-org serialId used by downstream consumers
(APM span enrichment, exposure caching, evaluation-metrics correlation) to
identify the exact (allocation, variant) pair that was assigned. Today only
the Node server SDK (openfeature-js-client#269) exposes this via
flagMetadata["__dd_split_serial_id"]; this test generalizes the contract
so every SDK can be validated the same way.

Adds a dedicated fixture covering: a plain serialId, serialId=0 (a valid ID
that must not be dropped by a truthiness check), a split with no serialId
(must not fabricate one), and two allocations with different serialIds
selected via targeting.

All languages are marked missing_feature: verified directly against the
Node.js and Go parametric weblog handlers that neither returns flagMetadata
from POST /ffe/evaluate today.

The new feature_flags_serial_id_metadata marker uses NOT_REPORTED_ID
pending a real feature-parity page.
Exclude the UFC configuration from evaluation-case discovery, disable the
new suite for Rust, and require successful evaluation before accepting an
absent serial ID. Apply the repository formatter to the new test module.

Environment: Datadog workspace
Fail evaluations that omit flagMetadata while allowing null or empty metadata when a split has no serial ID.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>
Tighten the missing-serial-ID test so an SDK cannot serialize an absent UFC serial ID as a null metadata entry.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>
Exercise serial-ID flag metadata under the required span-enrichment configuration for positive, zero, and missing UFC serial IDs.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>
Fix the import-policy failure when the PR is tested against current main.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-6 <noreply@localhost>
Bring in the exact upstream facade so imports work on the PR head as well as merged main.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>
Serialize empty flag metadata as an object and document the pending SDK release dependency.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>
@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/php.yml                                                       @DataDog/system-tests-reviewers
utils/build/docker/php/parametric/server.php                            @DataDog/system-tests-reviewers

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a332f3a | Docs | View more details | Give us feedback!

Start the provider without injecting the UFC fixture after Remote Config acknowledgement.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-6 <noreply@localhost>
Base automatically changed from ffe-serial-id-metadata-system-test to main October 16, 2026 17:03

This branch has not been deployed

No deployments
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.

2 participants