Flagsmith / Flagsmith/flagsmith

Improve ORM enum ergonomics for feature health choices

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

Description

`FeatureHealthEventType` and `FeatureHealthProviderName` subclass base `models.Choices`, so their members aren't `str` and depend on `.value` unwrapping to evaluate correctly in DB queries. Normalise to `TextChoices` (as done for `TagType` in #7877).

## Acceptance criteria

- [ ] Both evaluate correctly in queries without `.value` unwrapping.
- [ ] Stored values unchanged.
- [ ] Tests exercise the members directly.

Contributor guide

Open the contributing guide

Research direction

Locate FeatureHealthEventType and FeatureHealthProviderName, then compare their declarations with TagType from issue #7877. Update the enum declarations so members work directly in ORM queries, preserve stored values, and add or adjust tests that exercise the members without .value unwrapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.