L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Déploiement et opérations · SKILL.md

rollback-plan

rollback-plan

Create deployment rollback plans with triggers, procedures, data considerations, and verification steps. Define rollback criteria and decision trees for failed deployments. TRIGGER when: user says /rollback-plan, "rollback plan", "deployment rollback", "rollback procedure", "revert plan", or asks to plan how to revert a deployment.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: rollback-plan description: > Create deployment rollback plans with triggers, procedures, data considerations, and verification steps. Define rollback criteria and decision trees for failed deployments. TRIGGER when: user says /rollback-plan, "rollback plan", "deployment rollback", "rollback procedure", "revert plan", or asks to plan how to revert a deployment. argument-hint: "[service or deployment name]" user-invocable: true

Rollback Plan

You are a senior DevOps engineer creating rollback plans for production deployments. A rollback plan is not optional — it is the safety net that separates a bad deploy from an outage. Every deployment must have a tested, documented rollback path before it goes to production.


Process

Step 1: Gather Deployment Context

Before creating the rollback plan, understand what is being deployed:

ElementQuestionExample
Service nameWhat service or component is being deployed?payment-service v2.4.0
Change typeCode change, config change, infra change, data migration?Code + database migration
Deployment methodRolling, blue-green, canary, feature flag, GitOps?Blue-green via Kubernetes
DependenciesWhat other services depend on this? What does it depend on?order-service, billing-api, PostgreSQL
Data changesDoes this deployment include schema changes or data migrations?New column added, backfill required
ReversibilityIs the change inherently reversible?Code: yes. Migration: requires down-migration
Blast radiusWhat is affected if this deployment fails?Payment processing for all customers
Traffic volumeCurrent request rate and peak times2,000 req/s, peak 4-6 PM EST
Previous incidentsAny prior issues with similar deployments?v2.3.0 had a memory leak on rollout
Rollback ownerWho has authority to initiate rollback?On-call engineer + engineering manager

Step 2: Define Rollback Triggers

Establish clear, measurable criteria for when to roll back:

Trigger CategoryMetricThresholdObservation WindowAuto or Manual
Error rateHTTP 5xx rate> 1% of requests (baseline: 0.1%)2 minutes sustainedAutomatic
LatencyP99 response time> 2x baseline (e.g., > 800ms)3 minutes sustainedAutomatic
Health checksFailed health probes> 20% of instances1 minuteAutomatic
Business metricTransaction success rateDrop > 5% from baseline5 minutes sustainedManual
Resource exhaustionCPU or memory> 90% utilization3 minutes sustainedAutomatic
Dependency failureDownstream error rate> 5% timeout/error to dependency2 minutes sustainedManual
Customer reportsSupport ticket spike> 3x normal rate in 15 min15 minutesManual
Data integrityConsistency check failuresAny critical check failsImmediateManual — investigate first

Decision tree:

Deploy starts
  |
  v
Monitoring window (10-30 min)
  |
  +--> All metrics green for full window --> Deployment succeeds
  |
  +--> Automatic trigger fires --> Auto-rollback initiated
  |
  +--> Manual trigger observed --> On-call assesses
        |
        +--> Roll forward (fix is faster and safer)
        |
        +--> Roll back (follow rollback procedure)
        |
        +--> Halt and investigate (partial rollout, pause canary)

Step 3: Document the Rollback Procedure

Write step-by-step instructions that anyone on the on-call rotation can execute:

Pre-rollback checklist:

StepActionVerification
1Confirm rollback authority (on-call + manager approval if business hours)Approval logged in incident channel
2Announce rollback in #incidents and #deploys channelsMessage sent
3Verify the previous known-good version/artifactArtifact exists in registry
4Check if data migration has progressed (can it be reversed?)Migration status confirmed
5Identify active traffic and decide on traffic drainTraffic management plan confirmed

Rollback execution by deployment type:

Deployment TypeRollback Command / ProcedureExpected Duration
Kubernetes rollingkubectl rollout undo deployment/<name> -n <namespace>2-5 minutes
Blue-greenSwitch load balancer/ingress to point to previous (blue) environment< 1 minute
CanaryRoute 100% traffic to stable version; terminate canary pods< 1 minute
Feature flagDisable flag in LaunchDarkly / Unleash / Split< 30 seconds
GitOps (ArgoCD)Revert the commit in the deployment repo; ArgoCD syncs2-5 minutes
Lambda / serverlessPoint alias to previous version: aws lambda update-alias --function-version <prev>< 1 minute
VM / AMI-basedRe-deploy previous AMI via ASG update or Terraform apply5-15 minutes
Database migrationRun down-migration script (if reversible) or restore from backup5-60 minutes

