flagsmith
flagsmith copied to clipboard
feat: Introduce the SDK Evaluation Context schema
Thanks for submitting a PR! Please check the boxes below:
Contributes to #4413.
- [ ] I have added information to
docs/if required so people know about the feature! - [x] I have filled in the "Changes" section below?
- [x] I have filled in the "How did you test this code" section below?
- [x] I have used a Conventional Commit title for this Pull Request
Changes
The following is a proposed Flagsmith Evaluation Context schema JSON Schema definition.
Notes
IdentityEvaluationContext.traitsis a mapping of trait keys to aTraitEvaluationContext | nullunion. In case anullis provided, we assume intent to delete the previously persisted trait.TraitEvaluationContext.valuecan only be astringnow.- We now have a
TraitEvaluationContext.typeenum field designating the trait value type. For now it will support an SDK-side mapping layer. It's expected that the v2 SDK API should support it in the future.
How did you test this code?
This is a documentation change, but I'm verifying the schema against a validator.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| docs | ⬜️ Ignored (Inspect) | Visit Preview | Aug 6, 2024 9:16pm | |
| flagsmith-frontend-preview | ⬜️ Ignored (Inspect) | Visit Preview | Aug 6, 2024 9:16pm | |
| flagsmith-frontend-staging | ⬜️ Ignored (Inspect) | Visit Preview | Aug 6, 2024 9:16pm |
Docker builds report
| Image | Build Status | Security report |
|---|---|---|
ghcr.io/flagsmith/flagsmith-api-test:pr-4414 |
Finished :white_check_mark: | Skipped |
ghcr.io/flagsmith/flagsmith-e2e:pr-4414 |
Finished :white_check_mark: | Skipped |
ghcr.io/flagsmith/flagsmith-frontend:pr-4414 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-api:pr-4414 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith:pr-4414 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4414 |
Finished :white_check_mark: | Results :white_check_mark: |
Uffizzi Ephemeral Environment deployment-54754
:cloud: https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4414
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more!
@khvn26 I love the idea of a schema. I would like to see examples of how this schema would be used. While I think the current schema is complete and clear, I think we could simplify the structure of some of the contexts, but that would be clearer if we could have some implementation examples of the schema.
@novakzaballa One thing I could do to demonstrate is to go ahead and add it for JS and Golang SDK transient ids/traits PRs. You'll be able to review the schema with those implementations in consideration.
@novakzaballa One thing I could do to demonstrate is to go ahead and add it for JS and Golang SDK transient ids/traits PRs. You'll be able to review the schema with those implementations in consideration.
Let's do that @khvn26 . Some examples I generated look good to me and we can always optimize if we see an opportunity while we move forward. I'll approve the PR. Nice job!