oliverdavies.uk/content/node.86c57486-ce6b-45ae-b953-2f15ae8cf0cb.yml

93 lines
4.2 KiB
YAML

uuid:
- value: 86c57486-ce6b-45ae-b953-2f15ae8cf0cb
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: |
Feature flags enable continuous integration
created:
- value: '2023-09-28T00: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/28/feature-flags-enable-continuous-integration
langcode: en
body:
- value: |
<p>I was recently working on a feature over a few mob programming sessions.</p>
<p>After the session, we implemented part of the feature but couldn't merge it as it wasn't complete.</p>
<p>After working on other things that day, I'd need to rebase my local commits and push the last-but-one commit to the remote repository to keep the incomplete feature only in my local repository (I forgot a few times and almost pushed it accidentally).</p>
<p>The commit prevented me from following continuous integration - where everyone commits and pushes their code a minimum of once daily.</p>
<p>What if someone else wanted to look at that code between mob sessions? They couldn't, as it was only on my laptop.</p>
<p>If I'd made a temporary branch, it would be outdated and behind other changes to our mainline branch.</p>
<h2 id="feature-flags-to-the-rescue">Feature flags to the rescue</h2>
<p>As this commit was part of a larger change, it couldn't be merged, so we added a feature flag around it.</p>
<p>The values were set to null and hidden by default, and populated by the new changes and displayed if the flag was enabled.</p>
<h2 id="here%27s-the-thing">Here's the thing</h2>
<p>This meant we could safely push the commit, make the changes available to everyone and enable the feature on the environments we wanted - preventing it from showing on production.</p>
<p>This allowed us to get back to our usual working practices, and I didn't need to worry about accidentally pushing the commit and prematurely showing our changes in production.</p>
format: full_html
processed: |
<p>I was recently working on a feature over a few mob programming sessions.</p>
<p>After the session, we implemented part of the feature but couldn't merge it as it wasn't complete.</p>
<p>After working on other things that day, I'd need to rebase my local commits and push the last-but-one commit to the remote repository to keep the incomplete feature only in my local repository (I forgot a few times and almost pushed it accidentally).</p>
<p>The commit prevented me from following continuous integration - where everyone commits and pushes their code a minimum of once daily.</p>
<p>What if someone else wanted to look at that code between mob sessions? They couldn't, as it was only on my laptop.</p>
<p>If I'd made a temporary branch, it would be outdated and behind other changes to our mainline branch.</p>
<h2 id="feature-flags-to-the-rescue">Feature flags to the rescue</h2>
<p>As this commit was part of a larger change, it couldn't be merged, so we added a feature flag around it.</p>
<p>The values were set to null and hidden by default, and populated by the new changes and displayed if the flag was enabled.</p>
<h2 id="here%27s-the-thing">Here's the thing</h2>
<p>This meant we could safely push the commit, make the changes available to everyone and enable the feature on the environments we wanted - preventing it from showing on production.</p>
<p>This allowed us to get back to our usual working practices, and I didn't need to worry about accidentally pushing the commit and prematurely showing our changes in production.</p>
summary: null
field_daily_email_cta: { }