-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
Port 4 battle-tested safety and DX features from STAT-545's quick-deploy.sh into teach deploy. These are additive improvements — no breaking changes on the happy path. CI mode remains fully non-interactive.
Enhancements
1. Trap Handler for Branch Safety
trap "git checkout '$draft_branch'" EXIT INT TERM in both direct merge and PR modes. Guarantees return to draft branch on any error/signal instead of relying on manual checkout in each error path.
2. GitHub Actions Monitoring Link
Add Actions: line to the deploy summary box, showing https://github.com/<owner>/<repo>/actions. Extracted from remote.origin.url. Skipped for non-GitHub remotes.
3. Pre-Commit Hook Failure Recovery
When git commit fails during deploy (likely pre-commit hook), show actionable 3-option recovery:
- Fix issues, re-run
teach deploy - Skip validation:
QUARTO_PRE_COMMIT_RENDER=0 teach deploy ... - Force commit:
git commit --no-verify -m "message"
4. Uncommitted Changes Prompt (Direct Mode)
Instead of blocking with "working tree dirty", prompt to commit with a smart message. CI mode still fails fast.
Acceptance Criteria
- Trap handler returns to draft branch on any error/signal in both modes
- Deploy summary box includes GitHub Actions URL
- Pre-commit hook failures show actionable recovery message
-
teach deploy -dwith uncommitted changes prompts to commit -
--cimode: uncommitted changes fail, hook failures exit non-zero - All existing tests pass unchanged
- New tests cover trap, hook failure, uncommitted prompt paths
Spec
See docs/specs/SPEC-teach-deploy-safety-2026-02-08.md on dev branch.
Version Target
v6.6.0