Skip to content

Commit

Permalink
Merge pull request #419 from linear-b/ff-examples
Browse files Browse the repository at this point in the history
Feature Flag Integrations
  • Loading branch information
BenLloydPearson authored Jan 16, 2024
2 parents 8f2a99a + b3ac03c commit a4b4d08
Show file tree
Hide file tree
Showing 21 changed files with 431 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/automations/integrations/devcycle/label-ff-devcycle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Automation - Label PRs Based on Feature Flags
description: Automatically label code that contians specified feature flags.
---
# Label DevCycle Feature Flags

<!-- --8<-- [start:example]-->

Automatically label code that contians specified feature flags.

![Label PRs Based on Feature Flags](/automations/integrations/devcycle/label-ff-devcycle/label-ff-devcycle.png)

!!! info "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.

<div class="automationExample" markdown="1">
!!! example "Label PRs Based on Feature Flags"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/devcycle/label-ff-devcycle/label_ff_devcycle.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/devcycle/label-ff-devcycle/label_ff_devcycle.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/automations/integrations/flagr/label-ff-flagr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Automation - Label PRs Based on Feature Flags
description: Automatically label code that contians specified feature flags.
---
# Label Flagr Feature Flags

<!-- --8<-- [start:example]-->

Automatically label code that contians specified feature flags.

![Label PRs Based on Feature Flags](/automations/integrations/flagr/label-ff-flagr/label-ff-flagr.png)

!!! info "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.

<div class="automationExample" markdown="1">
!!! example "Label PRs Based on Feature Flags"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/flagr/label-ff-flagr/label_ff_flagr.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/flagr/label-ff-flagr/label_ff_flagr.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Automation - Label PRs Based on Feature Flags
description: Automatically label code that contians specified feature flags.
---
# Label Flagsmith Feature Flags

<!-- --8<-- [start:example]-->

Automatically label code that contians specified feature flags.

![Label PRs Based on Feature Flags](/automations/integrations/flagsmith/label-ff-flagsmith/label-ff-flagsmith.png)

!!! info "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.

<div class="automationExample" markdown="1">
!!! example "Label PRs Based on Feature Flags"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/flagsmith/label-ff-flagsmith/label_ff_flagsmith.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/flagsmith/label-ff-flagsmith/label_ff_flagsmith.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Automation - Label PRs Based on Feature Flags
description: Automatically label code that contians specified feature flags.
---
# Label LaunchDarkly Feature Flags

<!-- --8<-- [start:example]-->

Automatically label code that contians specified feature flags.

![Label PRs Based on Feature Flags](/automations/integrations/launch-darkly/label-ff-launch-darkly/label-ff-launch-darkly.png)

!!! info "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.

<div class="automationExample" markdown="1">
!!! example "Label PRs Based on Feature Flags"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/launch-darkly/label-ff-launch-darkly/label_ff_launch_darkly.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/launch-darkly/label-ff-launch-darkly/label_ff_launch_darkly.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/automations/integrations/unleash/label-ff-unleash/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Automation - Label PRs Based on Feature Flags
description: Automatically label code that contians specified feature flags.
---
# Label Unleash Feature Flags

<!-- --8<-- [start:example]-->

Automatically label code that contians specified feature flags.

![Label PRs Based on Feature Flags](/automations/integrations/unleash/label-ff-unleash/label-ff-unleash.png)

!!! info "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.

<div class="automationExample" markdown="1">
!!! example "Label PRs Based on Feature Flags"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/unleash/label-ff-unleash/label_ff_unleash.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/unleash/label-ff-unleash/label_ff_unleash.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: yaml -*-
manifest:
version: 1.0

automations:

{% for item in feature_flags %}
label_ff_devcycle_{{ item.name }}:
if:
- {{ source.diff.files | matchDiffLines(regex=r/key = '/) | 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'


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: yaml -*-
manifest:
version: 1.0

automations:

{% for item in feature_flags %}
label_ff_flagr_{{ item.name }}:
if:
- {{ source.diff.files | matchDiffLines(regex=r/evaluation_result.variant_id ==/) | 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'


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- 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'


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: yaml -*-
manifest:
version: 1.0

automations:

{% for item in feature_flags %}
label_ff_launchdarkly_{{ item.name }}:
if:
- {{ source.diff.files | matchDiffLines(regex=r/var flagValue = ldclient/) | 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'


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: yaml -*-
manifest:
version: 1.0

automations:

{% for item in feature_flags %}
label_ff_unleash_{{ item.name }}:
if:
- {{ source.diff.files | matchDiffLines(regex=r/const notificationBadgeEnabled = useFlag/) | 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'


36 changes: 36 additions & 0 deletions docs/integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,42 @@ description: Integrate third-party developer tools with gitStream.

</div>

## Feature Flags
<div class="integrations-list" markdown="1">

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[DevCycle](/integrations/devcycle)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[Launch Darkly](/integrations/launch-darkly)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[Flagsmith](/integrations/flagsmith)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[Unleash](/integrations/unleash)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[Flagr](/integrations/flagr)
</div>
</div>

</div>


## Languages
<div class="integrations-list" markdown="1">

Expand Down
16 changes: 16 additions & 0 deletions docs/integrations/devcycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Integrate gitStream with DevCycle
description: Implement workflow automations for DevCycle.
---
# Integrate gitStream with DevCycle

<a name="label-ff-devcycle"></a>
## Label DevCycle Feature Flags
--8<-- "docs/automations/integrations/devcycle/label-ff-devcycle/README.md:example"


## Additional Resources

--8<-- "docs/snippets/general.md"

--8<-- "docs/snippets/automation-footer.md"
Loading

0 comments on commit a4b4d08

Please sign in to comment.