8.5 KiB
8.5 KiB
Migration Summary: SSH → GitHub Actions
Date: 2025-12-02 Decision: Adopt hybrid approach (n8n + GitHub Actions) Timeline: 3-4 days Status: Ready to implement
🎯 Decision Summary
RECOMMENDATION: Hybrid Approach (Option A)
Reasoning:
- ✅ Risk: Low - builds on working n8n infrastructure
- ✅ Benefits: 40-60% simpler, better error handling, native logging
- ✅ Time: 3-4 days (acceptable for significant improvement)
- ✅ Future-proof: Positions for full GitHub Actions migration later
- ✅ Learning: Team gains Python SDK experience
Rejected:
- ❌ Full GitHub Actions (Option B): Too complex, requires Gitea Actions support check
- ❌ Stay SSH (Option C): Works but technical debt, outdated approach
📊 Quick Comparison
| Metric | Current (SSH) | New (GitHub Actions) |
|---|---|---|
| Architecture | n8n → SSH → CLI | n8n → HTTP → Actions |
| Complexity | 11 nodes | 5 nodes |
| Authentication | SSH keys | GitHub token |
| Logging | Basic | Structured + Artifacts |
| Retry Logic | Custom n8n logic | GitHub Actions native |
| Error Handling | Manual | Built-in + SDK |
| Lines of Code | ~300 | ~150 |
| Setup Time | 4-5 hours (done) | 3-4 days (new) |
📋 Implementation Plan
Phase 1: GitHub Actions Setup (Day 1)
Duration: 2-3 hours
Tasks:
- Create GitHub repository or mirror from Gitea
- Add workflow file:
.github/workflows/openhands-build.yml - Add agent script:
.github/scripts/agent_build.py - Configure GitHub secrets:
OPENHANDS_API_KEY(from/home/bam/openhands/.env)GITEA_API_TOKEN(generate in Gitea)
- Configure GitHub variables:
LLM_MODEL:anthropic/claude-sonnet-4-5-20250929GITEA_API_URL:https://git.oky.sh
- Test manually via GitHub Actions UI
- Verify logs uploaded as artifacts
- Verify Gitea status update works
Success Criteria:
- GitHub Actions runs successfully
- OpenHands SDK executes build task
- Logs and artifacts captured
- Gitea status updated automatically
Phase 2: n8n Integration (Day 2)
Duration: 3-4 hours
Tasks:
- Update existing workflow (ID: j1MmXaRhDjvkRSLa)
- Replace SSH node with HTTP node (GitHub Actions trigger)
- Add HTTP node for GitHub Actions status check
- Simplify data flow (remove $node pattern complexity)
- Test n8n → GitHub Actions trigger
- Test GitHub Actions → n8n callback
- Verify data preservation works
- Test with real repository push
Success Criteria:
- n8n triggers GitHub Actions successfully
- GitHub Actions reports back to n8n
- Workflow completes end-to-end
- Simpler code (no SSH wrapper)
Phase 3: Error Handling & Retry (Day 3)
Duration: 2-3 hours
Tasks:
- Test failure scenarios
- Verify retry logic (GitHub Actions can be re-triggered)
- Test max retries (stop after 3 attempts)
- Verify error messages are clear
- Test with intentional build failures
- Ensure Gitea status updates on failure
- Test with multiple repositories
Success Criteria:
- Build failures detected correctly
- Retry attempts work (max 3)
- Error messages helpful and actionable
- Gitea status reflects actual state
Phase 4: Documentation & Cleanup (Day 4)
Duration: 2-3 hours
Tasks:
- Update
phase3.mdwith new approach - Document all configuration steps
- Create troubleshooting guide
- Archive old SSH approach files
- Test with production project
- Verify all scenarios work
- Update project README
- Create migration checklist
Success Criteria:
- Complete documentation
- Production-ready system
- All tests passing
- Clean codebase
📁 Files Created
New Files
- ✅
/home/bam/claude/mvp-factory/.github/workflows/openhands-build.yml - ✅
/home/bam/claude/mvp-factory/.github/scripts/agent_build.py - ✅
/home/bam/claude/mvp-factory/NEW_APPROACH_ANALYSIS.md - ✅
/home/bam/claude/mvp-factory/GITHUB_ACTIONS_INTEGRATION_GUIDE.md - ✅
/home/bam/claude/mvp-factory/MIGRATION_SUMMARY.md(this file)
Files to Modify
- 📝
phase3.md- Update with new approach - 📝
N8N_DATA_PRESERVATION_SOLUTION.md- Update for GitHub Actions - 📝
openhands-subagents-doc.md- Add SDK examples
Files to Deprecate
- 📦
/home/bam/claude/mvp-factory/test-scripts/openhands-sdk-wrapper-sh.sh(SSH approach)
🔑 Required Credentials
GitHub Repository Secrets
OPENHANDS_API_KEY: sk-... (from /home/bam/openhands/.env)
GITEA_API_TOKEN: gitea_token_... (generate in Gitea)
GitHub Repository Variables
LLM_MODEL: anthropic/claude-sonnet-4-5-20250929
GITEA_API_URL: https://git.oky.sh
n8n Credentials
GitHub Token: github_pat_... (with repo + workflow scopes)
Gitea API Token: gitea_token_...
🎯 Key Benefits
Technical Benefits
- Simpler Architecture: 11 nodes → 5 nodes
- Better Error Handling: SDK native + Actions structured
- Cleaner Logging: File-based + artifact upload
- Standard Patterns: GitHub Actions ecosystem
- No SSH Complexity: Remove wrapper script, keys
Operational Benefits
- Easier Debugging: GitHub Actions UI
- Better Visibility: Commit status on GitHub
- Artifact Retention: Build logs automatically saved
- Retry Management: GitHub Actions native
- Cloud-Native: Modern CI/CD approach
Developer Experience
- Python SDK: Direct integration, no shell wrapper
- Better Prompts: Rich context and error feedback
- Structured Output: JSON metadata + logs
- Standard Tools: GitHub, not custom SSH scripts
- Future-Proof: Aligns with modern practices
⚠️ Risks & Mitigation
Risk 1: Gitea → GitHub Integration
Issue: Need to mirror or use GitHub Actions Mitigation:
- Check if Gitea supports Actions (newer versions do)
- Or use GitHub.com and mirror from Gitea
- Or keep Gitea as source of truth, GitHub for Actions only
Risk 2: API Key Management
Issue: Multiple systems (n8n, GitHub, OpenHands) Mitigation:
- Use GitHub repository secrets (secure)
- Use environment variables (automated)
- Document all required keys clearly
Risk 3: Learning Curve
Issue: Team unfamiliar with GitHub Actions Mitigation:
- Start with simple workflows
- Use provided templates
- Leverage documentation
- Gradual migration
Risk 4: Timeline Overrun
Issue: 3-4 days might be optimistic Mitigation:
- Phase approach (can stop between phases)
- Keep SSH approach as fallback
- Parallel testing
✅ Success Criteria
Must Have
- End-to-end build/test completes successfully
- n8n orchestrates without SSH
- GitHub Actions runs OpenHands SDK
- Gitea status updates automatically
- Retry logic works (max 3 attempts)
- Better error messages than SSH approach
- Logs captured and accessible
- Simpler code (fewer nodes, less complexity)
Nice to Have
- Parallel testing (multiple repos)
- Slack/Discord notifications
- Email alerts for failures
- Build time tracking
- Detailed metrics dashboard
📚 Quick Reference
Start Here
- Analysis: Read
NEW_APPROACH_ANALYSIS.md - Implementation: Follow
GITHUB_ACTIONS_INTEGRATION_GUIDE.md - Migration: Use this document for tracking
Key Files
- Workflow:
.github/workflows/openhands-build.yml - Agent:
.github/scripts/agent_build.py - Current Plan:
phase3.md(to be updated)
Commands
# Test GitHub Actions manually
gh workflow run openhands-build.yml -f task="Build project" -f repo_name="test" -f commit_sha="abc123"
# Check workflow status
gh run list
# View logs
gh run view <run-id>
Resources
🚀 Decision Point
PROCEED with hybrid approach (Option A)
Next Action:
- Day 1: Start with GitHub Actions setup
- Begin with GitHub repository creation and workflow testing
- Use Phase 3 timeline (3-4 days) as guide
- Keep SSH approach as fallback during transition
Timeline:
- Start: 2025-12-02
- Expected Completion: 2025-12-05 (3 days)
- Phase 1: Day 1 (GitHub Actions setup)
- Phase 2: Day 2 (n8n integration)
- Phase 3: Day 3 (testing & retry)
- Phase 4: Day 4 (documentation)
Migration Summary - 2025-12-02 Decision: Proceed with hybrid approach