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 evaluation details to finally hook #1087

Merged
merged 5 commits into from
Dec 12, 2024
Merged

Conversation

beeme1mr
Copy link
Member

@beeme1mr beeme1mr commented Nov 21, 2024

This PR

  • adds evaluation details to the finally stage in hooks.

Notes

This breaks the signature of the finally stages based on this spec enhancement. It is not considered a breaking change to the SDK because hooks are marked as experimental in the spec, and the change has no impact on known hooks.

The noteworthy change to the interface is:

- finally?(hookContext: Readonly<HookContext<T>>, hookHints?: HookHints): HooksReturn;
+ finally?(hookContext: Readonly<HookContext<T>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn;

Follow-up Tasks

  • Update the JS contribs repo

Signed-off-by: Michael Beemer <[email protected]>
@beeme1mr beeme1mr marked this pull request as ready for review December 9, 2024 14:38
@beeme1mr beeme1mr requested a review from a team as a code owner December 9, 2024 14:38
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.

The change looks good to me!
I am with @toddbaert regarding the IIFEs, and I could live with duplicated lines or mutations.

@toddbaert toddbaert self-requested a review December 11, 2024 20:14
@beeme1mr beeme1mr linked an issue Dec 11, 2024 that may be closed by this pull request
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.

Yes, looks good @beeme1mr :)

