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: support metadata in errors in OFREP #1203

Merged
merged 7 commits into from
Feb 13, 2025
Merged

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Feb 5, 2025

  • uses flag-set metadata to return metadata in OFREP errors (best effort)
  • removes some duplicated enums from OFREP
  • sets @openfeature/ofrep-core package to v1.0.0

@toddbaert toddbaert requested a review from a team as a code owner February 5, 2025 20:41
@toddbaert toddbaert marked this pull request as draft February 5, 2025 20:41
@toddbaert toddbaert changed the title wip feat: support metadata in OFREP (DRAFT) Feb 5, 2025
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch from 66fe4f0 to 8a2a9c3 Compare February 6, 2025 00:12
@toddbaert toddbaert changed the title feat: support metadata in OFREP (DRAFT) feat: support metadata in errors in OFREP Feb 6, 2025
@toddbaert toddbaert requested a review from beeme1mr February 6, 2025 00:12
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch from 8a2a9c3 to 3ed58d6 Compare February 6, 2025 00:19
@toddbaert toddbaert marked this pull request as ready for review February 6, 2025 00:23
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch from 3ed58d6 to e033170 Compare February 6, 2025 00:26
@toddbaert toddbaert requested a review from beeme1mr February 7, 2025 21:04
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch from 3ef0d71 to b520c12 Compare February 7, 2025 21:07
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch 2 times, most recently from a356f3a to 04b7488 Compare February 7, 2025 21:15
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch 2 times, most recently from b9ac7e1 to 3558d0d Compare February 7, 2025 21:29
@toddbaert toddbaert force-pushed the feat/ofrep-metadata branch from 3558d0d to b0de3b2 Compare February 7, 2025 21:50
@toddbaert toddbaert merged commit ce37b6a into main Feb 13, 2025
7 checks passed
@toddbaert toddbaert deleted the feat/ofrep-metadata branch February 13, 2025 20:12
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.

Looks good to me! Left nits only.

@@ -84,25 +85,32 @@ export class OFREPProvider implements Provider {

try {
const result = await this.ofrepApi.postEvaluateFlag(flagKey, { context });
return this.toResolutionDetails(result, defaultValue);
return this.responseToResolutionDetails(result, defaultValue);
Copy link
Member

Choose a reason for hiding this comment

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

Why the change? I find the name a bit confusing.
I would argue that toResolutionDetails matches good.

export type EvaluationFlagValue = FlagValue;

export interface EvaluationSuccessResponse {
export interface MetadataResponse {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I would not expect this to have the Response suffix, rather something like EvaluationResponseMetadata, but it might also be a foreign language problem for me :D

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