TUTORIAL 08

Release & Deploy

Sprint 3 is complete. 8 stories merged to develop. Time to ship v2.0.0.

โฑ ~15 min ยท Hands-on

/agile-code-branch /agile-code-merge /agile-ship-release /agile-security-scan /agile-code-ci /agile-ship-changelog /agile-ship-deploy /agile-ship-rollback
Scenario

Sprint 3 just wrapped. The team completed 8 user stories on the develop branch: task filtering, user permissions, notification preferences, and more. All stories passed their Definition of Done. It's time to cut a release and ship to production.

Step 1: Create the Release Branch

A release branch freezes the feature set. From this point, only bug fixes are allowed โ€” no new features.

/agile-code-branch release/v2.0.0 --from develop
Branch created: release/v2.0.0 (from develop)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Base branch: develop (up to date)
Switched to: release/v2.0.0
Tracking: origin/release/v2.0.0
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โœ… Ready โ€” release branch created from develop
Release Branch Rule

Only bug fixes are allowed on the release branch. No new features, no refactoring, no experiments. If a feature isn't ready, it stays on develop for the next release.

Step 2: Full CI Pipeline

Run the complete pipeline on the release branch to verify everything works together.

/agile-code-ci
CI Pipeline โ€” release/v2.0.0
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Build .................. โœ… PASS (18s)
Unit Tests ............. โœ… 142/142 passing (41s)
Integration Tests ...... โœ… 24/24 passing (33s)
E2E Tests .............. โœ… 12/12 passing (67s)
Lint ................... โœ… 0 issues
Code Coverage .......... โœ… 84% (threshold: 80%)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Result: โœ… ALL CHECKS PASSED

Step 3: Security Scan

Before any production release, scan dependencies for known vulnerabilities.

/agile-security-scan
Security Scan โ€” release/v2.0.0
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Dependencies scanned: 87
Vulnerabilities found:

  ๐Ÿ”ด Critical:  0
  ๐ŸŸ  High:      0
  ๐ŸŸก Medium:    1
  ๐Ÿ”ต Low:       0

Details:
  ๐ŸŸก lodash@4.17.20 โ€” Prototype Pollution (CVE-2021-23337)
     Severity: Medium
     Fix: upgrade to lodash@4.17.21

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Action Required: 1 medium vulnerability

Fix the Vulnerability

npm update lodash
# or
npm install lodash@4.17.21

Re-scan to confirm:

/agile-security-scan
Dependencies scanned: 87
Vulnerabilities found: 0

โœ… CLEAN โ€” no known vulnerabilities

Step 4: QA on Staging

Deploy the release branch to the staging environment. @qa runs exploratory testing.

QA Report

Exploratory Testing โ€” staging/v2.0.0
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Tested flows:
  โœ… User registration and login
  โœ… Task creation and editing
  โœ… Task filtering by status (new feature)
  โœ… User permissions (new feature)
  โœ… Notification preferences (new feature)
  โŒ Task export to CSV โ€” date format incorrect

Bug found:
  BUG-078: CSV export uses MM/DD/YYYY instead of ISO 8601
  Severity: Minor
  Fix: Update date formatter in CsvExporter

Fix the bug on the release branch:

/agile-code-commit
fix(export): use ISO 8601 date format in CSV export
โš ๏ธ Bug Fixes Only

This fix is allowed because it's a bug. If @qa had requested a new "export to PDF" feature, it would be rejected โ€” new features go into the next sprint, not the release branch.

Step 5: Version Bump

Update the version number in your project manifest.

# package.json
{
  "name": "task-manager",
  "version": "2.0.0",
  ...
}
/agile-code-commit
chore(release): bump version to 2.0.0

Step 6: Generate Changelog with /agile-ship-changelog

Before cutting the release, generate a structured changelog from all the commits on the release branch:

/agile-ship-changelog

CHANGELOG โ€” v2.0.0

## v2.0.0 (2026-04-04)

