Skip to content

fix(flagsmith)!: upgrade Java client to 8.1.1 - #1880

Open
AllanAlmeida wants to merge 2 commits into
open-feature:mainfrom
AllanAlmeida:fix/flagsmith-client-8-1816
Open

AllanAlmeida wants to merge 2 commits into
open-feature:mainfrom
AllanAlmeida:fix/flagsmith-client-8-1816

Conversation

@AllanAlmeida

@AllanAlmeida AllanAlmeida commented Oct 1, 2026 •

Copy link
Copy Markdown

Summary

  • Upgrade flagsmith-java-client from 7.4.3 to 8.1.1.
  • Align OkHttp and MockWebServer with the client's OkHttp 5 dependency, updating test dispatchers for its API.
  • Cover local evaluation of a segment rule against $.identity.identifier for matching and nonmatching identities.

Breaking changes

Upgrading flagsmith-java-client from 7.x to 8.x changes local evaluation results. Remote evaluation is unaffected.

  • Multivariate values keep their JSON type. Variant values used to be coerced to strings. They now resolve as their native type. Callers that read these flags with getStringValue will get the default value with TYPE_MISMATCH. Use the matching typed getter instead (getBooleanValue, getIntegerValue, etc.).
  • Multivariate segment overrides are now evaluated. They used to be ignored, so some identities will get different variants.
  • Percentage splits skip identities missing the split trait. Identities without the trait no longer match PERCENTAGE_SPLIT segments.

Validation

  • ./mvnw -B -ntp -pl providers/flagsmith verify with JDK 21: 36 tests passed; Checkstyle, PMD, SpotBugs, and Spotless passed.
  • ./mvnw -B -ntp -pl providers/flagsmith dependency:tree -Dincludes=com.squareup.okhttp3: only OkHttp 5 artifacts are resolved.

Closes #1816.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Flagsmith client and HTTP dependencies are upgraded. Provider tests use request-based mock-server dispatchers and add coverage for local evaluation against an identity segment.

Changes: Flagsmith local evaluation

Layer / File(s) Summary
Update Flagsmith and HTTP client dependencies
providers/flagsmith/pom.xml
The Flagsmith client is upgraded to 8.1.1. OkHttp changes to okhttp-jvm 5.0.0, and MockWebServer is upgraded to 5.0.0.
Test local identity-segment evaluation
providers/flagsmith/src/test/java/dev.openfeature.contrib.providers.flagsmith/FlagsmithProviderTest.java, providers/flagsmith/src/test/resources/mock_responses/identity-segment-environment-document.json
Request-based dispatchers return fixtures by request path or return HTTP 404; the error dispatcher returns HTTP 500. The new test checks that the matching identity returns "matched" and another identity returns "default".

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Medium

Merge Risk: Minimal · up to ca131

This upgrades the Flagsmith provider's client and HTTP libraries and adds test coverage for local identity-segment evaluation. No concrete merge-blocking risk was found. The documented local-evaluation behavior changes should be communicated to users.

Security architecture risk: Low · up to 3c838

The upgrade retains the provider’s existing configuration and evaluation paths, and no new production entrypoint or weakened control was identified. Some uncertainty remains because the upgraded libraries’ internal identity-evaluation and transport behavior was not verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated production exposure is applications using the Flagsmith provider with the upgraded SDK and HTTP client. The selected public-entrypoint evidence does not establish a new inbound production attack surface or broader service authority.

Trust Boundaries and Controls

  • observed — Application-supplied identity and context values continue to cross into the Flagsmith SDK through the existing evaluation path. The new test demonstrates targeting behavior, not authentication or authorization enforcement, and does not establish the upgraded SDK’s internal security properties.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the Flagsmith provider and the Java client upgrade to 8.1.1, which is the main change in the changeset. The conventional-commit prefix marks it as a breaking change, which matches the …
Description check Passed The description states the client upgrade from 7.4.3 to 8.1.1, the OkHttp and MockWebServer alignment, and the new local-evaluation test coverage. These match the changes in the pom.xml, test class, a…
Linked Issues check Passed Directly linked issue #1816 has one coding objective group: bump the bundled client to 8.x and adapt the provider to the 8.x API and context changes. The PR changes providers/flagsmith/pom.xml to `f…
Out of Scope Changes check Passed All changes support #1816. The pom changes perform the client upgrade and the OkHttp 5 alignment that the client requires. The test dispatcher changes adapt the existing tests to that API. The new fix…
Full details: Title check

Explanation

The title names the Flagsmith provider and the Java client upgrade to 8.1.1, which is the main change in the changeset. The conventional-commit prefix marks it as a breaking change, which matches the breaking-changes section in the description. The title is specific and concise.

Full details: Description check

Explanation

