Skip to main content
Environment progression rules ensure that releases are deployed to prerequisite environments before they can proceed to downstream environments. This enforces a deployment pipeline where changes must pass through QA before staging, and staging before production.

Overview

Why Use Environment Progression?

Environment progression rules help you:
  • Enforce deployment order - Prevent skipping environments in your pipeline
  • Catch issues early - Problems surface in lower environments first
  • Build confidence - Each environment validates before the next
  • Meet compliance - Satisfy audit requirements for change promotion

Configuration

resource "ctrlplane_policy" "staging_requires_qa" {
  name     = "Staging Requires QA"
  selector = "environment.name == 'staging'"

  environment_progression {
    depends_on_environment_selector = "environment.name == 'qa'"
  }
}

Properties

environmentProgression.dependsOnEnvironmentSelector
string
required
CEL expression or selector matching the prerequisite environment(s). The release must be successfully deployed to environments matching this selector before proceeding.
environmentProgression.minimumSuccessPercentage
float
default:"100"
Percentage of targets in the prerequisite environment that must succeed (0-100). Use a lower value if some targets are expected to be unavailable.
environmentProgression.successStatuses
array
Job statuses considered successful. Defaults to ["successful"].
environmentProgression.minimumSoakTimeMinutes
integer
default:"0"
Minutes to wait after the dependency succeeds before allowing progression. Use this to ensure the release has time to stabilize.
environmentProgression.maximumAgeHours
integer
Maximum age (in hours) of the dependency deployment. If the prerequisite deployment is older than this, progression is blocked until redeployed.

How It Works

  1. Find dependency environments - Ctrlplane finds all environments matching the selector that share at least one system with the current environment. This prevents cross-system dependency issues.
  2. Evaluate pass rate - For each dependency environment, Ctrlplane checks if the success percentage of release targets meets the threshold.
  3. Check soak time - If minimumSoakTimeMinutes is configured, Ctrlplane verifies that enough time has elapsed since the most recent successful job.
  4. Check freshness - If maximumAgeHours is configured, Ctrlplane ensures the dependency deployment is not too old.
  5. OR logic across environments - If the selector matches multiple environments, the rule passes if at least one of them satisfies all criteria.

Common Patterns

Simple Linear Progression

Enforce QA → Staging → Production order:
resource "ctrlplane_policy" "staging_requires_qa" {
  name     = "Staging Requires QA"
  selector = "environment.name == 'staging'"

  environment_progression {
    depends_on_environment_selector = "environment.name == 'qa'"
  }
}

resource "ctrlplane_policy" "production_requires_staging" {
  name     = "Production Requires Staging"
  selector = "environment.name == 'production'"

  environment_progression {
    depends_on_environment_selector = "environment.name == 'staging'"
  }
}

Soak Time Requirements

Require the release to “soak” in staging before production:
resource "ctrlplane_policy" "production_soak_requirement" {
  name     = "Production Soak Requirement"
  selector = "environment.name == 'production'"

  environment_progression {
    depends_on_environment_selector = "environment.name == 'staging'"
    minimum_sock_time_minutes       = 60
  }
}

Freshness Requirements

Block promotion if the staging deployment is too old:
resource "ctrlplane_policy" "production_freshness" {
  name     = "Production Freshness"
  selector = "environment.name == 'production'"

  environment_progression {
    depends_on_environment_selector = "environment.name == 'staging'"
    maximum_age_hours               = 24
  }
}

Partial Success Threshold

Allow promotion when most (not all) targets succeed:
resource "ctrlplane_policy" "staging_partial_success" {
  name     = "Staging Partial Success"
  selector = "environment.name == 'staging'"

  environment_progression {
    depends_on_environment_selector = "environment.name == 'qa'"
    minimum_success_percentage      = 80
  }
}

Complete Pipeline with All Options

Full-featured production gate:
resource "ctrlplane_policy" "production_full_gate" {
  name     = "Production Full Gate"
  selector = "environment.name == 'production'"

  any_approval {
    min_approvals = 1
  }

  environment_progression {
    depends_on_environment_selector = "environment.name == 'staging'"
    minimum_success_percentage      = 100
    minimum_sock_time_minutes       = 30
    maximum_age_hours               = 48
  }

  gradual_rollout {
    rollout_type        = "linear"
    time_scale_interval = 300
  }
}

Progression Lifecycle

1. Version Created

A new deployment version is created and ready for release.

2. Lower Environment Deployment

The version is deployed to the prerequisite environment (e.g., QA).

3. Success Evaluation

Ctrlplane evaluates if the deployment meets success criteria:
  • Job status matches successStatuses
  • Success percentage meets minimumSuccessPercentage

4. Soak Time (if configured)

If minimumSoakTimeMinutes is set, the clock starts after success.

5. Progression Allowed

Once all criteria are met, the version can proceed to the next environment.

Best Practices

Timing Guidelines

TransitionSoak TimeMax AgeNotes
Dev → QA0-Fast iteration
QA → Staging0-15 min24hQuick validation
Staging → Production30-60 min48hThorough soak
Critical services2-4 hours24hExtended observation

Recommendations

  • ✅ Start with simple progression, add soak time later
  • ✅ Use maximumAgeHours to prevent stale promotions
  • ✅ Combine with verification for automated quality gates
  • ✅ Use lower minimumSuccessPercentage for environments with flaky tests
  • ✅ Document your progression requirements for the team

Next Steps