Skip to content

feat(openfeature): add semantic version operators for feature flag evaluation - #12182

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
masterfrom
greg.huels/FFL-2920/semver-java
Aug 13, 2026
Merged

feat(openfeature): add semantic version operators for feature flag evaluation#12182
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
masterfrom
greg.huels/FFL-2920/semver-java

Conversation

@greghuels

@greghuels greghuels commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Ports SemVer condition operators (SEMVER_EQ, SEMVER_NEQ, SEMVER_LT, SEMVER_LTE, SEMVER_GT, SEMVER_GTE) from dd-trace-go#5128 to the Java SDK.

  • ParsedSemver — Rust-compatible SemVer parser and comparator (unsigned 64-bit core components, arbitrary-length numeric prerelease identifiers, build metadata validated but ignored for precedence).
  • ConditionOperator — 6 new enum values.
  • ConditionConfiguration — transient semverComparand field cached during config validation.
  • ServerConfiguration — transient invalidFlags map so the evaluator returns PARSE_ERROR for flags with invalid semver comparands.
  • DDEvaluatorevaluateSemverCondition method and switch cases for all 6 operators; invalid-flag check returning PARSE_ERROR.
  • UniversalFlagConfigParser — validates and caches semver comparands during parsing; invalid comparands cause the flag to be dropped and tracked.
  • ffe-system-test-data submodule — updated to version that included the semver tests (aaa97e4) which includes ffe-system-test-data#20 and ffe-system-test-data#22.

Motivation

Cross-SDK feature flag parity. The Go SDK added SemVer operators in dd-trace-go#5128; this ports the same functionality to Java so FFE targeting rules using SEMVER_* operators evaluate identically across SDKs.

Additional Notes

  • Unit tests: ParsedSemverTest (30 tests ported from Go semver_test.go), DDEvaluatorTest semver condition tests (28 parameterized + 2 edge cases).
  • Canonical fixture tests: 22 cases from the two system test PRs run automatically via the existing testEvaluateCanonicalFixture parameterized test and the OpenFeatureProviderSmokeTest.
  • All 551 unit tests and 250 smoke tests pass; Spotless and SpotBugs clean.

Contributor Checklist

Jira ticket: FFL-2920

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 91.39%
Overall Coverage: 58.27% (+0.02%)

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

@dd-octo-sts

dd-octo-sts Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.85 s 14.75 s [-0.2%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 13.58 s 13.67 s [-1.5%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.94 s 16.65 s [+0.8%; +2.7%] (maybe worse)
startup:petclinic:iast:Agent 16.90 s 17.00 s [-1.4%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 16.25 s 16.82 s [-7.9%; +1.1%] (no difference)
startup:petclinic:sca:Agent 16.81 s 16.62 s [+0.3%; +2.0%] (maybe worse)
startup:petclinic:tracing:Agent 16.02 s 16.06 s [-1.2%; +0.7%] (no difference)

Commit: 0d825615 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@greghuels
greghuels marked this pull request as ready for review August 11, 2026 13:16
@greghuels
greghuels requested a review from a team as a code owner August 11, 2026 13:16
@greghuels
greghuels requested review from pavlokhrebto and sameerank and removed request for a team August 11, 2026 13:16
@dd-octo-sts dd-octo-sts Bot added the tag: ai generated Largely based on code generated by an AI or LLM label Aug 11, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@greghuels greghuels added comp: openfeature OpenFeature type: feature Enhancements and improvements labels Aug 11, 2026

@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: a9aba09100

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@greghuels
greghuels requested a review from typotter August 11, 2026 13:44

@datadog-prod-us1-5 datadog-prod-us1-5 Bot 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.

Datadog Autotest: FAIL

Shard totals above 2^31 are accepted but narrowed during hashing, silently selecting different variations than Go. The new SemVer preprocessing also dereferences null nested list elements, so one malformed flag can reject an otherwise valid remote-config update.

📊 Validated against 9 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit a9aba09 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Port the SemVer condition operators (SEMVER_EQ, SEMVER_NEQ, SEMVER_LT,
SEMVER_LTE, SEMVER_GT, SEMVER_GTE) from dd-trace-go PR #5128 to the Java
SDK. This includes:

- ParsedSemver: a Rust-compatible SemVer parser and comparator that owns
  its own parsing logic for cross-SDK consistency. Core components use
  unsigned 64-bit semantics; numeric prerelease identifiers support
  arbitrary length; build metadata is validated but ignored for precedence.

- ConditionOperator: 6 new enum values for the SEMVER_* operators.

- ConditionConfiguration: transient semverComparand field to cache the
  parsed comparand during config validation.

- ServerConfiguration: transient invalidFlags map so the evaluator can
  return PARSE_ERROR for flags with invalid semver comparands.

- DDEvaluator: evaluateSemverCondition method and switch cases for all
  6 operators; invalid-flag check returning PARSE_ERROR.

- UniversalFlagConfigParser: validateAndCacheSemverComparands during
  parsing, with InvalidSemverComparandException for non-string or
  unparseable values.

- Update ffe-system-test-data submodule to main (ea8b5cc) which includes
  the semver comparison and validation fixtures from PRs #20 and #22.

- Unit tests: ParsedSemverTest (30 tests ported from Go semver_test.go),
  DDEvaluatorTest semver condition tests (28 parameterized + 2 edge cases),
  and canonical fixture tests (22 cases from the two system test PRs).
@greghuels
greghuels force-pushed the greg.huels/FFL-2920/semver-java branch from 11f89ba to 9a96436 Compare August 12, 2026 16:53
@greghuels
greghuels force-pushed the greg.huels/FFL-2920/semver-java branch from 0ebaa3e to 675c451 Compare August 12, 2026 17:01
- DDEvaluator: return DEFAULT for invalid (non-semver) flags instead of
  FLAG_NOT_FOUND, add POSIX character class normalization for regex
  matching, use DEFAULT reason for date-gated allocations with no rules
- DDEvaluatorTest: add FlagMapAdapter with per-flag error isolation
  matching production parser, wire up INVALID_FLAGS_HOLDER
- UniversalFlagConfigParser: add validateFlag for missing split shards,
  track invalid flags with INVALID_FLAG error type alongside semver
- OpenFeatureProviderSmokeTest: null-safe buildLoggedAllocations for
  malformed allocation shapes
@greghuels
greghuels force-pushed the greg.huels/FFL-2920/semver-java branch from c7840bf to f09ae33 Compare August 12, 2026 19:39
@greghuels
greghuels added this pull request to the merge queue Aug 13, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 13, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-13 10:10:25 UTC ℹ️ Start processing command /merge


2026-08-13 10:10:31 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-08-13 10:59:07 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 13, 2026
@greghuels
greghuels added this pull request to the merge queue Aug 13, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 13, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-13 10:17:35 UTC ℹ️ Start processing command /merge


2026-08-13 10:17:37 UTC ❌ MergeQueue

PR already in the queue with status in_progress

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 13, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 35c4350 into master Aug 13, 2026
595 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the greg.huels/FFL-2920/semver-java branch August 13, 2026 10:59
@github-actions github-actions Bot added this to the 1.66.0 milestone Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: openfeature OpenFeature tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants