81 lines
3 KiB
YAML
81 lines
3 KiB
YAML
uuid:
|
|
- value: 7039fa97-b91e-42c4-b974-c75ab08e4d51
|
|
langcode:
|
|
- value: en
|
|
type:
|
|
- target_id: daily_email
|
|
target_type: node_type
|
|
target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7
|
|
revision_timestamp:
|
|
- value: '2025-05-11T09:00:30+00:00'
|
|
revision_uid:
|
|
- target_type: user
|
|
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
|
|
revision_log: { }
|
|
status:
|
|
- value: true
|
|
uid:
|
|
- target_type: user
|
|
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
|
|
title:
|
|
- value: |
|
|
Separating environments with feature flags
|
|
created:
|
|
- value: '2023-09-27T00:00:00+00:00'
|
|
changed:
|
|
- value: '2025-05-11T09:00:30+00:00'
|
|
promote:
|
|
- value: false
|
|
sticky:
|
|
- value: false
|
|
default_langcode:
|
|
- value: true
|
|
revision_translation_affected:
|
|
- value: true
|
|
path:
|
|
- alias: /daily/2023/09/27/separating-environments-with-feature-flags
|
|
langcode: en
|
|
body:
|
|
- value: |
|
|
<p>You have two or more environments and versions of your application, but you do trunk-based development, so you only have a single branch that you use on all environments.</p>
|
|
|
|
<p>But if all environments have the same code, how can we have differences between them?</p>
|
|
|
|
<p>What if we want a feature enabled on one environment and not the other?</p>
|
|
|
|
<h2 id="feature-flags">Feature flags</h2>
|
|
|
|
<p>Feature flags are an approach I've previously written about. You have two branches of logic within your code, and the flow changes based on whether a flag is enabled.</p>
|
|
|
|
<p>If a flag is enabled, execute the first block of code. Otherwise, execute the second.</p>
|
|
|
|
<p>Now, you enable and disable the required feature flags for each environment.</p>
|
|
|
|
<p><strong>The code is the same for all environments, but the enabled features and functionality are different.</strong></p>
|
|
|
|
<p>Then, once the feature has been deployed and released in production, the feature flag can be removed.</p>
|
|
|
|
|
|
format: full_html
|
|
processed: |
|
|
<p>You have two or more environments and versions of your application, but you do trunk-based development, so you only have a single branch that you use on all environments.</p>
|
|
|
|
<p>But if all environments have the same code, how can we have differences between them?</p>
|
|
|
|
<p>What if we want a feature enabled on one environment and not the other?</p>
|
|
|
|
<h2 id="feature-flags">Feature flags</h2>
|
|
|
|
<p>Feature flags are an approach I've previously written about. You have two branches of logic within your code, and the flow changes based on whether a flag is enabled.</p>
|
|
|
|
<p>If a flag is enabled, execute the first block of code. Otherwise, execute the second.</p>
|
|
|
|
<p>Now, you enable and disable the required feature flags for each environment.</p>
|
|
|
|
<p><strong>The code is the same for all environments, but the enabled features and functionality are different.</strong></p>
|
|
|
|
<p>Then, once the feature has been deployed and released in production, the feature flag can be removed.</p>
|
|
|
|
|
|
summary: null
|
|
field_daily_email_cta: { }
|