Flagsmith / Flagsmith/flagsmith

Stop using the SegmentRule and Condition models

Open
#7,818 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

Migrate the last segment rule/condition readers (release pipeline, organisation export) onto `Segment.rules_data` and stop writing rows. Leave the models so historical segments can still be read, and mark them as deprecated.

### Acceptance criteria

- `SegmentRule` and `Condition` are clearly marked as deprecated.
- Creating or updating a segment writes no `SegmentRule` or `Condition` rows.
- The release-pipeline phased-rollout percentage is read correctly from `rules_data`.
- An organisation import produces `rules_data` and no `SegmentRule` and `Condition` rows.
- The OpenAPI schema does not rely on the `SegmentRule` model.
- The ordering settings are gone and no test depends on them.
- The newly introduced `Segment.rules_data` is renamed to `Segment.rules` — rules naturally flow from the serialiser into the model.

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.