Flagsmith / Flagsmith/flagsmith

Backend: Add granular trait control for client-side SDKs

Open
#6,823 0 comments 0 reactions 0 assignees View on GitHub
api
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

- Add `allow_client_traits_in_evaluation = BooleanField(default=True)` to the `Environment` Django model in `environments/models.py`.
- Data migration: in SaaS (using the `is_saas` utility function), for every environment where `allow_client_traits is False`, set `allow_client_traits_in_evaluation = True` (grandfather legacy behaviour so existing customers are unaffected).
- Update `map_environment_to_engine()` in `util/mappers/engine.py` and SDK API view logic to support both `allow_client_traits_in_evaluation` and `allow_client_traits`.
- Add to `EnvironmentSerializerLight.Meta.fields` in `environments/serializers.py`. We should not allow `allow_client_traits: True` + `allow_client_traits_in_evaluation: False` permutation, and return a 400 for this case.
- Bump `flagsmith-common` dependency.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.