Commit Graph

65 Commits

Author SHA1 Message Date
Todd Baert 65728e6975
feat: stabilize - evaluation, providers, harden - hooks, events, context (#314)
This PR: 

* stabilizes evaluation API
* stabilizes providers
* hardens hooks, events and context
* hardens all "static context" (client-side) points

This is a pretty substantial step.
`stable` means that we have no more leeway at all in SDKs - **any
breaking changes to the parts of the SDK implementing stable APIs means
a new major version of the SDK is required, without exception**.

I've also opted to "harden" the `static context paradigm` since we have
numerous client implementations in the wild, in particular React and
Angular, but also Android. There could still be breaking changes here
but the bar is higher. I think this is how we're acting already with
regards to these APIs, in all honesty.

I did not promote the [context
propagation](https://openfeature.dev/specification/sections/evaluation-context#33-context-propagation)
sub-section, or the new tracking section - these are _relatively_ new,
though I'm open to opinions on hardening these further.

Potential blockers:

- https://github.com/open-feature/go-sdk/issues/389
- https://github.com/open-feature/spec/issues/270

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2025-09-16 09:47:35 -04:00
Michael Beemer c4babd3051
docs: clarify evaluation context in hook requirements (#330)
## This PR

- clarify evaluation context in hook requirements

### Related Issues

Fixes #328

### Notes

I added the clarification in the non-normative section. Hopefully, this
addresses the ambiguity around what we mean by `evaluation context`.

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-08-04 15:46:28 -04:00
Michael Beemer baec39b3fe
chore: address markdown lint issues (#327)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-07-21 14:10:01 -04:00
Todd Baert 2d4b27b116
feat: add point 1.6.2, 2.5.3 about shutdown details (#323)
This is a change that I suspect will have little practical impact for
most users, but helps disambiguate some behavior that recently caused
[issues](https://github.com/open-feature/go-sdk/issues/397) and
[confusion](https://github.com/open-feature/go-sdk/pull/400/files#r2191214490).

This is only one means of addressing this concern, so please don't
hesitate to put forward alternative proposals.

"Idempotent" may not be exactly the right word here, since it's only
idempotent within the scope of one execution of the life-cycle, so I'm
open to copy changes here as well.

# EDIT

⚠️ I've substantially changed this PR based on feedback, and
dismissed all approvals:

As @erka and others have pointed out, practically, `shutdown` has been
used for more than just cleaning up providers, it's also used frequently
to "reset" the API for testing purposes. I think this is a valid
use-case and I don't see any reason why it can't be added to what (at
least my understanding of) the original intent of the function was... so
I've changed 1.6.2 to say that the `shutdown` now also resets the state
of the API fully (removes hooks, providers, event handlers, etc) from
the API.

As @chrfwow noted (and I was concerned about as well) guaranteeing that
`shutdown` is not called while a provider is still starting up will be
tricky to implement. Instead I've changed 1.6.1 to say we will
unconditionally run shutdown on all providers, and also added a
recommendation that providers handle this gracefully in the provider
spec.

@sahidvelji I've also added a pre-amble about shutdown in general as you
requested.

@lukas-reining @erka @beeme1mr @sahidvelji @chrfwow  please re-review.

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Sahid Velji <sahidvelji@gmail.com>
2025-07-16 09:25:26 -04:00
Todd Baert 1965aae810
fix: correct shutdown points after status removal (#317)
This is a minor point of clarification with no material changes.

When we removed `status` from the providers, we didn't migrate this
point to the evaluation API, as @fabriziodemaria pointed out
[here](https://github.com/open-feature/spec/issues/270).

Fixes: https://github.com/open-feature/spec/issues/270

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2025-06-23 13:10:32 -04:00
Todd Baert 42340bb9f5
fix: clarify hook ordering (#315)
This clarifies some ambiguity in hook execution order, mentioned in
https://github.com/open-feature/spec/issues/164:

> The issue here is that the overall hook execution order would vary if
any of these hooks have more than one entry. For example:
> 
> ```
> API = [A, B]
> Client = [C, D]
> Invocation = [E, F]
> Provider = [G, H]
> 
> # `before` list
> before_hooks = API + Client + Invocation + Provider
> 
> # spreading directly (like Python)
> list1 = Provider + Invocation + Client + API
> # results in [G, H, E, F, C, D, A, B]
> 
> # reversing the before list (like JavaScript)
> list2 = before_hooks[:]
> list2.reverse()
> # results in [H, G, F, E, D, C, B, A]
> ```

This change makes clear that `[H, G, F, E, D, C, B, A]` is the correct
answer here, which is the more intuitive choice, in my opinion.

This is also one of the few (only?) normative spec points that isn't a
single sentence, but instead has point-form clauses, so I've also
attempted to fix that.

I've work-shopped this with a few people and they interpreted it
correctly, though admittedly, the term "stack-wise" is doing a lot of
work here. I'm hopeful that our audience is familiar enough with that
sort of term that the intent is clear.

I believe there's a few SDKs where this is incorrectly implemented, I'll
audit those and create issues if this is merged. I don't expect that
such an implementation change will significantly impact anyone.

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2025-06-11 12:11:23 -04:00
Sahid Velji cbfa0a9a78
docs: explicitly mark the Hooks section experimental (#312)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

Even though the README says that no explicit status implies experimental
status, I think we should explicitly mark the Hooks section experimental
to align with the other sections.

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->



### Notes
<!-- any additional notes for this PR -->

### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->

Signed-off-by: Sahid Velji <sahidvelji@gmail.com>
2025-06-09 12:42:46 -04:00
Yoneo Arai bb2dc2ce32
Fix header for requirements (#311)
Signed-off-by: Yoneo Arai <yoneo.arai@split.io>
2025-06-05 12:15:57 -04:00
Sahid Velji f0148060e6
docs: fix typos (#310)
Signed-off-by: Sahid Velji <sahid.velji@capitalone.com>
2025-05-23 13:05:35 -04:00
Ryan Lamb d27e000b6c
fix: Broaden definition of hook data value types. (#307)
## This PR
Loosens the value definition for hook data.

In the example within the spec, and within the implementation in the
dotnet-sdk, the intent was to allow any type of data. For example
creating an open telemetry span in before, storing it hook data, and
ending it in after.

### Notes
Related to: https://github.com/open-feature/dotnet-sdk/pull/387

---------

Signed-off-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
2025-04-24 18:57:14 -04:00
alexandraoberaigner 27e4461b45
fix(docs): change tracking code example to use proper java syntax (#299)
## This PR
just fixes the java syntax in the providers tracking code example

Signed-off-by: Alexandra Oberaigner <alexandra.oberaigner@dynatrace.com>
2025-03-24 19:52:34 -04:00
Ryan Lamb c287b5844a
feat: Add hook-data concept for hooks. (#273)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

Add support for the hook-data concept for hooks. Hook-data allows for
per-evaluation data to be propagated between hooks.

This is especially useful for analytics purposes where you may want to
measure things that happen between stages, or you want to do something
like create a span in one stage and close it in another.

This concept is similar to the `series data` concept for LaunchDarkly
hooks.
https://github.com/launchdarkly/open-sdk-specs/tree/main/specs/HOOK-hooks#evaluationseriesdata

Unlike `series data` the data in this approach is mutable. This is
because the `before` stage already has a return value. We could
workaround this by specifying a return structure, but it maybe seems
more complex. The data is only passed to a specific hook instance, so
mutability is not of great concern.

Some functional languages may still need to use an immutable with return
values approach.

I can create an OFEP if we think this merits discussion prior to
proposal.

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->
Related discussion in a PR comment.

https://github.com/open-feature/java-sdk/pull/1049#discussion_r1718895742

---------

Signed-off-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2025-01-15 09:29:09 -05:00
Michael Beemer 776ee1f396
feat!: add evaluation details to finally hook (#280)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-12-06 15:46:14 +00:00
Roman Dmytrenko 3c737a6e86
chore: use html entity code for asterisk in mermaid diagram (#278)
Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
2024-11-04 14:02:09 -05:00
Todd Baert cd99c3560a
feat: tracking (#268)
Adds tracking

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Ron Cohen <cohen1@gmail.com>
Co-authored-by: Robert Kozikowski <r.kozikowski@gmail.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Nicklas Lundin <nicklaslundin@gmail.com>
2024-10-07 13:46:48 -04:00
Todd Baert 807c0d2c8d
chore: replace some pngs with mermaid (#272)
Just replaces some PNGs with mermaid.

This is nice because they can change color for the website, and they are
more rigorous and maintainable (we already use mermaid in the spec).

old:


![image](https://github.com/user-attachments/assets/de15b19b-aa3b-41b7-a264-8c64897de1e1)

new: 

```mermaid
flowchart LR
    A[Application] --> API(Evaluation API)
    API --> P[Provider]
    P --> FMS[(Flag Management System)]
```


![image](https://github.com/user-attachments/assets/f90853f9-7211-4c1a-a10a-e66aeb21b501)

```mermaid
flowchart LR
    B(('Before' stage)) ---> FE[Flag Evaluation]
    B -..->|Error| E
    FE ---> A(('After' stage))
    FE -..->|Error| E(('Error' stage))
    A ---> F(('Finally' stage))
    E -..-> F
```

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-09-24 16:30:22 -04:00
Todd Baert bcb8cf1638
feat: logging requirements and logging hook (#269)
As discussed in recent meetings, we've had complaints about this from
multiple sources. This PR adds a stipulation that no logging is done by
the SDK during flag evaluation. It also defines a very simple `logging
hook` concept as an included utility. These should be very simple to
write and will provide all the needed logging but give authors more
control than built in log statements. It will also be a very nice intro
to the hooks concept for users.

Here's the Java implementation:
https://github.com/open-feature/java-sdk/pull/1084

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-09-04 07:40:06 -04:00
Todd Baert d46e6dce67
feat: tracking (#260)
- Adds section 6: tracking
  - no normative sections
  - overview
  - goals/non-goals (temporary)
  
This is not final! Please review goals/non-goals especially, and add any
questions you might have.

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Nicklas Lundin <nicklaslundin@gmail.com>
Co-authored-by: Weyert de Boer <weyert@gmail.com>
2024-06-12 09:57:32 -04:00
Michael Beemer 8c4d67b550
Add hard line breaks to GitHub notes (#253)
## This PR

- adds hard new lines to GitHub notes

### Notes

GitHub does some magic behind the scenes that isn't part of the markdown
standard. This causes some issues on our doc site. Explicitly adding a
hard line break using double space helps us avoid this issue.

### Follow-up Tasks

Update the docs to include this change.

---------

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-03-25 10:36:13 -04:00
Todd Baert 5f262bdd12
fix: use jsx syntax for legend color (#251)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-03-11 12:35:50 -04:00
Todd Baert 37cf68b0d6
chore: clarify event/domain scoping, lifecycle (#248)
Adding some additional non-normative text to clarify a few things at the
prompt of @federicobond .

The meaning and justification should be self-evident, and if it's not I
did a bad job. 😅

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-03-01 09:10:34 -05:00
Todd Baert 31da456d95
fix: minor corrections around FATAL state (#247)
No substantial changes here, just editorial improvements and
corrections.

When implementing https://github.com/open-feature/spec/pull/241, I
noticed a few oversights (see comments).

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-02-22 15:26:10 -05:00
Todd Baert ae286cf519
feat: internal provider state, new client events (#241)
* moves provider state into SDK (SDK now maintains provider
state/lifecycle; provider interface is now "stateless")
* refine semantics around client state when context is
pending/reconciled by using new events/states, instead of STALE
* add PROVIDER_FATAL error code
* add PROVIDER_RECONCILING event (client only)
* add RECONCILING provider status status (client only)

Resolves: https://github.com/open-feature/spec/issues/238
---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
2024-02-21 19:58:26 -05:00
Max VelDink 2c36abdc54
docs: add language-specific initialize naming (#244)
Signed-off-by: Max VelDink <maxveldink@gmail.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2024-02-09 22:41:25 +01:00
Lukas Reining 1889aa799a
feat: context propagation (#227)
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
2024-02-07 15:25:06 +01:00
Todd Baert ffd555254a
fix: language-neutral verbiage for set-and-wait (#242)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-02-06 15:20:24 -05:00
Michael Beemer a0c79d7e00
docs: remove extra backtick character
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-01-31 15:22:24 -05:00
Michael Beemer afe1c7ea72
feat: add domain as an openfeature concept (#229)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-01-24 08:49:14 -05:00
Todd Baert c75eb75523
chore: move 1.1.8 content to 1.1.2.4 (#225)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-12-15 10:28:23 -05:00
Bill Lynch 262da8f7cf
feat: emit events on context change (client-only) (#200)
Signed-off-by: BillLynch <llynch.bill@gmail.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
2023-12-13 16:34:01 -05:00
Michael Beemer 5ed6c0cc08
define how context can be managed for named provider using static context paradigm (#221)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2023-12-08 13:02:20 -05:00
Michael Beemer c4b66e4f39
fix: invalid links detected by Docusaurus (#222)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2023-12-05 12:51:37 -05:00
Todd Baert 73922b2efb
feat: NOT_READY after provider shutdown (#216)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-11-28 12:14:19 -05:00
Todd Baert 2973c53f0f
fix: add dynamic-context condition to 4.1.4 (#217)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-11-21 09:29:44 -05:00
Federico Bond 814e332c6e
fix: add stale state to provider state diagram (#212)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-10-25 12:46:24 -04:00
Todd Baert d0a87da15f
chore: clarify eval details funcs/structs (#209)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-09-26 09:19:11 -04:00
Todd Baert e2eb2b48c1
fix: broken link, outdated link (#208)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-09-12 10:54:24 -04:00
Thomas Poignant 4b21642564
feat: blocking setProvider (#201)
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Signed-off-by: Thomas Poignant <thomas.poignant@gmail.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2023-08-15 16:39:09 +00:00
Todd Baert 8e8c344796
feat: STALE state, run handlers for current state immediately, provider name (#196)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms>
2023-08-15 10:53:01 -04:00
Todd Baert 007502bb37
feat!: add static/dynamic context (#171)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Skye Gill <gill.skye95@gmail.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Co-authored-by: Pete Hodgson <github@thepete.net>
Co-authored-by: Jonathan Norris <jonathan@taplytics.com>
Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
2023-07-21 12:54:12 -04:00
Todd Baert 77e0b9c69a
fix: various clarifications (#193)
* loosen shutdown requirements to support things like go ctx
* clarify how to handle init/shutdown of providers bound to multiple names
* clarify that authors can await the READY event during init

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-06-02 15:38:55 -04:00
Todd Baert 9b86728f57
fix: broken anchor links (#188)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2023-05-18 12:41:07 -04:00
Todd Baert bf9e45b1d5
feat: add events (#182)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms>
Co-authored-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Co-authored-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Co-authored-by: Tom Carrio <tom@carrio.dev>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Ben Rometsch <benrometsch@gmail.com>
Co-authored-by: Pete Hodgson <git@thepete.net>
2023-05-15 09:02:39 -04:00
Todd Baert a4ffec3d44
feat: initialization and shutdown (#179)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Weyert de Boer <weyert@gmail.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms>
Co-authored-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Jonathan Norris <jonathan@taplytics.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Co-authored-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
2023-05-08 16:13:36 -04:00
Justin Abrahms 4cf8229d23
Spec change for named client -> provider mappings (#183)
Signed-off-by: Justin Abrahms <justin@abrah.ms>
2023-05-02 21:40:54 -07:00
Pete Hodgson 74c373e089
OFEP-007: Surfacing flag metadata (#169)
Signed-off-by: Pete Hodgson <github@thepete.net>
2023-01-23 14:57:03 -05:00
Todd Baert 7ed7442c40
fix: links and link checks (#172)
Signed-off-by: Todd Baert <toddbaert@gmail.com>
2023-01-12 12:04:32 -05:00
Skye Gill 928d513667
docs: include STATIC and CACHED in provider reasons (#166)
Signed-off-by: Skye Gill <gill.skye95@gmail.com>
2022-12-19 16:22:55 -05:00
Nikita Bishonen 136c26af80
Fix usage of wrong type instead of resolution details (#161)
Evaluation details and flag evaluation names usages for resolution
details type were fixed.

Signed-off-by: Nikita Bishonen <git@bshn.rs>
2022-12-02 10:06:30 -05:00
Todd Baert c1792369e3
chore: section clarity, harden API, providers (#149)
**Marking Evaluation API and Providers `hardening`** and a few
non-functional changes here that improve structure.

specifically:

- explicitly mark and number all sections
- section headings have consistent numbering (provider section numbering
was different than the other docs)
- removed "draft" language 

An alternative to marking all of `provider` and `evaluation API` as
hardening would be just marking all existing sections therein as
hardening, which might be better since we'd have to do that anyway if we
added a new experimental section.

see: https://github.com/open-feature/spec/issues/146 for more on release
goals.

Signed-off-by: Todd Baert <toddbaert@gmail.com>
2022-10-17 11:00:13 -04:00