Flagsmith / Flagsmith/flagsmith

Cohorts are not included in organisation import/export

Open
#8,316 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

## Problem

`import_export/` has no coverage for `Cohort` or `CohortMembership`. Segments are exported (`export.py:152`), and `export_identities` serialises the whole `Identity` model, so `system_traits` goes with it.

## Impact

An import restores a `managed_by=COHORT` segment and the membership keys on identities, but no cohort behind either. The segment cannot be edited (managed segments are blocked) and the keys cannot be removed, since there is no cohort or ledger to drain.

Contributor guide

Open the contributing guide

Research direction

Start in import_export/, especially export.py:152 and export_identities, then trace how segments and identities are imported and exported. Check the Cohort and CohortMembership models and existing coverage before adding round-trip handling. Done means an organisation import restores cohorts, memberships, and the references needed for managed segments and identity traits to work correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.