ai-pull-request-handbook

Delivery Models

Overview

The AI-Enhanced Pull Request Handbook supports both trunk-based and batch release delivery models. Each model has specific requirements and considerations for PR automation and validation.


Trunk-Based Delivery (Topic Merges)

Model Description

Trunk-based delivery involves small, frequent merges from short-lived branches into the main branch (trunk). Each PR represents a single feature or slice of work.

Key Characteristics

PR Requirements for Trunk-Based Delivery

Core Rules Application

AI + CI Validation

Human Review Focus

Example Trunk-Based Workflow

graph TD
    A[Developer Creates Feature Branch] --> B[Implements Feature Slice]
    B --> C[Opens PR with Template]
    C --> D[AI Gate Check]
    D --> E[Fix Gaps & Add Evidence]
    E --> F[CI/CD Validation]
    F --> G[Human Review]
    G --> H[Merge to Trunk]
    H --> I[Deploy to Production]

Benefits of Trunk-Based with AI Enhancement


Batch Release Delivery (Release Trains)

Model Description

Batch release delivery groups multiple features together and deploys them as coordinated “release trains” on scheduled intervals.

Key Characteristics

PR Requirements for Batch Delivery

Individual PR Level

Release Level (Additional Requirements)

Release Train Process

1. Feature Development Phase

graph TD
    A[Multiple Feature Branches] --> B[Individual PRs]
    B --> C[Core Rules Validation]
    C --> D[AI + CI Checks]
    D --> E[Human Review]
    E --> F[Individual PR Approval]

2. Release Planning Phase

graph TD
    A[Approved PRs] --> B[Release Planning]
    B --> C[Release Manifest Creation]
    C --> D[Dependency Analysis]
    D --> E[Risk Assessment]
    E --> F[Rollback Planning]

3. Release Integration Phase

graph TD
    A[Release Branch Creation] --> B[Feature Integration]
    B --> C[Integrated Testing]
    C --> D[Performance Validation]
    D --> E[Security Scanning]
    E --> F[Release Approval]

4. Deployment Phase

graph TD
    A[Staged Rollout] --> B[Canary Deployment]
    B --> C[Monitoring & Validation]
    C --> D{Rollout Gates Met?}
    D -->|Yes| E[Full Deployment]
    D -->|No| F[Auto-Rollback]
    E --> G[Post-Release Monitoring]
    F --> H[Issue Investigation]

Batch Release Components

Release Manifest

Integrated Testing

Migration Coordination

Staged Rollout

Benefits of Batch Release with AI Enhancement


Choosing Your Delivery Model

When to Use Trunk-Based Delivery

Advantages

Best For

Requirements

When to Use Batch Release Delivery

Advantages

Best For

Requirements


Hybrid Approaches

Feature Flag Trunk-Based

Micro-Release Trains

Progressive Delivery


Migration Between Models

From Trunk-Based to Batch Release

Preparation Steps

  1. Implement Release Planning: Establish release planning process
  2. Create Release Infrastructure: Build release manifest and tracking
  3. Develop Integration Testing: Comprehensive system testing
  4. Train Teams: Educate teams on batch release process

Migration Process

  1. Parallel Running: Run both models during transition
  2. Feature Batching: Start batching related features
  3. Process Refinement: Iterate on batch release process
  4. Full Transition: Complete migration to batch model

From Batch Release to Trunk-Based

Preparation Steps

  1. Implement Feature Flags: Safe deployment mechanisms
  2. Enhance CI/CD: Robust automated testing and deployment
  3. Improve Monitoring: Real-time production monitoring
  4. Train Teams: Educate teams on trunk-based practices

Migration Process

  1. Feature Flag Implementation: Add feature toggles
  2. Small PR Practice: Break features into smaller slices
  3. Continuous Deployment: Implement automated deployment
  4. Full Transition: Complete migration to trunk-based model

AI Enhancement for Both Models

Trunk-Based AI Assistance

Batch Release AI Assistance

Universal AI Benefits


Next Steps


Ready to implement your delivery model? Start with our Automation Setup Guide 🚀