Skip to content

Integrate gitStream with Flagsmith

Label Flagsmith Feature Flags

Automatically label code that contians specified feature flags.

Label PRs Based on Feature Flags

Configuration Description

Conditions (all must be true):

  • The PR adds one or more feature flag keys.

Automation Actions:

  • Label the PR for each feature flag key introduced in the PR.

Label PRs Based on Feature Flags

# -*- mode: yaml -*-
manifest:
  version: 1.0

automations:

  {% for item in feature_flags %}
  label_ff_flagsmith_{{ item.name }}:
    if:
      - {{ source.diff.files | matchDiffLines(regex=r/flagsmith.hasFeature\(/) | some }}
      - {{ source.diff.files | matchDiffLines(regex=item.regex) | some }}
    run:
      - action: add-label@v1
        args:
          label: {{ item.name }}
          color: {{ colors.yellow }}
  {% endfor %}

feature_flags:
   - name: engineering_rollback_plan_activated 
     regex: r/engineering_rollback_plan_activated/
   - name: marketing_premium_plan_features_unlocked 
     regex: r/marketing_premium_plan_features_unlocked/
   - name: mobile_push_notifications_enabled
     regex: r/mobile_push_notifications_enabled/

colors:
  yellow: 'ffb300'   

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

More Automations can be found on the Automation Library and Integrations pages.