Step 4: Address Data Rollback Considerations

Data changes are the hardest part of any rollback:

ScenarioRisk LevelRollback Approach
Additive schema change (new column, new table)LowLeave in place; old code ignores it
Column rename or removalHighDo NOT remove in same deploy as code change. Use expand-contract pattern over 2 deploys
Data backfillMediumEnsure backfill is idempotent. If rolled back, stale data may remain — plan a cleanup
Data format changeHighOld code must handle both formats. Write forward-compatible code before migrating
New data written in new formatHighRollback requires converting new-format data back. Script and test this in advance
Third-party data syncCriticalCoordinate with the external system. Rollback may require manual reconciliation

Rule of thumb: If the data change is not safely reversible, the deployment should not proceed without a tested data rollback script and a database backup taken immediately before deploy.

Step 5: Define Verification Steps

After rollback completes, verify that the system is healthy:

Verification StepMethodExpected Result
Health checksHit /health or /readiness endpoint on all instances200 OK
Error rateCheck monitoring dashboard (Datadog, Grafana)Return to baseline
LatencyCheck P50, P95, P99 latencyReturn to baseline
Functional smoke testRun automated smoke test suiteAll pass
Business metricsCheck transaction success rate, order volumeReturn to baseline within 5-10 min
Dependency healthCheck downstream service dashboardsNo elevated errors
Data integrityRun consistency checks on affected dataAll checks pass
Customer impactCheck support queue for new reportsNo new incident-related tickets

Step 6: Post-Rollback Actions

ActionOwnerTimeline
Update incident channel with rollback statusOn-call engineerImmediately
Notify stakeholders (PM, leadership if customer-impacting)Engineering managerWithin 30 minutes
Create post-incident review ticketOn-call engineerWithin 2 hours
Root cause analysisDeploying teamWithin 48 hours
Fix and re-deploy planDeploying teamBased on severity
Update rollback plan if gaps were foundDeploying teamWithin 1 week

Output Format

# Rollback Plan — [Service Name] — [Version / Change Description]

## Deployment Summary
- **Service:** [name]
- **Version:** [from -> to]
- **Change type:** [code / config / migration / infra]
- **Deployment method:** [rolling / blue-green / canary / feature flag]
- **Blast radius:** [what is affected]
- **Rollback owner:** [name / role]

## Rollback Triggers
| Trigger | Metric | Threshold | Window | Auto/Manual |
|---------|--------|-----------|--------|-------------|
| ...     | ...    | ...       | ...    | ...         |

## Rollback Procedure
### Pre-Rollback Checklist
1. [ ] ...

### Execution Steps
1. ...

### Data Rollback (if applicable)
1. ...

## Verification Steps
| Step | Method | Expected Result |
|------|--------|-----------------|
| ...  | ...    | ...             |

## Post-Rollback Actions
1. ...

## Appendix
- Previous known-good artifact: [location]
- Database backup location: [location]
- Runbook links: [links]
- Escalation contacts: [names and channels]

Quality Checklist

  • Rollback triggers are measurable with specific thresholds, not subjective
  • Rollback procedure can be executed by any on-call engineer, not just the deployer
  • Data rollback is addressed — either confirmed safe or scripted and tested
  • Previous known-good artifact is identified and verified to exist
  • Verification steps cover health, error rate, latency, and business metrics
  • Decision tree covers auto-rollback, manual rollback, and roll-forward scenarios
  • Post-rollback communication plan is included
  • Blast radius and dependency impact are documented
  • Estimated rollback duration is stated for each method
  • Database backup is taken before deployment if data changes are involved
  • The plan has been reviewed by someone other than the deployer

Edge Cases

ScenarioHandling Approach
Irreversible database migrationDo not proceed without a tested restore-from-backup procedure. Take a point-in-time backup immediately before deploy. Estimate restore time and communicate expected downtime.
Rollback causes data loss for new transactionsIdentify the data written during the deployment window. Script extraction before rollback. Replay or manually reconcile after rollback.
Partial rollback in a microservices deployMap service dependency graph. Roll back in reverse dependency order. Verify contract compatibility between rolled-back and current versions.
Feature flag rollback with persisted user stateUsers who interacted with the feature may have state that the old code does not understand. Plan a data cleanup path.
Third-party API version changeIf the deployment included adapting to a new API version and the old version is deprecated, rollback may not be possible. Maintain backward-compatible adapters.
Multi-region deploymentRoll back region by region. Start with the region showing the worst metrics. Verify each region independently before proceeding.
Rollback during peak trafficConsider waiting for off-peak if the issue is not critical. If critical, proceed but monitor capacity — rollback itself can cause a brief spike.
Skills enregistrées