From 28bfbdb2775384e8b120fff42f110a1c2cc8a5e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 19:54:01 +0000 Subject: [PATCH 1/3] deps: update dependency flagsmith/sdk-spec to v0.7.0 --- .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 7ad90ac..68d5753 100644 --- a/.github/workflows/sdk-spec.yml +++ b/.github/workflows/sdk-spec.yml @@ -11,7 +11,7 @@ permissions: jobs: sdk-spec: # Keep the ref in `uses:` and `spec-ref` in sync. - uses: Flagsmith/sdk-spec/.github/workflows/run-spec.yml@v0.3.0 + uses: Flagsmith/sdk-spec/.github/workflows/run-spec.yml@v0.7.0 with: - spec-ref: v0.3.0 + spec-ref: v0.7.0 language: java From 0c48af8fcd55e8afd11b73947d351a02117e5ef7 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 2/3] test(sdk-spec): Run the experimentation steps against the SDK Spec v0.6.0 adds scenarios for 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. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit f5f3801c929e9fcf0c2bab34a21390f66c20a901) --- sdk-spec/Steps.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/sdk-spec/Steps.java b/sdk-spec/Steps.java index f5d80d4..75572b3 100644 --- a/sdk-spec/Steps.java +++ b/sdk-spec/Steps.java @@ -1,7 +1,9 @@ import com.flagsmith.FlagsmithClient; +import com.flagsmith.config.FlagsmithConfig; 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; @@ -35,6 +37,20 @@ static FlagsmithClient createClient(String environmentKey, String apiUrl) { return FlagsmithClient.newBuilder().setApiKey(environmentKey).withApiUrl(apiUrl).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 { @@ -47,4 +63,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); + } } From 48c35f494c2ddd7d4b6ed7e661613ca7e081c080 Mon Sep 17 00:00:00 2001 From: Kim Gustyr Date: Fri, 30 Oct 2026 22:57:01 +0100 Subject: [PATCH 3/3] ci: run events SDK spec tests --- .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 ec972bb..852f3ab 100644 --- a/.github/workflows/sdk-spec.yml +++ b/.github/workflows/sdk-spec.yml @@ -15,4 +15,4 @@ jobs: with: spec-ref: v0.7.0 language: java - tags: core or local-evaluation + tags: core or local-evaluation or events