Two PRs merged a minute apart; both deploy jobs ran and the older commit finished last, so production now runs the older version.

AdvancedTroubleshootingPipeline outages
Answer

Likely causes → No concurrency control on the deploy workflow. The runs raced, and the one that took longer (cache miss, slower runner) applied last, silently rolling back the newer change.

Diagnose →

gh run list --workflow deploy.yml --limit 5 --json headSha,createdAt,updatedAt,conclusion
kubectl get deploy api -o jsonpath='{.spec.template.spec.containers[0].image}'

Fix → Redeploy the latest commit on main.

Prevent → Serialize deploys per environment:

concurrency:
  group: deploy-prod
  cancel-in-progress: false

Add a guard that refuses to deploy a commit older than what's running (compare against the deployed SHA), or move to GitOps where Git order decides what runs.

All Real-World Interview questions Roadmap: Interview readiness

More on Pipeline outages