The description states the client upgrade from 7.4.3 to 8.1.1, the OkHttp and MockWebServer alignment, and the new local-evaluation test coverage. These match the changes in the pom.xml, test class, and new fixture. It also lists breaking changes and validation steps.

Full details: Linked Issues check

Explanation

Directly linked issue #1816 has one coding objective group: bump the bundled client to 8.x and adapt the provider to the 8.x API and context changes. The PR changes providers/flagsmith/pom.xml to flagsmith-java-client 8.1.1, and aligns OkHttp and MockWebServer to 5.0.0. The PR changes no files under providers/flagsmith/src/main, so the existing provider code compiles against 8.1.1 as reported by the author's verify run (36 tests passed, with Checkstyle, PMD, SpotBugs, and Spotless). The test changes in FlagsmithProviderTest.java update the mock dispatchers for the new OkHttp 5 API. The new local-evaluation test, which uses identity-segment-environment-document.json, checks that the $.identity.identifier segment returns matched for matching-identity and default for other identities. This covers the local-evaluation discrepancy described in #1816. The breaking behaviour changes are documented in the PR description. Limit: the incremental diff from the previous reviewed head could not be read, so the current head was assessed from the whole-PR summary and the diff against the merge base.

Full details: Out of Scope Changes check

Explanation

All changes support #1816. The pom changes perform the client upgrade and the OkHttp 5 alignment that the client requires. The test dispatcher changes adapt the existing tests to that API. The new fixture and local-evaluation test verify the identity-segment behaviour that #1816 describes. No production code or unrelated dependency change appears in the reviewed evidence. Limit: the incremental diff from the previous reviewed head was unavailable, so the check relies on the whole-PR summary and the empty src/main diff against the merge base.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

OSV Scanner (2.7.0)

providers/flagsmith/pom.xml

OSV Scanner exited with code 127; dependency analysis is incomplete

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f71c4d03-6e3e-4f26-aa8d-787ec226fa1d
Commits

Reviewing files that changed from the base of the PR and between 3c83833 and ca1312e.

Files selected for processing: 2

  • providers/flagsmith/pom.xml
  • providers/flagsmith/src/test/java/dev.openfeature.contrib.providers.flagsmith/FlagsmithProviderTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Signed-off-by: AllanAlmeida <allan.almeida.cpmb@gmail.com>
@AllanAlmeida
AllanAlmeida force-pushed the fix/flagsmith-client-8-1816 branch from 32b5976 to 3c83833 Compare October 1, 2026 17:33
@AllanAlmeida

Copy link
Copy Markdown
Author

Hi @matthewelwell @ajhelsby, just a quick follow-up on this PR when you have a chance.

The Flagsmith provider module is passing locally, and the PR is currently waiting for review/CI approval from the fork.

Thanks!

@AllanAlmeida

Copy link
Copy Markdown
Author

Hi @toddbaert, would you mind taking a look at this PR when you have a chance?

It has been waiting for review/CI approval for a few weeks. The Flagsmith component owners were already requested, and the provider module is passing locally.

Thanks!

@khvn26 khvn26 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.

Thanks for the contribution @AllanAlmeida!

Can we:

  • Change the PR title to: fix(flagsmith)!: upgrade Java client to 8.1.1

Add the following to PR description / changelog:

### Breaking changes

Upgrading `flagsmith-java-client` from 7.x to 8.x changes local evaluation results. Remote evaluation is unaffected.
 - Multivariate values keep their JSON type. Variant values used to be coerced to strings. They now resolve as their native type. Callers that read these flags with `getStringValue` will get the default value with `TYPE_MISMATCH`. Use the matching typed getter instead (`getBooleanValue`, `getIntegerValue`, etc.).
 - Multivariate segment overrides are now evaluated. They used to be ignored, so some identities will get different variants.
 - Percentage splits skip identities missing the split trait. Identities without the trait no longer match `PERCENTAGE_SPLIT` segments.

@AllanAlmeida AllanAlmeida changed the title fix(flagsmith): upgrade Java client to 8.1.1 fix(flagsmith)!: upgrade Java client to 8.1.1 Nov 7, 2026
@AllanAlmeida

Copy link
Copy Markdown
Author

Thanks for the review, @khvn26! I've updated the PR title and added the exact breaking changes section you provided.

The previous CI run expired while awaiting approval; no test jobs ran. I can close and reopen the PR to trigger a fresh run. Could you approve the workflow once it's pending and take another look at the updated PR?

Thank you!

@khvn26 khvn26 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.

LGTM

(FYI @matthewelwell)

Resolve the Flagsmith POM conflict by retaining the PR's OkHttp JVM and MockWebServer 5.0.0 alignment with Flagsmith 8.1.1.

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.

[Flagsmith] Bump flagsmith-java-client from 7.4.3 to 8.x

4 participants