DEV Community

Discussion on: CI/CD: Continuous Integration & Delivery Explained

Collapse
 
mike_hasarms profile image
Mike Healy

Could you elaborate on this point please:

...if you develop in feature branches, they should live no longer than a day. When you need more time to develop new features, use feature flags.

Should feature branches be short lived so they stay closer in sync to master?
How do feature flags let you restrict unstable work from being used?

Collapse
 
markoa profile image
Marko Anastasov

Should feature branches be short lived so they stay closer in sync to master?

Exactly. The longer it lives the higher the chance they will diverge and make it harder to integrate. Not just merge code on line by line level, but make sure it doesn’t introduce unforeseen bugs at runtime (because of how some APIs or dependencies changed in the meantime).

Collapse
 
markoa profile image
Marko Anastasov

How do feature flags let you restrict unstable work from being used?

Feature flags are basically

if current_user.can_use_feature?(“new-feature”)
  render_new_feature_widget
end

So you don’t even load the related code unless the user is part of the dev team or a small group of beta testers. It can be totally unfinished, nobody will be affected. So you can work on it in small iterations and make sure each iteration is well integrated with the system as a whole. Much easier to deal with than a big-bang merge.

Collapse
 
mike_hasarms profile image
Mike Healy

Thank you, looks good