CI/CD

Small Batches and Trunk-Based Development

Reduce integration risk by dividing work into small reviewable batches and returning short-lived branches to a healthy shared trunk frequently.

Intermediate14 min read
CI/CD lessonDelivery and reliability foundationsLearn

Reduce integration risk by dividing work into small reviewable batches and returning short-lived branches to a healthy shared trunk frequently.

What you will be able to do

  • Distinguish batch scope from shared trunk in a realistic small batches and trunk-based development case.
  • Interpret the delivery evidence and boundary associated with short-lived branch.
  • Choose an appropriate action involving fast verification without exceeding the named operational scope.
  • Verify integrated outcome through an observable service result and reproducible handoff.

01

Frame Small Batches and Trunk-Based Development

Reduce integration risk by dividing work into small reviewable batches and returning short-lived branches to a healthy shared trunk frequently.

A notification feature has grown on a branch for nine days. The team must split it into safe increments that can merge without exposing unfinished behavior.

Keep the delivery target, declared intent, execution evidence, reliability boundary, and recovery choice separate. Start with observable state and preserve enough context for another operator to reproduce the decision.

02

Batch scope

A small batch changes one coherent behavior with limited review and rollback scope. Within small batches and trunk-based development, this role answers a separate delivery or reliability question and keeps its own evidence.

Separate the notification storage change from its user-facing activation. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not hide several independent behaviors inside one large merge. The observable result is specific: each batch can be reviewed and reverted independently.

03

Shared trunk

Trunk is the shared mainline where integrated work must remain healthy. Within small batches and trunk-based development, this role answers a separate delivery or reliability question and keeps its own evidence.

Merge a tested inactive slice back to main promptly. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not reserve integration until the full feature is complete. The observable result is specific: main contains the safe slice and remains buildable.

04

Short-lived branch

A short-lived branch reduces divergence from the current shared codebase. Within small batches and trunk-based development, this role answers a separate delivery or reliability question and keeps its own evidence.

Rebase or merge current main before the branch accumulates broad drift. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not let the branch become a second long-running product line. The observable result is specific: the branch closes after one focused integration.

05

Fast verification

Fast automated checks provide feedback while the change context is still fresh. Within small batches and trunk-based development, this role answers a separate delivery or reliability question and keeps its own evidence.

Run the focused test suite before and after integration. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not defer essential regression checks to a later stabilization phase. The observable result is specific: the integrated slice passes the required checks.

06

Integrated outcome

Frequent integration is useful only when the shared result remains releasable. Within small batches and trunk-based development, this role answers a separate delivery or reliability question and keeps its own evidence.

Verify main after the merge and revert quickly if it becomes unhealthy. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not leave a broken mainline while starting another batch. The observable result is specific: main is green and the next slice can begin safely.

07

Apply Small Batches and Trunk-Based Development to One Service Change

Use one bounded delivery decision: A notification feature has grown on a branch for nine days. The team must split it into safe increments that can merge without exposing unfinished behavior.

First, separate the notification storage change from its user-facing activation. Then, merge a tested inactive slice back to main promptly. Keep both observations attached to the exact revision, environment, or service window.

Next, rebase or merge current main before the branch accumulates broad drift. After that, run the focused test suite before and after integration. Close the work only after you verify main after the merge and revert quickly if it becomes unhealthy.

08

Recap Before Practice and Prove

Batch scope: A small batch changes one coherent behavior with limited review and rollback scope. In this service case, separate the notification storage change from its user-facing activation. Preserve the boundary: do not hide several independent behaviors inside one large merge.

Shared trunk: Trunk is the shared mainline where integrated work must remain healthy. In this service case, merge a tested inactive slice back to main promptly. Preserve the boundary: do not reserve integration until the full feature is complete.

Short-lived branch: A short-lived branch reduces divergence from the current shared codebase. In this service case, rebase or merge current main before the branch accumulates broad drift. Preserve the boundary: do not let the branch become a second long-running product line.

Fast verification: Fast automated checks provide feedback while the change context is still fresh. In this service case, run the focused test suite before and after integration. Preserve the boundary: do not defer essential regression checks to a later stabilization phase.

Integrated outcome: Frequent integration is useful only when the shared result remains releasable. In this service case, verify main after the merge and revert quickly if it becomes unhealthy. Preserve the boundary: do not leave a broken mainline while starting another batch.

NEXT STEP

Turn reading into recall

Practice the concepts without a timer, with coaching and retry available after every answer.

Open guided practice