Repository navigation
feat: Add server-side event tests for tracking rules, experiments and index events - #643
Merged
Merged
Conversation
… index events A rule with trackEvents or a fallthrough with trackEventsFallthrough must give a full feature event with a reason, and must not affect the other path through the flag. An experiment rollout counts only if the context is in the experiment: not for an untracked bucket, and not for a context kind the context does not have. A tracked flag with debugging enabled gives both a feature event and a debug event. Index events for anonymous contexts are not redacted, and a context already seen in an earlier payload gets no new index event. Generated-by: termag
kinyoklion
marked this pull request as ready for review
November 16, 2026 21:14
There was a problem hiding this comment.
Risk: low. Approved. Cursor Bugbot passed with no findings requiring human review, Cursor Security Agent was not present, and this PR only adds server-side event tests in the harness, which stays within the low-risk approval threshold.
Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver
kinyoklion
pushed a commit
that referenced
this pull request
Nov 16, 2026
🤖 I have created a release *beep* *boop* --- ## [3.2.0-alpha.18](v3.2.0-alpha.17...v3.2.0-alpha.18) (2026-11-16) ### Features * Add evaluation tests that send flag JSON exactly as written ([#642](#642)) ([02262ea](02262ea)) * Add server-side event tests for tracking rules, experiments and index events ([#643](#643)) ([8270594](8270594)) * Add tests that a listener is not notified after it is unregistered ([#641](#641)) ([552d6f1](552d6f1)) * Test that an override file with a deleted entry fails the reload ([#599](#599)) ([d3c185a](d3c185a)) ### Bug Fixes * Check the order of client-side prerequisite feature events ([#634](#634)) ([9676858](9676858)) * Decode characters outside the Basic Multilingual Plane in test service responses ([#631](#631)) ([960fb18](960fb18)) * Give the events-disabled tests an events URI so that they detect sent events ([#639](#639)) ([af47688](af47688)) * Infer typed defaults from v3 server-side flag data ([#640](#640)) ([fbe1fdd](fbe1fdd)) * Make the sampling, identify and PHP header event tests check what they are named for ([#633](#633)) ([a6bc5c1](a6bc5c1)) * Make the wrapper and tags header-absence checks detect a sent header ([#632](#632)) ([61d1024](61d1024)) * Name localhost in the subjectAltName of the harness TLS certificate ([#630](#630)) ([b0c3778](b0c3778)) * Request the detail in the beforeEvaluation hook tests with detail ([#635](#635)) ([c551622](c551622)) * Run the all-flags error reason test only on SDKs that support reasons ([#636](#636)) ([7ed439e](7ed439e)) * Send only the intended flags in the large payload polling test ([#637](#637)) ([0102985](0102985)) * Send the initial retry delay with the default streaming synchronizer ([#638](#638)) ([afd82c3](afd82c3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Bumps the SDK test harness to **3.2.0-alpha.18** across `.release-please-manifest.json`, `main.go` (`versionString`), and a new **CHANGELOG** section for 2026-11-16. > > The changelog records what ships in this alpha: **new contract tests** for exact flag JSON in evaluation, server-side tracking/experiment/index events, listener behavior after unregister, and override-file reload failures; plus **test-harness fixes** around BMP decoding, TLS `localhost` SAN, typed defaults from v3 flag data, event/header/sampling assertions, streaming retry delay, polling payload scope, and capability-guarded reason tests. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1486c4c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Ports #629 from
v2tov3. New server-side event tests for rules and fallthroughs with event tracking, experiment rollouts that do not count, index events for anonymous contexts and for contexts seen in an earlier payload, and a tracked flag that is also debugged.Testing: on the v3 suite, every new test passes on Go, Java, Node, Python (sync and async), Ruby, .NET, Rust (rustls and OpenSSL) and C++ (both network backends), and the rest of the event tests give the same results as before.
Opened from termag
Note
Overview
Expands the v3 SDK test harness with server-side analytics event coverage ported from v2, asserting how SDKs emit feature, debug, and index events under tracking and experimentation rules.
Experimentation / tracking (
server_side_events_experimentation.go): new table-driven cases verify thattrackEventson a matching rule ortrackEventsFallthroughon fallthrough produce a full feature event with an evaluation reason even when the flag is not globally tracked and the app did not request detail. Negative cases confirm no full feature event when only a non-matching rule is tracked, when the fallthrough is tracked but a rule matches, when an experiment bucket is untracked, or when the rollout’s context kind does not match—plus PHP-specific expectations where every evaluation still sends a feature event but reasons appear only when tracked.Index events (
server_side_events_index.go): checks that anonymous contexts appear in index events without attribute redaction (redaction remains a feature-event concern), and that a context already indexed in a prior payload does not get a second index event on later evaluations/custom events.Debug + track (
server_side_events_eval.go): when a flag has bothTrackEventsand activeDebugEventsUntilDate, a single flush must include index, feature, debug, and summary events together (usesldtimefor debug window).Reviewed by Cursor Bugbot for commit 5976a3d. Bugbot is set up for automated code reviews on this repo. Configure here.