AZ-400 Question 64
Select 2Your organization develops a web application with frequent feature updates and quarterly releases. They have adopted trunk-based development for continuous integration but also need to maintain older release versions to apply critical fixes. Which two approaches should you recommend to meet these requirements effectively?
- A
Create short-lived feature branches from the trunk for new features and merge them back frequently.
- B
Establish dedicated release branches for quarterly releases and merge critical fixes into them as needed.
- C
Work solely on the trunk for all feature development and only branch out in cases of major refactoring.
- D
Use long-lived branches for each feature and merge them into the trunk only before a quarterly release.
Show answer and explanation
Correct answers: A, B
Explanation
In trunk-based development, teams continually merge small, incremental changes to the trunk (or main) branch to maintain a clean and stable codebase. Short-lived branches reduce merge conflicts and keep integration cycles short. For production stability and maintenance of older versions, creating distinct release branches after every major release is recommended. These best practices are detailed in Microsoft� official DevOps guidance and Azure DevOps branching strategy documentation.
- A. Correct.
Option 1: Correct. Trunk-based development relies on short-lived feature branches to reduce merge conflicts and integrate code frequently. Merging back to trunk as soon as possible keeps the main codebase stable and up-to-date.
- B. Correct.
Option 2: Correct. Having a dedicated release branch for each quarter allows you to apply patches or critical fixes to older versions without disrupting ongoing development on the trunk.
- C. Incorrect.
Option 3: Incorrect. While trunk-based development emphasizes frequent integration, organizations typically create separate branches for features or fixes to avoid major disruptions in the main branch. Relying solely on the trunk for everything can cause instability when multiple features are developed in parallel.
- D. Incorrect.
Option 4: Incorrect. Long-lived feature branches deviate from the principle of trunk-based development. They increase the risk of merge conflicts and slow down integration cycles, which contradicts the core benefits of trunk-based development.