Skip to content

Segment overrides not appearing in Flagsmith UI #206

@sethyates

Description

@sethyates

Describe the bug

The Terraform provider creates segment overrides, but this endpoint does not properly persist the feature field when creating feature-segments. This causes segment overrides created via Terraform to:

  • Not appear in the Flagsmith UI
  • Have feature: null and is_feature_specific: false in the database
  • Not be returned when querying for a specific feature's segment overrides
  • Function as environment-level overrides instead of feature-specific ones

Impact:

  • All segment overrides created via Terraform are broken and unusable
  • Users cannot manage segment overrides via Infrastructure-as-Code
  • Segment overrides don't appear in UI, making them impossible to manage or debug

Steps to Reproduce

Prerequisites:

  • Flagsmith provider v0.9.1
  • Valid Flagsmith master API key
  • Existing feature and segment

Terraform Configuration:

resource "flagsmith_feature_state" "segment_override" {
  enabled          = true
  environment_key  = flagsmith_environment.dev.api_key
  feature_id       = flagsmith_feature.my_feature.id
  segment_id       = flagsmith_segment.my_segment.id
  segment_priority = 0
  feature_state_value = {
    type          = "bool"
    boolean_value = true
  }
}

Steps:

  1. Apply the Terraform configuration
  2. Terraform reports successful creation with an ID
  3. Check Flagsmith UI → Feature → Segment Overrides tab
  4. Observe: No segment overrides visible

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions