Skip to content

# [Bug]: flipt validate rejects valid BOOLEAN_FLAG_TYPE flags with rollouts and null descriptions #5384

@christensen143

Description

@christensen143

Bug Description

flipt validate rejects valid feature flag configurations with two distinct issues in the CUE schema at [core/validation/flipt.cue](https://github.com/flipt-io/flipt/blob/v2/core/validation/flipt.cue):

  1. BOOLEAN_FLAG_TYPE with rollouts fails validation — Boolean flags that include rollouts with a threshold trigger a type conflict error, even though the Flipt runtime correctly processes these configurations.

  2. Null description fields rejected — Flags, variants, and segments with description: null (or implicitly null from YAML) fail validation because the schema defines description?: string which doesn't accept null.

These configurations work correctly at runtime — only the static validator rejects them.

Version Info

Tested on v2.1.3 and v2.6.0 — both produce the same errors.

$ flipt --version
v2.6.0

To Reproduce

Create a features.yaml file:

version: "1.5"
namespace:
  key: my-service
  name: my-service
flags:
  - key: my-boolean-flag
    name: my-boolean-flag
    type: BOOLEAN_FLAG_TYPE
    enabled: true
    rollouts:
      - threshold:
          percentage: 100
          value: true

Run:

flipt validate

Actual Output

2026-02-11T20:05:12Z    INFO    no configuration file found, using defaults
Validation failed!
- Message  : flags.0: 2 errors in empty disjunction:
  File     : features.yaml
  Line     : 0
- Message  : flags.0.type: conflicting values "BOOLEAN_FLAG_TYPE" and "VARIANT_FLAG_TYPE"
  File     : features.yaml
  Line     : 8

For the null description issue, a flag or segment with description: null produces:

- Message  : flags.0.variants.0.description: conflicting values null and string (mismatched types null and string)
- Message  : segments.0.description: conflicting values null and string (mismatched types null and string)

Expected Output

Validation should pass. These are valid Flipt configurations that the runtime accepts and processes correctly.

Analysis

Looking at the CUE schema in [core/validation/flipt.cue](https://github.com/flipt-io/flipt/blob/v2/core/validation/flipt.cue):

Issue 1: Boolean flag disjunction

#Flag: {
    // ...
    variants: [...#Variant]
    rules: [...#Rule]
    if version == "1.1" || ... {
        type: "BOOLEAN_FLAG_TYPE" | *"VARIANT_FLAG_TYPE"
        #FlagBoolean | *{}
    }
}

The disjunction #FlagBoolean | *{} doesn't properly discriminate when a BOOLEAN_FLAG_TYPE flag has rollouts. CUE attempts to unify against both branches of the disjunction and reports the type conflict when neither branch cleanly matches. The variants: [...#Variant] field on #Flag (which defaults to an empty list) seems to interfere with the #FlagBoolean branch resolution.

Issue 2: Null descriptions

#Flag: {
    description?: string
    // ...
}

#Variant: {
    description?: string
    // ...
}

#Segment: {
    description?: string
    // ...
}

description?: string makes the field optional but doesn't permit null as a value. In YAML, omitting a field and setting it to null are often treated equivalently by parsers, but CUE treats null and absent differently. This should be:

description?: string | null

Environment

  • OS: Ubuntu 22.04 (CircleCI cimg/base:current-22.04)
  • Flipt CLI installed via: curl -fsSL https://get.flipt.io/v2 | sh -s -- v2.6.0
  • Using flipt validate in CI/CD pipeline

Additional Context

This is blocking our CI/CD pipeline — all PRs to our feature flags config repository fail the flipt validate step. The Flipt runtime handles these configurations correctly; only the static validator rejects them.

We've confirmed this reproduces on both v2.1.3 and v2.6.0, so it doesn't appear to have been addressed in recent releases.

  • I searched for other open and closed issues before opening this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions