Skip to content

Conversation

@jescriba
Copy link
Contributor

@jescriba jescriba commented Aug 22, 2025

This PR

Questions

  • According to the spec, the event metadata value is more limited than allowed feature flag value types (like object and date are unavailable). If I wanted to subscribe to a feature flag's configuration - would I be expected to just query all the changed flags emitted from a configuration_changed event? Something like:
switch providerEvent {
case .configurationChanged(let details):
    for details?.flags_changed.each { |flag| in 
        client.getValue(key: flag, defaultValue: flagDefault) 
        // Use the new flag value for the caller
    }
}

Or could the event metadata support flag values something like:

switch providerEvent {
case .configurationChanged(let details):
    for details?.flags_changed.each { |flag| in 
        details.eventMetadata[flag] // UpdatedFlagValue
    }
}

Breaking Changes

  • ProviderEvent now contains an associated value for ProviderEventDetails. This payload includes the error information now. So consumers of this API - will need to pull the errorCode and message from the ProviderEventDetails struct

New to this repo and spec so open to any feedback 😅

@jescriba jescriba changed the title Feat/add provider event details Feat: add provider event details Aug 22, 2025
@jescriba jescriba changed the title Feat: add provider event details Feat : add provider event details Aug 22, 2025
Signed-off-by: jescriba <joshua.escribano@includedhealth.com>
Signed-off-by: jescriba <joshua.escribano@includedhealth.com>
@jescriba jescriba force-pushed the feat/add-provider-event-details branch from 66beea1 to 6a7d7bd Compare August 22, 2025 23:15
@jescriba jescriba changed the title Feat : add provider event details feat : add provider event details Aug 22, 2025
@jescriba jescriba changed the title feat : add provider event details feat: add provider event details Aug 22, 2025
@jescriba jescriba mentioned this pull request Aug 25, 2025
Signed-off-by: jescriba <joshua.escribano@includedhealth.com>
@jescriba jescriba force-pushed the feat/add-provider-event-details branch from 3820c1c to cb48401 Compare September 8, 2025 18:16
@beeme1mr beeme1mr changed the title feat: add provider event details feat!: add provider event details Sep 8, 2025
@beeme1mr
Copy link
Member

beeme1mr commented Sep 8, 2025

Hey @jescriba, I've marked this as breaking by adding a ! to the PR title.

@beeme1mr
Copy link
Member

beeme1mr commented Sep 8, 2025

/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 introduces a significant and beneficial breaking change by adding ProviderEventDetails to ProviderEvent, aligning the Swift SDK more closely with the OpenFeature specification. The refactoring to consolidate FlagMetadataValue and EventMetadataValue into a single MetadataValue is an excellent improvement for maintainability and code reuse. The addition of a MockProvider and new tests significantly enhances the test suite's quality. I've provided a few suggestions to further improve the new tests and a minor refactoring suggestion for better code style. Overall, this is a well-executed and valuable contribution.

Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

The change looks good and better aligns with the spec.

jescriba and others added 4 commits September 8, 2025 12:03
Signed-off-by: jescriba <joshua.escribano@includedhealth.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Joshua E. <escribirajoshua@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Joshua E. <escribirajoshua@gmail.com>
Signed-off-by: jescriba <joshua.escribano@includedhealth.com>
@jescriba jescriba force-pushed the feat/add-provider-event-details branch from 4931072 to 0b4dd49 Compare September 8, 2025 22:07
@jescriba
Copy link
Contributor Author

jescriba commented Sep 8, 2025

Gemini comments were good so I updated the PR accordingly 👍

Copy link
Contributor

@fabriziodemaria fabriziodemaria left a comment

Choose a reason for hiding this comment

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

I think it would be nice to add the Provider Name to comply to the spec 100%. But this is still a step in the right direction, so I am happy to merge this to begin with

@fabriziodemaria
Copy link
Contributor

the event metadata value is more limited than allowed feature flag value types

I am probably not the right person to comment on the specifications, but I assumed that the Metadata is not meant to be mapped to a Flag's value: in this sense, the types compatibility is also, perhaps, not mandatory or expected.
Albeit if a customer wanted to report the value there, I agree this is currently a limitation

@jescriba
Copy link
Contributor Author

jescriba commented Sep 11, 2025

Addressed comments 👍 Let me know if there's any remaining changes I should make to land this work

@beeme1mr beeme1mr merged commit 56b477e into open-feature:main Sep 11, 2025
10 checks passed
@beeme1mr
Copy link
Member

Hey @jescriba, thanks for the contribution. I've merged the PR and the changes will be included in the next release.

Would you be interested in joining the org? It doesn't come with any obligations but is the first step in the contributing ladder. It also allows us to include you in reviews and @ mention you in comments.

fabriziodemaria pushed a commit that referenced this pull request Nov 12, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.5.0](0.4.0...0.5.0)
(2025-11-12)


### ⚠ BREAKING CHANGES

* add provider event details
([#77](#77))

### 🐛 Bug Fixes

* Prevent race condition on updateContext
([#84](#84))
([dd23929](dd23929))


### ✨ New Features

* add multiprovider
([#78](#78))
([869b90a](869b90a))
* add provider event details
([#77](#77))
([56b477e](56b477e))
* add Tracking API
([#81](#81))
([c14b0cd](c14b0cd))
* Allow FlagEvaluationDetails to be a public API
([#79](#79))
([0b07a8f](0b07a8f))


### 📚 Documentation

* Update docs with ImmutableContext
([#72](#72))
([28ccd3e](28ccd3e))

---
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.

3 participants