Auto Rollback is a safety feature that automatically rolls back deployments when specific error conditions are met. This feature helps maintain system stability by reverting to the default branch when critical issues are detected during or after deployment.

Overview

When enabled, Auto Rollback monitors deployments for anomalies and automatically triggers a rollback to the default branch (main/master) if the configured conditions are met. The system evaluates both code-related issues and deployment-time anomalies based on your settings.

Configuration

To configure Auto Rollback:

  1. Navigate to your project settings
  2. Find the “Auto Rollback” section
  3. Click “Add rollback rule”
  4. Configure the following settings:

Settings Explained

  • Target: Select the deployment target to apply the rule to
  • Rollback on anomalies: Choose from four detection modes (explained below)
  • Anomaly threshold: Set the number of errors that trigger a rollback (minimum: 1)

Detection Modes

  1. Only code-related

    • Triggers rollback when code-specific issues are detected
    • Example: New errors in application logs that match the deployed code changes
    • Does not consider deployment-time issues
    • Use case: When you want to focus on code quality issues
  2. Any during deployment

    • Triggers rollback for any issues during the deployment process
    • Includes: Infrastructure errors, configuration issues, service availability problems
    • Does not consider post-deployment code issues
    • Use case: When deployment stability is critical
  3. Code-related or any during deployment

    • Triggers rollback if EITHER condition is met:
    • Code-related issues OR deployment-time issues
    • More sensitive detection mode
    • Use case: Maximum protection against any type of failure
  4. Code-related and during deployment

    • Triggers rollback only when BOTH conditions are met:
    • Code-related issues AND deployment-time issues
    • Most conservative detection mode
    • Use case: When you want to avoid false positives

How Rollback Works

When a rollback is triggered:

  1. The current deployment is stopped
  2. The system initiates a new deployment using your default branch (main/master)
  3. All services are restored to their state from the default branch
  4. A notification is sent to configured channels

Example Scenarios

Scenario 1: Code-Only Issues

Current State: Feature branch deployed
Error Detected: Spike in error rates matching code changes
Result: System rolls back to main branch if using "Only code-related" or combined modes

Scenario 2: Deployment Issues

Current State: Deployment in progress
Error Detected: Service availability drops during deployment
Result: System rolls back if using "Any during deployment" or combined modes

Best Practices

  1. Start with a higher error threshold (e.g., 3-5) and adjust based on your needs
  2. Use “Code-related and during deployment” for critical systems to avoid false positives
  3. Configure alerts to notify teams when auto-rollbacks occur
  4. Review auto-rollback incidents to improve deployment processes

Limitations

  • Only rolls back to the default branch (main/master)
  • Minimum error threshold is 1
  • Requires proper error correlation configuration
  • Cannot roll back to specific previous versions

Troubleshooting

If Auto Rollback isn’t triggering as expected:

  1. Check error threshold settings
  2. Verify deployment target configuration
  3. Verify deploy slack notification channel configuration
  4. Ensure proper permissions are set
  5. Check deployment monitor logs

FAQ

Q: Can I rollback to a specific previous version?

A: No, Auto Rollback always deploys the default branch (main/master).

Q: What happens if the rollback itself fails?

A: You should always keep the default branch green.

Q: Can I have different rules for different environments?

A: Yes, rules are configured per deployment target.

Q: Can I enable approval for rollback?

A: Yes, approval settings are the same as regular deployments.