Flagsmith / Flagsmith/flagsmith

Sync segment rules between environments

Open
#5,231 2 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

### Is your feature request related to a problem? Please describe.

When managing multiple environments per project (Dev, QA, Prod), it would be incredibly helpful to not only keep added or removed features in sync across environments but also provide an option to sync segment rules seamlessly.

For example, consider a new feature called `new_payment_method` with the following segment rules:

- `client_version > "1.0.3"`
- `regulation equals "X"`
- `client_type in "Android, iOS"`

These rules would typically apply across all environments—Dev, QA, and Prod. However, in the QA environment, I might want to add:
- `user_id in [1, 2, 3, 4]`

And in the Prod environment, I might include:
- `%Split 20`

As you can see, rules like `client_version`, `regulation`, and `client_type` remain consistent across all environments.

Currently, a developer would need to:
1. Create the feature (which gets added to all environments—great!).
2. Manually create the segment with all its rules three separate times for each environment.

While this process works, it can feel a bit repetitive and might increase the chance of accidental mistakes. A sync option for segment rules could streamline this workflow beautifully, making it more efficient and reliable. What do you think—any plans to explore something like this? I’d love to see this enhancement in action!

### Describe the solution you'd like.

1. When creating/updating/deleting segments and rules, provide an option to opt in/out syncing other environments.
2. Exporting a single flag to an XML/JSON file and importing it into another host, project, or environment (a straightforward UI enhancement!).
3. Copying to the clipboard and pasting it into another host, project, or environment (another simple UI win!).
4. Duplicating a single flag to another environment within the same project (an easy UI addition!).

This feature would be incredibly valuable for us. I feel that Flagsmith could really shine even brighter by offering a seamless way to sync flags between environments. It would elevate the platform’s position as a robust solution for real production systems. Feature management isn’t just about creating, removing, or releasing flags—it’s also about enabling practical maintenance and automation across multiple environments, helping us avoid the pitfalls of a manual sync process that can sometimes lead to errors. Excited to hear your thoughts!

### Describe alternatives you've considered

None

### Additional context

_No response_

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.