Skip to content

test(openfeature): demonstrate span enrichment type mismatch attribution#4953

Open
leoromanovsky wants to merge 3 commits into
mainfrom
leo/span-enrichment-type-mismatch-regression
Open

test(openfeature): demonstrate span enrichment type mismatch attribution#4953
leoromanovsky wants to merge 3 commits into
mainfrom
leo/span-enrichment-type-mismatch-regression

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

The span-enrichment implementation in the base PR currently trusts serial ID metadata before checking whether OpenFeature returned the caller default for a type mismatch. The existing evaluation logging path treats TypeMismatchCode as a runtime default even when a variant is present; this stacked PR captures the same expectation for span enrichment.

Changes

  • Add a TestBuildEvaluation case where the evaluation details contain a variant and serial ID metadata, but also carry TypeMismatchCode and the returned default value.
  • Assert that span enrichment records the runtime default instead of serial attribution.

Decisions

  • Keep this PR test-only and stacked on the base PR so it demonstrates the current behavior without changing the implementation.
  • Leave the test failing until the parent branch handles TypeMismatchCode before the serial-ID branch.

Validation

  • go test ./openfeature -run '^TestBuildEvaluation$' -count=1 fails on the new regression case: current code records subject/serial attribution and no default value.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.57%. Comparing base (2e59473) to head (d8e5624).

Additional details and impacted files

see 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-official

datadog-official Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 11 Pipeline jobs failed

Check Pull Request CI Status | all-jobs-are-green   View in Datadog   GitHub Actions

Pull Request Tests | PR Unit and Integration Tests (1.25) / test-core   View in Datadog   GitHub Actions

Pull Request Tests | PR Unit and Integration Tests (1.26) / test-core   View in Datadog   GitHub Actions

View all 11 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d8e5624 | Docs | Datadog PR Page | Give us feedback!

@leoromanovsky leoromanovsky marked this pull request as ready for review June 25, 2026 03:55
@leoromanovsky leoromanovsky requested a review from a team as a code owner June 25, 2026 03:55
@leoromanovsky leoromanovsky requested review from dd-oleksii and sameerank and removed request for a team June 25, 2026 03:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8e5624783

ℹ️ 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".

Comment on lines +185 to +188
expected: &i.FeatureFlagEvaluation{
FlagKey: "typed-flag",
DefaultValue: "fallback",
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix the failing span-enrichment test

With this new case, go test ./openfeature -run '^TestBuildEvaluation$/type_mismatch' -count=1 fails: the current buildEvaluation path still treats the non-empty variant plus serial metadata as an assignment and returns Subject/SerialID with no DefaultValue, so the test-only commit breaks the package test suite until the implementation change lands in the same change set.

Useful? React with 👍 / 👎.

@pr-commenter

pr-commenter Bot commented Jun 25, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-25 04:13:10

Comparing candidate commit d8e5624 in PR branch leo/span-enrichment-type-mismatch-regression with baseline commit 2e59473 in branch oleksii/span-enrichment.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 298 metrics, 1 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

@sameerank sameerank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Base automatically changed from oleksii/span-enrichment to main July 1, 2026 11:33
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot requested review from a team as code owners July 1, 2026 11:33
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.

3 participants