Skip to content

Conversation

@Data-Wise
Copy link
Owner

@Data-Wise Data-Wise commented Feb 4, 2026

Summary

  • Direct merge mode (teach deploy -d): deploy in 8-15 seconds by pushing directly to production branch, no PR required
  • Deploy history tracking: append-only YAML log at .flow/deploy-history.yml with --history viewer
  • Safe rollback (teach deploy --rollback N): forward rollback via git revert with merge commit auto-detection (-m 1)
  • Smart commit messages: auto-generated from changed file paths (lectures → content:, config → config:, mixed → deploy:)
  • Dry-run preview (--dry-run): see exactly what would happen without executing
  • CI mode (--ci): non-interactive for automation, auto-detects TTY

Files changed (28 files, +5,102/-704)

Core implementation:

  • lib/dispatchers/teach-deploy-enhanced.zsh — main deploy orchestration
  • lib/deploy-history-helpers.zsh — history tracking (189 lines)
  • lib/deploy-rollback-helpers.zsh — rollback via git revert (229 lines)
  • lib/git-helpers.zsh — smart commit message generation (214 lines)

Tests (110 new tests):

  • tests/test-teach-deploy-v2-unit.zsh — 36 unit tests
  • tests/e2e-teach-deploy-v2.zsh — 23 E2E tests (incl. merge commit rollback)
  • tests/dogfood-teach-deploy-v2.zsh — 51 dogfood tests against demo-course fixture

Documentation:

  • Tutorial 31, REFCARD-DEPLOY-V2, TEACH-DEPLOY-GUIDE, CHANGELOG
  • API reference, dispatcher guide, quick reference updated
  • VHS tape rewritten + GIF regenerated (258KB)
  • Version badges synced to v6.4.0

Test plan

  • 36 unit tests passing
  • 23 E2E tests passing (including merge commit rollback regression)
  • 51 dogfood tests passing against demo-course fixture
  • mkdocs build --strict — 0 errors, 0 warnings
  • Manual: teach deploy -d on a real course repo
  • Manual: teach deploy --rollback 1 after a deploy

🤖 Generated with Claude Code

Test User and others added 12 commits February 3, 2026 19:27
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…k, dry-run, CI mode

Complete reimplementation of teach deploy with 8 features:
- Direct merge mode (--direct/-d): 8-15s deploys vs 45-90s PR workflow
- Smart commit messages: auto-categorized from changed file paths
- Deploy history: append-only .flow/deploy-history.yml tracking
- Rollback (--rollback [N]): forward rollback via git revert
- Dry-run (--dry-run/--preview): preview without mutation
- CI mode (--ci): auto-detect TTY, skip all prompts
- .STATUS auto-updates: teaching_week, deploy_count, last_deploy
- Shared preflight: extracted _deploy_preflight_checks()

Also removes ~313 lines of legacy _teach_deploy() dead code from
teach-dispatcher.zsh. 76 new tests (34 unit + 22 integration + 20 E2E).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Version bumps (v6.3.0 → v6.4.0)
- New files in project structure (deploy-history/rollback helpers)
- Test count updated (462 → 538+)
- v6.4.0 release notes with all 8 features documented
- Key files table updated

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Non-interactive dogfooding that loads the full plugin and tests
against the demo-course fixture (STAT-101). Covers all 10 feature
areas: function loading, help output, smart commits, deploy history,
rollback, preflight, dry-run, .STATUS updates, flag parsing, and
full deploy lifecycle E2E.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- REFCARD-DEPLOY-V2.md: Quick reference for all 10 flags, deploy
  modes, smart commits, history, rollback, CI mode, .STATUS updates
- Tutorial 31: Step-by-step guide to teach deploy v2 features
- TEACH-DEPLOY-GUIDE.md: Updated with direct merge mode, history,
  rollback, dry-run, and CI mode sections (v6.1.0 → v6.4.0)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Tutorial 31 under Core Workflows > Deployment
- REFCARD-DEPLOY-V2 under Quick Reference Cards

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix merge commit rollback: detect parent count and pass -m 1 to
  git revert for merge commits (previously always failed silently)
- Fix commit_before reference: capture production branch HEAD instead
  of current (draft) branch HEAD for accurate rollback history
- Add dirty worktree guard: _deploy_direct_merge now fails fast if
  working tree is dirty, preventing state leakage to production
- Remove contradictory --no-edit from git commit --amend -m
- Sanitize all YAML heredoc fields in deploy history (branch_from,
  branch_to, mode, user), not just commit_message
- Capture git stderr on critical operations (push, merge, revert,
  checkout) and include in error messages instead of suppressing
- Fix dead code: partial deploy dry-run condition was unreachable
  (checked partial_deploy != true inside partial_deploy == true block)
- Add _deploy_cleanup_globals() to unset DEPLOY_* variables after
  deploy completes, preventing shell environment pollution

All 127 tests passing (34 unit + 22 integration + 20 E2E + 51 dogfood).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 5 new tests covering the -m 1 fix for merge commit rollback:

E2E (3 tests):
- Diverged deploy creates merge commit (2 parents)
- Merge commit rollback succeeds via -m 1
- Merge commit rollback records with mode=rollback

Unit (2 tests):
- Merge commit detected with 2 parents
- Regular commit detected with 1 parent

Also removes lenient skip from Test 19 (fast-forward rollback now
passes correctly) — converts 2 prior skips into passing assertions.

Total: 36 unit + 23 E2E = 59 tests (0 failures, 0 skips)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CLAUDE.md: test counts 538→543, per-suite counts (36 unit, 23 E2E)
- CHANGELOG.md: add v6.4.0 entry (Added, Fixed, Documentation, Tests)
- MASTER-API-REFERENCE.md: add 14 deploy v2 function signatures
- MASTER-DISPATCHER-GUIDE.md: expand deploy section with v2 flags/workflows
- QUICK-REFERENCE.md: expand deploy commands (2→5 entries)
- REFCARD-DEPLOY-V2.md: add merge commit auto-detection note
- Tutorial 31: fix misleading --rollback 3 description
- VHS tape: rewrite for v2 commands (--direct, --history, --rollback)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Regenerated tutorial-teach-deploy.gif from updated VHS tape (258KB)
- Embedded GIF in Tutorial 31 (after What You'll Learn)
- Embedded GIF in TEACH-DEPLOY-GUIDE.md (after header)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Data-Wise Data-Wise merged commit 9eca021 into dev Feb 4, 2026
1 check passed
@Data-Wise Data-Wise mentioned this pull request Feb 4, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants