-
Notifications
You must be signed in to change notification settings - Fork 0
feat: teach deploy v2 — direct merge, history, rollback #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-Authored-By: Claude Opus 4.5 <[email protected]>
…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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
- 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 <[email protected]>
- Tutorial 31 under Core Workflows > Deployment - REFCARD-DEPLOY-V2 under Quick Reference Cards Co-Authored-By: Claude Opus 4.5 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- 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 <[email protected]>
- 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 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
teach deploy -d): deploy in 8-15 seconds by pushing directly to production branch, no PR required.flow/deploy-history.ymlwith--historyviewerteach deploy --rollback N): forward rollback viagit revertwith merge commit auto-detection (-m 1)content:, config →config:, mixed →deploy:)--dry-run): see exactly what would happen without executing--ci): non-interactive for automation, auto-detects TTYFiles changed (28 files, +5,102/-704)
Core implementation:
lib/dispatchers/teach-deploy-enhanced.zsh— main deploy orchestrationlib/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 teststests/e2e-teach-deploy-v2.zsh— 23 E2E tests (incl. merge commit rollback)tests/dogfood-teach-deploy-v2.zsh— 51 dogfood tests against demo-course fixtureDocumentation:
Test plan
mkdocs build --strict— 0 errors, 0 warningsteach deploy -don a real course repoteach deploy --rollback 1after a deploy🤖 Generated with Claude Code