Comments by "Andrea Laforgia" (@andrealaforgia) on "Continuous Delivery" channel.

  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1
  7. 1
  8. 1
  9. 1
  10. 1
  11. 1
  12. 1
  13. Scenario 1: You can indeed have only 1 function in your code that will implement one behaviour or the other based on the version (for example, you could use the Strategy pattern there). No need to keep your code physically separated when you can have logical separation.

You don’t need to duplicate any other version of the code that the two libraries have in common. No need to fix bugs in that part of the code multiple times.

In general, you can use feature toggles to logically separate “branches” of logic in the same code base. It works really well. 
In some languages (e.g. Java + Spring Boot), leveraging dependency injection, there are some neat ways of injecting behaviours based on conditions that make the above very easy to do (look at how ff4j works, for example). 

Scenario 2: the longer code is parked on a feature branch, the higher the risk of diversion from master and merge conflicts. The best way to develop code we know so far is to continuously integrate into a shared mainline multiple times a day (e.g. Continuous Integration). See above: using feature toggles, you can delay releasing a specific feature as long as you want.

The big misunderstanding here is that each push to master will release to production. One thing is pushing to master, another thing is releasing to production. You can have that with Continuous Deployment. With Continuous Delivery, your code is always releasable but not always released. The key point here is that you must be able to release whenever you want with no fear.

 The reason why trunk-based development seems dangerous to you is because you’ve never used it. Companies like Google or Facebook (but I could also mention some smaller companies I’ve worked for) use scaled trunk-based development on extremely large projects with thousand developers on them. 
 What you describe in your last paragraph is not continuous integration.

Continuous Integration is defined as: “a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.By integrating regularly, you can detect errors quickly, and locate them more easily.” (ThoughtWorks)
    1
  14.  @markar34  Of course I am aware of semver, it's a de facto standard. Semver is irrelevant though. You can use whatever versioning mechanism. I totally understand why you need to keep two separate versions of your library. That's a common scenario in any software, especially when you deal with "dinosaur" companies that move at a very slow pace and are reluctant to upgrade even when they would need to (e.g. big financial institutions). I don't think you understood my comment though. I am not questioning the logical separation of your versions; I am questioning the physical separation. Believe it or not, you don't need long-lived branches to maintain that separation. You can have a logical separation of versions within the same single branch. You can deploy from the shared mainline using different configurations for each client and each version. As I said before, if you have hundred or thousand clients, you cannot possibly afford long-lived branches for all of them. The ability to keep developing your software would grind to a halt. I mentioned dependency injection with regard to how to use feature toggles properly with some languages/frameworks, just to avoid the mess in the code that you were mentioning. Your code can be architected in a way such that the usage of feature toggles has a very minimal impact on it. Unfortunately, it would take time and a real example to show you how that works. The ff4j library is very powerful from this point of view, leveraging proxies and DI. >The fact that we share say, the develop branch, and our CI builds it, and runs automated tests, that's enough to say it's continuous integration. I'm not sure what is your definition of continuous integration. Nope. Not if you use long-lived branches. Continuous Integration, as defined by ThoughtWorks, is: "Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early. By integrating regularly, you can detect errors quickly, and locate them more easily." If your development happens on long-lived feature branches, it's not CI. CI doesn't just mean having a CI build. It's a development practice.
    1
  15. 1
  16. 1
  17. 1
  18. 1
  19. 1
  20. 1
  21. 1
  22. 1
  23. 1
  24. 1
  25. 1
  26. 1
  27. 1
  28. 1
  29. 1
  30. 1
  31. 1
  32. 1
  33. 1
  34. 1
  35. 1
  36. 1
  37. 1
  38. 1
  39. 1
  40. 1
  41. 1
  42. 1
  43. 1
  44. 1
  45. 1
  46. 1
  47. 1
  48. 1
  49. 1
  50. 1