From ec000bbbbedf6ce9611b06a956d2ab749179e164 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:35:32 +0000 Subject: [PATCH 1/3] deps: update dependency flagsmith/sdk-spec to v0.7.1 --- .github/workflows/sdk-spec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk-spec.yml b/.github/workflows/sdk-spec.yml index ec972bb..f4bfa98 100644 --- a/.github/workflows/sdk-spec.yml +++ b/.github/workflows/sdk-spec.yml @@ -11,8 +11,8 @@ permissions: jobs: sdk-spec: # Keep the ref in `uses:` and `spec-ref` in sync. - uses: Flagsmith/sdk-spec/.github/workflows/run-spec.yml@v0.7.0 + uses: Flagsmith/sdk-spec/.github/workflows/run-spec.yml@v0.7.1 with: - spec-ref: v0.7.0 + spec-ref: v0.7.1 language: java tags: core or local-evaluation From ce412130a4b42984f14e4843bc49e2a35ee4a613 Mon Sep 17 00:00:00 2001 From: "flagsmith-engineering[bot]" <216534828+flagsmith-engineering[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:35:48 +0000 Subject: [PATCH 2/3] ci: Run the SDK spec for this SDK's capabilities Its entry in Flagsmith/sdk-spec's compatibility matrix at v0.7.1: `core or events or local-evaluation`. --- .github/workflows/sdk-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-spec.yml b/.github/workflows/sdk-spec.yml index f4bfa98..a3bae10 100644 --- a/.github/workflows/sdk-spec.yml +++ b/.github/workflows/sdk-spec.yml @@ -15,4 +15,4 @@ jobs: with: spec-ref: v0.7.1 language: java - tags: core or local-evaluation + tags: core or events or local-evaluation From 29cbe7b9b49b9726359324188272600688c59836 Mon Sep 17 00:00:00 2001 From: "flagsmithsmith[bot]" <346993984+flagsmithsmith[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 12:13:19 +0000 Subject: [PATCH 3/3] test(sdk-spec): Run the experimentation steps against the SDK Spec v0.7.1 runs the `@events` scenarios for this SDK: getting an experiment flag, tracking an event and tracking an exposure event, all with events enabled. The SDK already implements these (#226), so the steps file wires each step to FlagsmithClient.getExperimentFlag, trackEvent and trackExposureEvent, and creates the events-enabled client through FlagsmithConfig, next to the local evaluation client. (cherry picked from commit 0c48af8fcd55e8afd11b73947d351a02117e5ef7) Co-Authored-By: Claude Opus 5.5 --- sdk-spec/Steps.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/sdk-spec/Steps.java b/sdk-spec/Steps.java index 74f05c6..01855c8 100644 --- a/sdk-spec/Steps.java +++ b/sdk-spec/Steps.java @@ -3,6 +3,7 @@ import com.flagsmith.exceptions.FlagsmithClientError; import com.flagsmith.models.BaseFlag; import com.flagsmith.models.Flags; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -47,6 +48,20 @@ static FlagsmithClient createClientWithLocalEvaluation(String environmentKey, St .build(); } + // Create the SDK client with events enabled + static FlagsmithClient createClientWithEvents( + String environmentKey, String apiUrl, String eventsUrl) { + return FlagsmithClient.newBuilder() + .setApiKey(environmentKey) + .withConfiguration( + FlagsmithConfig.newBuilder() + .baseUri(apiUrl) + .withEnableEvents(true) + .eventsUri(eventsUrl) + .build()) + .build(); + } + // When the application gets the environment flags static List getEnvironmentFlags(FlagsmithClient flagsmith) throws FlagsmithClientError { @@ -59,4 +74,32 @@ static List getIdentityFlags( throws FlagsmithClientError { return asSpecFlags(flagsmith.getIdentityFlags(identifier, traits)); } + + // When the application gets the experiment flag "{feature}" for identity "{identifier}" with traits: + static List getExperimentFlag( + FlagsmithClient flagsmith, String feature, String identifier, Map traits) + throws FlagsmithClientError { + return Collections.singletonList( + new SpecFlag(flagsmith.getExperimentFlag(feature, identifier, traits))); + } + + // When the application tracks event "{event}" for identity "{identifier}" with value {value} and metadata: + static void trackEvent( + FlagsmithClient flagsmith, + String event, + String identifier, + Object value, + Map metadata) { + flagsmith.trackEvent(event, identifier, value, null, metadata); + } + + // When the application tracks an exposure of feature "{feature}" for identity "{identifier}" with value {value} and metadata: + static void trackExposureEvent( + FlagsmithClient flagsmith, + String feature, + String identifier, + Object value, + Map metadata) { + flagsmith.trackExposureEvent(feature, identifier, value, null, metadata); + } }