Skip to content

Add provider spec - #41

Merged
toddbaert merged 1 commit into
open-feature:mainfrom
toddbaert:spec/provider
May 3, 2022
Merged

toddbaert merged 1 commit into
open-feature:mainfrom
toddbaert:spec/provider

Conversation

@toddbaert

Copy link
Copy Markdown
Member

Added provider spec, with minor associated changes to the existing flag-evaluation spec file.

Comment on lines +158 to +164
> In cases of normal execution, the `evaluation details` structure's `reason` field **MUST** contain the value of the `reason` field in the `flag resolution` structure returned by the configured `provider`.

##### Requirement 1.15

> In cases of normal execution, the `evaluation details` structure's `error code` field **MUST** not be set, or otherwise must contain a null or falsy value.
> In cases of normal execution, the `evaluation details` structure's `error code` field **MUST** contain the value of the `error code` field in the `flag resolution` structure returned by the configured `provider`.

##### Requirement 1.16

> In cases of abnormal execution, the `evaluation details` structure's `error code` field **SHOULD** identify an error occurred during flag evaluation, with possible values `"PROVIDER_NOT_READY"`, `"FLAG_NOT_FOUND"`, `"PARSE_ERROR"`, `"TYPE_MISMATCH"`, or `"GENERAL"`.
> In cases of abnormal execution, the `evaluation details` structure's `error code` field **MUST** identify an error occurred during flag evaluation, having possible values `"PROVIDER_NOT_READY"`, `"FLAG_NOT_FOUND"`, `"PARSE_ERROR"`, `"TYPE_MISMATCH"`, or `"GENERAL"`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some minor changes here. the main idea is that the evaluation layer should basically be reflecting the data/errors coming up from the provider.

Changed 1.16 to a "MUST" because the evaluation layer MUST never throw, so it's up to it to decide on an the error code and populate it, even if the provider fails to.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this preclude a provider from providing an error code that's not in the set specified here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think that needs to be considered. If we want to allow authors to actually be able to write conditional logic around these errors, they need to be rigorously defined in the API (but then we'll lose fidelity mapping them from the underlying SDKs). If we only need errors for debugging, then they can be more free-form. It may merit further discussion.

Comment thread specification/glossary.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/glossary.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/provider/providers.md Resolved
Comment thread specification/glossary.md Resolved
@moredip

moredip commented Apr 28, 2022

Copy link
Copy Markdown
Member

Do we want to specify any semantics around how a provider should handle transient errors on their side. Like if there's a network connectivity issue, should to provider immediately fail, or have a retry/fallback mechanism.

One option is to leave this entirely unspecified and up to each provider. Another would be to give a provider implementer some guidance or suggestions - e.g. make a best effort to handle transient failure, but don't hang evaluation for "a long time" (whatever that means).

Comment thread specification/provider/providers.md Resolved
Comment thread specification/types.md Outdated
- variant (string, optional)

### evaluation options
### Flag Resolution

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

again, Flag Resolution is ambiguously either a verb or a noun. Would Evaluation Result or Evaluation Outcome be better?

@toddbaert toddbaert Apr 28, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

How about ResolutionDetails? It's consistent with EvaluationDetails, and in the context of this type, I don't actually know if the verb/noun confusion is really as problematic. Whether you think of it as a verb or a noun, these are the details associated with it.

I'm going to update it with ResolutionDetails. I'm totally open to changing the term "resolution" entirely. I'd simply like to have a term that denotes solely the aspect of the flag evaluation that the provider does (in opposition to the entire evaluation which involves hooks, the client, etc).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated.

Comment thread specification/types.md Outdated
- variant (string, optional)

### evaluation options
### Flag Resolution

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As I read this I'm a bit confused as to why we have two distinct structures with the only difference being that one has the flag key and one doesn't. I'm sure there's a good reason, but maybe for the sake of the reader we should give the reasoning here too?

@toddbaert toddbaert Apr 28, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's primarily because the Flag Resolution structure is the thing returned from a provider (and completely invisible to the application author, they don't care about providers) while the Evaluation Details is what the client returns in the "Detailed" evaluation methods. It's almost certain that they will diverge further. In fact, in another draft the Evaluation Details also contained a evaluated hooks field that specified all the hooks that had run in the current evaluation (which the provider would know nothing about).

