Flagsmith / Flagsmith/flagsmith

Dependencies API: `POST`

Open
#8,413 0 comments 0 reactions 1 assignee Claimed by @emyller View on GitHub
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

Add `POST /api/v1/environments/{environment_api_key}/features/{feature}/dependencies/{prerequisite_feature}`.

`POST`:
- builds the graph from index rows and checks for a cycle.
- finds the system segment via the environment's live `FeatureSegment`.
- if found, appends a `$.flags.{prerequisite_feature}.enabled != true` rule.
- if not, creates the segment with that single rule and persists an `enabled: false` override in line with the environment's versioning.

### Acceptance criteria

- `POST` creates a system, feature-specific segment with the inverted condition and an override setting `enabled: false` at priority 0, shifting conflicting priorities to a weaker position.
- A `POST` for the same feature and a different prerequisite feature appends a rule to the existing segment.
- Dependencies added in one environment do not appear in another.
- Concurrent `POST`s in the same project are serialised.
- V2 versioning environments get a published version.
- V1 versioning environments get a direct write.
- Both V2 and V1 versioned environments emit audit logs.
- Requires `MANAGE_SEGMENT_OVERRIDES`.
- A caller who can not write on the environment gets 404.

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.