### Features
- feat(tasks): add task filtering by status (#42)
- feat(users): role-based permission system (#45)
- feat(notifications): user notification preferences (#48)
- feat(tasks): bulk task operations (#50)
- feat(dashboard): sprint velocity chart (#51)

### Bug Fixes
- fix(export): use ISO 8601 date format in CSV export (#BUG-078)
- fix(auth): session timeout now respects user timezone (#BUG-071)

### Security
- chore(deps): upgrade lodash to 4.17.21 (CVE-2021-23337)

### Internal
- refactor(user): split UserService into focused services
- test: increase coverage from 72% to 84%
/agile-ship-changelog vs. /agile-ship-release

/agile-ship-changelog generates the changelog from commit history โ€” grouping by type (features, fixes, security, internal) and linking to PRs. /agile-ship-release handles the broader release process including version bumping and tagging. Use changelog first to review what's included, then release to finalize.

Step 6b: Finalize the Release

/agile-ship-release

This command finalizes the release โ€” applying the version tag and preparing the release artifacts.

Step 7: Merge the Release Branch

A release branch must merge to both main (production) and develop (so bug fixes flow back). The /agile-code-merge command handles the complete release merge workflow in one step: merge to main, merge to develop, tag, push, and clean up the branch.

/agile-code-merge release/v2.0.0
Merge โ€” release/v2.0.0
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Detected: release branch โ†’ merging to main + develop

Merge to main:
  Strategy: --no-ff (preserves branch history)
  Commit: Merge branch 'release/v2.0.0' into main
  Result .................. โœ… merged

Merge to develop:
  Strategy: --no-ff (preserves branch history)
  Commit: Merge branch 'release/v2.0.0' into develop
  Result .................. โœ… merged

Tag:
  Created: v2.0.0 (annotated)
  Message: "Release v2.0.0"
  Result .................. โœ… tagged

Push:
  main .................... โœ… pushed
  develop ................. โœ… pushed
  v2.0.0 .................. โœ… pushed

Cleanup:
  Local branch ............ โœ… deleted release/v2.0.0
  Remote branch ........... โœ… deleted origin/release/v2.0.0

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โœ… Release v2.0.0 merged, tagged, and cleaned up
Both Merges Are Mandatory

Just like hotfixes, a release branch merges to both main and develop. /agile-code-merge detects the release/ prefix and automatically performs both merges. Skipping the develop merge would mean the CSV date fix (BUG-078) and the lodash upgrade are lost in future development.

What /agile-code-merge does for release branches

/agile-code-merge recognizes the release/ prefix and performs the full release merge flow: merge to main with --no-ff (preserving branch history), merge to develop with --no-ff, create an annotated tag from the version in the branch name, push all changes, and delete the release branch locally and on the remote.

Step 8: Deploy to Production

/agile-ship-deploy
Deploy โ€” v2.0.0 โ†’ production
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Pre-deploy checks:
  Tag exists .............. โœ… v2.0.0
  CI passed ............... โœ… all green
  Security scan ........... โœ… 0 vulnerabilities
  QA sign-off ............. โœ… approved

Rolling deploy:
  pod-1/4 ................. โœ… healthy
  pod-2/4 ................. โœ… healthy
  pod-3/4 ................. โœ… healthy
  pod-4/4 ................. โœ… healthy

Post-deploy validation:
  Health checks ........... โœ… all endpoints responding
  Smoke test: login ....... โœ… pass
  Smoke test: tasks ....... โœ… pass
  Smoke test: filtering ... โœ… pass (new feature)
  Smoke test: export ...... โœ… pass (bug fix verified)
  Error rate .............. โœ… 0.02% (baseline: 0.03%)
  Response time p99 ....... โœ… 180ms (baseline: 195ms)

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Deploy complete: v2.0.0 is LIVE
Time: 2026-04-04 14:22 UTC
If the deploy fails: /agile-ship-rollback

If health checks fail, error rates spike, or smoke tests don't pass after deploying, roll back immediately:

/agile-ship-rollback
โช Rollback โ€” v2.0.0 โ†’ v1.9.0
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Reason: post-deploy smoke test failure
Rolling back to: v1.9.0 (last known good)

  pod-1/4 ............. โœ… rolled back
  pod-2/4 ............. โœ… rolled back
  pod-3/4 ............. โœ… rolled back
  pod-4/4 ............. โœ… rolled back

Health checks ......... โœ… all endpoints responding
Error rate ............ โœ… returned to baseline

Rollback complete. Production is on v1.9.0.
โš ๏ธ Investigate and fix the issue on the release branch before re-deploying.

Always have a rollback plan before deploying. /agile-ship-rollback reverts production to the previous version in seconds. It's faster and safer than debugging a broken deploy in production.

Step 9: Notify Stakeholders

The release branch was already cleaned up by /agile-code-merge in Step 7. All that's left is notifying stakeholders:

๐Ÿ“ข Release Notification โ€” v2.0.0

Task Manager v2.0.0 is now live in production.

New features:
โ€ข Task filtering by status
โ€ข Role-based permissions
โ€ข Notification preferences
โ€ข Bulk task operations
โ€ข Sprint velocity chart

Bug fixes: 2 resolved
Security: lodash upgraded (CVE-2021-23337)

Release notes: https://github.com/team/task-manager/releases/v2.0.0

Release Flow

๐ŸŒฟ
/agile-code-branch release from develop
โš™๏ธ
/agile-code-ci full pipeline
๐Ÿ”’
/agile-security-scan dep check
๐Ÿงช
QA staging test
๐Ÿ”ข
Version Bump changelog
๐Ÿ”€
/agile-code-merge main + develop + tag
๐Ÿš€
/agile-ship-deploy production

What You Practiced

Knowledge Check

Where does a release branch merge?