feat: Add support for hooks.#493
Merged
Merged
Conversation
d441c2d to
5cf0bcd
Compare
Member
Author
|
bugbot review |
kinyoklion
commented
Oct 28, 2025
| extern "C" { | ||
| #endif | ||
|
|
||
| typedef struct p_LDServerSDKEvaluationSeriesContext* LDServerSDKEvaluationSeriesContext; |
Member
Author
There was a problem hiding this comment.
So, there was a mistake with the syntax of the clang-tidy suppression in the base binding implementations. Which result in suppressing all tidy messages.
We are not doing that here, and the result is that these opaque struct definitions were encountering: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html
Which isn't going to be a problem because the compiler isn't going to spontaneously reserve these very specific names.
But to appease it here I have started with p_. This first name isn't used by calling code, but we just want it to not look like it should be used either.
kinyoklion
commented
Oct 28, 2025
keelerm84
approved these changes
Oct 28, 2025
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.
There are two primary aspects to this PR. The first is support for hooks, and the second is support for a Go context like addition to the variation API.
The reason for this addition is that it may not be possible in all environments to automatically get the current span parent using OTEL.
The default context management strategy in OTEL uses thread-local storage, which can cause problems when an async framework is handling multiple requests in a single thread. In that scenario the application manually determines the parent-child relationship (unless they have async aware custom context management).
BEGIN_COMMIT_OVERRIDE
feat: Add support for hooks.
fix: Discard track events when the associated context is invalid.
END_COMMIT_OVERRIDE
Note
Introduce a full hooks system (with hook context) across C++ and C APIs, integrate it into evaluations/tracking, add WithHookContext overloads, drop invalid-context track events, and update build/deps with extensive tests.
hooks::Hook,HookContext,EvaluationSeriesContext/Data(+Builder),TrackSeriesContextandhook_executorfor before/after evaluation and after track.ClientImplvariation/track paths with method names; execute hooks synchronously.Config/ConfigBuilderto acceptstd::shared_ptr<hooks::Hook>list.Trackand all*Variation*overloads acceptinghooks::HookContext.hook.h,hook_context.h,evaluation_series_context.h,evaluation_series_data.h,track_series_context.h.LDServerConfigBuilder_Hooks; bridge viaCHookWrapper.*_WithHookContextfunctions for track and all variation variants.Contextis invalid; log warning.CMakeLists.txt.redis-plus-plusFetchContent tag and disable shallow clone.Written by Cursor Bugbot for commit 4773e9e. This will update automatically on new commits. Configure here.