Skip to content

Conversation

PenguinDan
Copy link
Contributor

@PenguinDan PenguinDan commented Aug 26, 2025

This PR

The Open Feature spec outlines Event data emitted with ProviderEvent: https://openfeature.dev/specification/types#provider-event-details

A port of the code from open-feature/swift-sdk#77

Breaking Changes

OpenFeatureProviderEvents now contains an associated value for EventDetails. This payload includes additional information required for all event emits

Related Issues

Fixes #107

Notes

Follow-up Tasks

How to test

Signed-off-by: penguindan <daniel.seunkim@gmail.com>
@PenguinDan PenguinDan marked this pull request as ready for review August 26, 2025 00:14
@beeme1mr
Copy link
Member

@gemini /review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates ProviderEvents to align with the Open Feature specification, which is a significant and positive change. The introduction of EventDetails as a payload for events makes the eventing system more robust and extensible. The changes are well-implemented, including backward compatibility for the deprecated ProviderError structure. I've found a couple of minor issues: a leftover debug print statement in a test file, and an opportunity to improve the default error message in FlagNotFoundError to avoid confusion when a flag key is not available. Overall, this is a great step forward for the SDK's compliance with the specification.

@nicklasl nicklasl changed the title feat: Update ProviderEvents to match specifications feat!: Update ProviderEvents to match specifications Sep 4, 2025
@nicklasl
Copy link
Member

nicklasl commented Sep 4, 2025

Not super happy about the breaking change here and the reason is mainly that I don't see the big use case of having the event details. Ideally I would not want the SDK user to have to care about what happens in the provider(s) at all.

I would suggest either to make the events objects default to "empty Details" or maybe even optional.

Is there some write up / discussion or some use cases on how the SDK or the SDK users would use these event details?

@PenguinDan
Copy link
Contributor Author

@nicklasl A use case for the moment on my end is tracking flag changes upon a context update for analytics purposes.

Happy to provide default values, reading the specifications more closely, the language of "MAY" and "SHOULD" make it sound like the EventDetails are optional. With that said, this would be a breaking change regardless due to the update of object to data class, breaking when statements

@PenguinDan PenguinDan changed the title feat!: Update ProviderEvents to match specifications feat: Update ProviderEvents to match specifications Sep 4, 2025
@nicklasl
Copy link
Member

nicklasl commented Sep 5, 2025

this would be a breaking change regardless due to the update of object to data class, breaking when statements

ah, of course! I will hopefully be able to take a closer look soon.

And also, the PR title, if you add a ! after feat/fix/etc, release please would know to treat this as a breaking change when it comes to versioning and changelog modifications.

@PenguinDan
Copy link
Contributor Author

@nicklasl Ah I thought I added a ! myself as a typo, didn't see you updated it. Sounds good!

I need to update the Multi-Provider in this PR also but those changes should be relatively trivial

@PenguinDan PenguinDan changed the title feat: Update ProviderEvents to match specifications feat!: Update ProviderEvents to match specifications Sep 5, 2025
Signed-off-by: penguindan <daniel.seunkim@gmail.com>
Signed-off-by: penguindan <daniel.seunkim@gmail.com>
Signed-off-by: penguindan <daniel.seunkim@gmail.com>
Signed-off-by: penguindan <daniel.seunkim@gmail.com>
Signed-off-by: penguindan <daniel.seunkim@gmail.com>
Copy link
Member

@lukas-reining lukas-reining left a comment

Choose a reason for hiding this comment

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

I get your point regarding the breaking change @nicklasl!
For the use cases also flags changed is something that can be really interesting in some cases.
As far as I can see, there is no way of making this change non-breaking right? I am not a Kotlin expert, but I do not see a way of avoiding the breaking change if we want to include this.

@nicklasl nicklasl self-requested a review September 14, 2025 08:48
Signed-off-by: penguindan <daniel.seunkim@gmail.com>
Copy link
Member

@nicklasl nicklasl left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to fix the suggestions!

Let's remember to add this when merging:
BREAKING CHANGE: OpenFeatureProviderEvents are now data classes and need to be instantiated

@beeme1mr beeme1mr merged commit 483f1bb into open-feature:main Sep 16, 2025
6 checks passed
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.

Missing OpenFeature Events types.

4 participants