@beeme1mr beeme1mr added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit 2135254 Dec 12, 2024
8 checks passed
@beeme1mr beeme1mr deleted the expand-finally-hook-stage branch December 12, 2024 13:50
github-merge-queue bot pushed a commit that referenced this pull request Dec 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.6.0](core-v1.5.0...core-v1.6.0)
(2024-12-12)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([#1087](#1087))
([2135254](2135254))

### ✨ New Features

* add evaluation details to finally hook
([#1087](#1087))
([2135254](2135254))


### 🔄 Refactoring

* improve track interface for providers
([#1100](#1100))
([5e5b160](5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
beeme1mr added a commit that referenced this pull request Dec 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.4.0](web-sdk-v1.3.2...web-sdk-v1.4.0)
(2024-12-18)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([#1087](#1087))
([2135254](2135254))

### ✨ New Features

* add evaluation details to finally hook
([#1087](#1087))
([2135254](2135254))


### 📚 Documentation

* fix comment in README for Hook’s after method
([#1102](#1102))
([ba8d1ae](ba8d1ae))


### 🔄 Refactoring

* improve track interface for providers
([#1100](#1100))
([5e5b160](5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
beeme1mr added a commit that referenced this pull request Dec 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.17.0](server-sdk-v1.16.2...server-sdk-v1.17.0)
(2024-12-18)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([#1087](#1087))
([2135254](2135254))

### ✨ New Features

* add evaluation details to finally hook
([#1087](#1087))
([2135254](2135254))


### 📚 Documentation

* fix comment in README for Hook’s after method
([#1103](#1103))
([e335615](e335615))


### 🔄 Refactoring

* improve track interface for providers
([#1100](#1100))
([5e5b160](5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
@beeme1mr beeme1mr mentioned this pull request Dec 19, 2024
kevinmlong pushed a commit to kevinmlong/openfeature-js-sdk that referenced this pull request Dec 21, 2024
## This PR

- adds evaluation details to the `finally` stage in hooks.

### Notes

This breaks the signature of the `finally` stages based on [this spec
enhancement](open-feature/spec#280). It is
**not** considered a breaking change to the SDK because hooks are marked
as experimental in the spec, and the change has no impact on known
hooks.

The noteworthy change to the interface is:

```diff
- finally?(hookContext: Readonly<HookContext<T>>, hookHints?: HookHints): HooksReturn;
+ finally?(hookContext: Readonly<HookContext<T>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn;
```

### Follow-up Tasks

- Update the JS contribs repo

---------

Signed-off-by: Michael Beemer <[email protected]>
kevinmlong pushed a commit to kevinmlong/openfeature-js-sdk that referenced this pull request Dec 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.6.0](open-feature/js-sdk@core-v1.5.0...core-v1.6.0)
(2024-12-12)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### ✨ New Features

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))


### 🔄 Refactoring

* improve track interface for providers
([open-feature#1100](open-feature#1100))
([5e5b160](open-feature@5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
kevinmlong pushed a commit to kevinmlong/openfeature-js-sdk that referenced this pull request Dec 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.4.0](open-feature/js-sdk@web-sdk-v1.3.2...web-sdk-v1.4.0)
(2024-12-18)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### ✨ New Features

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))


### 📚 Documentation

* fix comment in README for Hook’s after method
([open-feature#1102](open-feature#1102))
([ba8d1ae](open-feature@ba8d1ae))


### 🔄 Refactoring

* improve track interface for providers
([open-feature#1100](open-feature#1100))
([5e5b160](open-feature@5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
kevinmlong pushed a commit to kevinmlong/openfeature-js-sdk that referenced this pull request Dec 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.17.0](open-feature/js-sdk@server-sdk-v1.16.2...server-sdk-v1.17.0)
(2024-12-18)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### ✨ New Features

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))


### 📚 Documentation

* fix comment in README for Hook’s after method
([open-feature#1103](open-feature#1103))
([e335615](open-feature@e335615))


### 🔄 Refactoring

* improve track interface for providers
([open-feature#1100](open-feature#1100))
([5e5b160](open-feature@5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
wichopy pushed a commit to wichopy/openfeature-js-sdk that referenced this pull request Dec 31, 2024
## This PR

- adds evaluation details to the `finally` stage in hooks.

### Notes

This breaks the signature of the `finally` stages based on [this spec
enhancement](open-feature/spec#280). It is
**not** considered a breaking change to the SDK because hooks are marked
as experimental in the spec, and the change has no impact on known
hooks.

The noteworthy change to the interface is:

```diff
- finally?(hookContext: Readonly<HookContext<T>>, hookHints?: HookHints): HooksReturn;
+ finally?(hookContext: Readonly<HookContext<T>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn;
```

### Follow-up Tasks

- Update the JS contribs repo

---------

Signed-off-by: Michael Beemer <[email protected]>
Signed-off-by: Will Chou <[email protected]>
wichopy pushed a commit to wichopy/openfeature-js-sdk that referenced this pull request Dec 31, 2024
🤖 I have created a release *beep* *boop*
---

##
[1.6.0](open-feature/js-sdk@core-v1.5.0...core-v1.6.0)
(2024-12-12)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### ✨ New Features

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### 🔄 Refactoring

* improve track interface for providers
([open-feature#1100](open-feature#1100))
([5e5b160](open-feature@5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
Signed-off-by: Will Chou <[email protected]>
wichopy pushed a commit to wichopy/openfeature-js-sdk that referenced this pull request Dec 31, 2024
🤖 I have created a release *beep* *boop*
---

##
[1.4.0](open-feature/js-sdk@web-sdk-v1.3.2...web-sdk-v1.4.0)
(2024-12-18)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### ✨ New Features

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### 📚 Documentation

* fix comment in README for Hook’s after method
([open-feature#1102](open-feature#1102))
([ba8d1ae](open-feature@ba8d1ae))

### 🔄 Refactoring

* improve track interface for providers
([open-feature#1100](open-feature#1100))
([5e5b160](open-feature@5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
Signed-off-by: Will Chou <[email protected]>
wichopy pushed a commit to wichopy/openfeature-js-sdk that referenced this pull request Dec 31, 2024
🤖 I have created a release *beep* *boop*
---

##
[1.17.0](open-feature/js-sdk@server-sdk-v1.16.2...server-sdk-v1.17.0)
(2024-12-18)

### ⚠ BREAKING CHANGES

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### ✨ New Features

* add evaluation details to finally hook
([open-feature#1087](open-feature#1087))
([2135254](open-feature@2135254))

### 📚 Documentation

* fix comment in README for Hook’s after method
([open-feature#1103](open-feature#1103))
([e335615](open-feature@e335615))

### 🔄 Refactoring

* improve track interface for providers
([open-feature#1100](open-feature#1100))
([5e5b160](open-feature@5e5b160))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
Signed-off-by: Will Chou <[email protected]>
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.

Add evaluation details to finally hook stage
4 participants