Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for client-side prerequisite events #452

Merged
merged 16 commits into from
Oct 17, 2024

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Oct 15, 2024

This PR updates Relay's client-side evaluation logic to track the top-level prerequisites associated with a flag.

These prerequisites are then passed back in the response as a prerequisites key, allowing client-side SDKs to properly emit prerequisite events.

@cwaldren-ld cwaldren-ld requested a review from a team as a code owner October 15, 2024 17:11
@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-699-client-prereq-events branch from a85bc56 to 992dded Compare October 15, 2024 17:21
@kinyoklion kinyoklion marked this pull request as draft October 15, 2024 17:53
@@ -262,6 +270,15 @@ func evaluateAllShared(w http.ResponseWriter, req *http.Request, sdkKind basicty
}
valueObj.Maybe("debugEventsUntilDate", flag.DebugEventsUntilDate != 0).
Float64(float64(flag.DebugEventsUntilDate))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this to say.. here's the new behavior implemented by the PR.

@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-699-client-prereq-events branch from af67c72 to 3668f83 Compare October 16, 2024 22:15
@@ -32,7 +33,8 @@ func (a *apiHelper) logResult(desc string, err error) error {
return nil
}
addInfo := ""
if gse, ok := err.(ldapi.GenericOpenAPIError); ok {
var gse *ldapi.GenericOpenAPIError
if errors.As(err, &gse) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This little bug (the error is a pointer) was causing response bodies not to be logged.

@@ -0,0 +1,131 @@
//go:build integrationtests
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a whole new builder scheme just for these tests - we need a simple way to create flags via REST API. The existing methods were single-purpose.

@cwaldren-ld cwaldren-ld marked this pull request as ready for review October 17, 2024 00:30
@cwaldren-ld cwaldren-ld merged commit 9dea4b5 into v8 Oct 17, 2024
8 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/sdk-699-client-prereq-events branch October 17, 2024 23:35
cwaldren-ld pushed a commit that referenced this pull request Oct 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[8.10.0](v8.9.6...v8.10.0)
(2024-10-17)


### Features

* add support for client-side prerequisite events
([#452](#452))
([9dea4b5](9dea4b5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants