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: draft branch playground evaluation #3967

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Jun 13, 2023

About the changes

Drafting batch playground/advanced evaluations instead of a hardcoded response.

Next PR:

  • define OpenAPI schema if the data makes sense in the UI
  • stabilize the backend by adding tests and maybe some refactoring

Important files

Discussion points

@vercel
Copy link

vercel bot commented Jun 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jun 13, 2023 11:34am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Jun 13, 2023 11:34am

environment: string;
};

type AdvancedPlaygroundFeatureSchema = PlaygroundFeatureSchema & {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be openapi schema once we define it, but for now I neded to add extra context and environment info to prepare UI specific read model

@@ -42,34 +50,49 @@ export class PlaygroundService {
projects: typeof ALL | string[],
environments: string[],
context: SdkContextSchema,
): Promise<PlaygroundFeatureSchema[]> {
): Promise<any> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this type will be openapi defined in the next PR

entries,
(entry) => entry.environment,
);
return {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it creates the same structure as we had in the hardcoded response

);
return {
name,
projectId: entries[0]?.projectId,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can take any entry in the group so I take the first one since it's always there

@@ -112,18 +135,22 @@ export class PlaygroundService {
projectId: featureProject[feature.name],
variant: client.getVariant(feature.name, clientContext),
name: feature.name,
environment,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm passing environment and context from input to output because the new UI requires those values

context,
environment,
});
return result.map((item) => omitKeys(item, 'environment', 'context'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

old playground shouldn't get environment and context that we evaluate for the new playground

Copy link
Contributor

@andreas-unleash andreas-unleash left a comment

Choose a reason for hiding this comment

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

LGTM

@kwasniew kwasniew merged commit 555f774 into main Jun 13, 2023
10 checks passed
@kwasniew kwasniew deleted the draft-batch-playground-evaluation branch June 13, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants