| name | shipping-and-launch |
| description | Prepares production launches. Use when preparing to deploy to production. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. |
Shipping and Launch
Overview
Every production deploy is a risk management exercise. Move fast by being deliberate: know what you're deploying, have a rollback plan, verify the system is healthy after deploy, and keep the blast radius small. The fastest way to ship is to have a clean rollback when things go wrong — not to avoid deploying.
When to Use
- Before any deployment to the Cloud Run production environment
- When deploying a feature that changes user-facing behavior
- When updating environment variables or secrets in GCP
- When rolling out a new API endpoint or removing an old one
Pre-Deploy Checklist
Run this before triggering any Cloud Build deploy:
Code Quality
Security
Observability
Documentation
Rollback Readiness
Rollback Procedure
GitScape deploys to Cloud Run. Rolling back is instant:
gcloud run revisions list \
--service=gitscape-api \
--region=us-central1 \
--format="table(name,status.conditions[0].status,spec.containerConcurrency,metadata.creationTimestamp)"
gcloud run services update-traffic gitscape-api \
--to-revisions=PREVIOUS_REVISION_NAME=100 \
--region=us-central1
When to roll back:
- Error rate rises above 1% after deploy
- p95 latency exceeds 5 seconds
- Any Critical or High security finding is confirmed in production
- User-reported regressions in core functionality
Feature Flag Lifecycle
For high-risk features, deploy behind a feature flag:
FF_SKILL_HD_TIER = os.getenv("FF_SKILL_HD_TIER", "false").lower() == "true"
Flag cleanup: Remove the flag code (and the env var) once the feature has been stable for at least 7 days.
Staged Rollout
For high-confidence changes, deploy to all traffic immediately. For risky changes, use Cloud Run traffic splitting:
gcloud run services update-traffic gitscape-api \
--to-revisions=NEW_REVISION=10,CURRENT_REVISION=90 \
--region=us-central1
gcloud run services update-traffic gitscape-api \
--to-latest \
--region=us-central1
Post-Deploy Verification
After every deploy, verify within 10 minutes:
gcloud run revisions describe $(gcloud run revisions list \
--service=gitscape-api --region=us-central1 \
--format="value(name)" --limit=1) \
--region=us-central1
curl https://api.gitscape.app/health
curl -X POST https://api.gitscape.app/api/skills \
-H "Content-Type: application/json" \
-d '{"repo": "addyosmani/agent-skills"}'
gcloud logging read \
'resource.type="cloud_run_revision" AND severity>=ERROR' \
--freshness=10m \
--limit=20
Green signals:
- Health check returns 200
- Smoke test returns a skill bundle
- No ERROR-level log lines in the 10 minutes post-deploy
Red signals (trigger rollback immediately):
- Health check fails
- Smoke test returns 5xx
- Error rate visible in Cloud Logging
Common Rationalizations
| Rationalization | Reality |
|---|
| "I'll skip the checklist this once — it's a small change" | The small change you skip the checklist for is the one that goes wrong. |
| "I don't need a rollback plan — I'm confident in the change" | Confidence is not a rollback plan. |
| "We can fix it forward if something goes wrong" | Fixing forward takes longer than rolling back. Have the rollback ready. |
Red Flags
- Deploying without running tests
- No knowledge of the previous working revision
- Secrets visible as plaintext in
cloudbuild.yaml
- No post-deploy verification
- Feature flag deployed but never cleaned up
Verification
Before declaring a deploy successful: