• Integrate frequently (at least daily). • Each integration is verified by an automated build & test to detect integration errors as quickly as possible. • Significantly reduced integration problems. • Allows a team to develop cohesive software more rapidly. • Most popular branching policy for CI is trunk-based development. martinfowler.com
Fowler Every developer commits at least daily to shared mainline Every commit triggers an automated build & test If build & test fails, it’s repaired within 10 mins
release automated build & test build or test failed Continuous Integration (CI) Trunk-based Development: Short-lived branch short-lived branch ‣ A short-lived branch is something that should last 1 or 2 days max and carry a consistent piece of code that contributes to the feature you are building.
release automated build & test build or test failed short-lived branch 3 files changes 1 deleted files 0 conflicted files 5 new files Continuous Integration (CI) Trunk-based Development: Short-lived branch A few minutes for the review is best, and tens of minutes acceptable. More than a hour or two, and you are negatively affecting cycle times.
toggle on Continuous Integration (CI) Trunk-based Development: Feature-toggle v1 toggle off release to prod integrate incomplete code safely release anytime dev team always have latest codes
toggle off Continuous Integration (CI) Trunk-based Development: Feature-toggle v2 toggle on release to prod • once the feature is completed & tested, we will toggle it to the user • if the feature got issue on prod, it’s easily toggled back to hide
Development: Branch-by-abstraction buttons 20% code review buttons divide the branches into abstractions reviewer will get familiar with the code little by little. This help to get the full context about the code
Continuous testing • Continuous feedback • Low cognitive load • On demand release feedback on code feedback on build & test feedback from testing feedback from business feedback on product Continuous Integration (CI)
Continuous testing • Continuous feedback • Low cognitive load • On demand release code review Continuous Integration (CI) 1 2 3 4 5 code build & test Cognitive load refers to the amount of information the working memory can hold at any one given time. Most people can handle a cognitive load of between 3 and 7 separate pieces of information.
knows what the current state of the code truly is, we avoid big risky merges, and people can refactor as much as they need to. • Trunk-based Development (TBD) is the key enabler for the CI. We should implement these two technical practices concurrently, because they have more impact when you use them together. • Feature Toggles are a powerful technique, allowing teams to modify system behaviour without changing code.
• https://trunkbaseddevelopment.com/ • https://martinfowler.com/articles/feature-toggles.html • https://martinfowler.com/articles/branching-patterns.html • https://martinfowler.com/bliki/BranchByAbstraction.html • Continuous Integration Improving Software Quality and Reducing Risk book • Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations book • Team Topologies book • Monolith to Microservice (feature toggle & branch-by-abstraction section) book • Design It book • https://www.youtube.com/c/ContinuousDelivery • Jez Humble youtube videos