I hope that makes sense. If it doesn't let me know.

I think it's a good point to mention something explaining this, as you say. I'll add something terse and appropriate that conveys this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated.

@toddbaert

Copy link
Copy Markdown
Member Author

Do we want to specify any semantics around how a provider should handle transient errors on their side. Like if there's a network connectivity issue, should to provider immediately fail, or have a retry/fallback mechanism.

One option is to leave this entirely unspecified and up to each provider. Another would be to give a provider implementer some guidance or suggestions - e.g. make a best effort to handle transient failure, but don't hang evaluation for "a long time" (whatever that means).

This might be relevant to the "event" discussion. Most SDKs have readiness events, etc. We could build an events API which might cover both cases.

I think for now, I would err on the side of not defining this until we need to - but I'm not sure. If there's a pressing use-case, we can talk more about it.

@toddbaert

Copy link
Copy Markdown
Member Author

@moredip any additional concerns after my updates to your comments?

I think we have 2 open questions represented here, which I may create other issues for:

I don't think either of these are a blocker for this, but let me know if you disagree.

@moredip

moredip commented May 2, 2022

Copy link
Copy Markdown
Member

@moredip any additional concerns after my updates to your comments?

Nope, I think it's good

@beeme1mr beeme1mr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like the major issues have been addressed now. I think it's time to merge it as is since nothing here is final. Any issues can be handled with a tickets and/or a PR.

Co-authored-by: Justin Abrahms <[email protected]>
Co-authored-by: Pete Hodgson <[email protected]>
Co-authored-by: Steve Arch <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
@toddbaert

Copy link
Copy Markdown
Member Author

Squashed, added co-authors.

@toddbaert
toddbaert merged commit 315c375 into open-feature:main May 3, 2022
@beeme1mr beeme1mr linked an issue May 24, 2022 that may be closed by this pull request
jonathannorris added a commit that referenced this pull request Aug 10, 2026
- js-yaml 3.15.0 -> 3.15.1 (high, alert #41)
- js-yaml 4.3.0 -> 4.3.1 (high, alerts #40, #32)
- linkify-it 5.0.1 -> 5.0.2 (high, alert #33)
- brace-expansion 5.0.5 -> 5.0.9 (high, alert #31)
- markdownlint-cli ^0.49.0 -> ^0.49.1 and node engines >=22.22.2 to pull in patched transitive deps

Signed-off-by: Jonathan Norris <[email protected]>
beeme1mr pushed a commit that referenced this pull request Aug 24, 2026
## Summary

- Resolved 5 open Dependabot security alerts by refreshing
devDependencies and the lockfile so vulnerable transitive packages
resolve to patched versions
- No production code changes; devDependencies, engines field, and
package-lock.json only

## Dependabot Alerts Resolved

| Alert | Package | Severity | Fix |
|-------|---------|----------|-----|
| #41 | `js-yaml` | **high** | Bumped to 3.15.1 (transitive, via
markdown-toc -> gray-matter) |
| #40 | `js-yaml` | **high** | Bumped to 4.3.1 (transitive, via
markdown-link-check -> xmlbuilder2) |
| #33 | `linkify-it` | **high** | Bumped to 5.0.2 (transitive, via
markdownlint-cli -> markdown-it) |
| #32 | `js-yaml` | **high** | Bumped to 4.3.1, resolved alongside alert
#40 |
| #31 | `brace-expansion` | **high** | Bumped to 5.0.9 (transitive, via
markdownlint-cli -> minimatch) |

Also bumped `markdownlint-cli` devDependency to `^0.49.1` and declared
`engines.node >=22.22.2` to keep dev tooling versions explicit and in
sync with the transitive dependency requirements pulled in by the
lockfile refresh.

Verified with `npm audit` (0 vulnerabilities) and by running `make lint`
/ `make markdown-toc` locally, matching CI.

Signed-off-by: Jonathan Norris <[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.

Provider Specification

5 participants