5.3 KiB
🔄 How to Migrate Your PR to the New Format
This guide helps you migrate your existing PR to meet the new PR management system requirements.
🎯 Why Migrate?
While your existing PR will still be reviewed and merged under current standards, migrating it to the new format gives you:
✅ Faster reviews - Automated checks catch issues early ✅ Better feedback - Clear, actionable feedback from CI ✅ Higher quality - Consistent code standards ✅ Learning - Understand our new contribution workflow
⚡ Quick Check (Recommended)
Step 1: Analyze Your PR
# Run the PR health check (reads only, doesn't modify anything)
./scripts/pr-check.sh
This will analyze your PR and tell you:
- ✅ What's good
- ⚠️ What needs attention
- 💡 How to fix issues
- 📊 Overall health score
Step 2: Fix Issues
Based on the suggestions, fix the issues manually. Common fixes:
# Rebase on latest dev
git fetch upstream && git rebase upstream/dev
# Format Go code
go fmt ./...
# Run tests
go test ./...
# Format frontend code
cd web && npm run lint -- --fix
Step 3: Run Check Again
# Verify all issues are fixed
./scripts/pr-check.sh
Step 4: Push Changes
git push -f origin <your-pr-branch>
What the Script Does
- ✅ Syncs with latest
upstream/dev - ✅ Rebases your changes
- ✅ Formats Go code (
go fmt) - ✅ Runs Go linting (
go vet) - ✅ Runs tests
- ✅ Formats frontend code (if applicable)
- ✅ Pushes changes to your PR
🛠️ Manual Migration (Step by Step)
If you prefer to do it manually:
Step 1: Sync with Upstream
# Add upstream if not already added
git remote add upstream https://github.com/NoFxAiOS/nofx.git
# Fetch latest changes
git fetch upstream
# Rebase your branch
git checkout <your-pr-branch>
git rebase upstream/dev
Step 2: Backend Checks (Go)
# Format Go code
go fmt ./...
# Run linting
go vet ./...
# Run tests
go test ./...
# If you made changes, commit them
git add .
git commit -m "chore: format and fix backend issues"
Step 3: Frontend Checks (if applicable)
cd web
# Install dependencies
npm install
# Fix linting issues
npm run lint -- --fix
# Check types
npm run type-check
# Test build
npm run build
cd ..
# Commit any fixes
git add .
git commit -m "chore: fix frontend issues"
Step 4: Update PR Title (if needed)
Ensure your PR title follows Conventional Commits:
<type>(<scope>): <description>
Examples:
feat(exchange): add OKX integration
fix(trader): resolve position tracking bug
docs(readme): update installation guide
Types:
feat- New featurefix- Bug fixdocs- Documentationrefactor- Code refactoringperf- Performance improvementtest- Test updateschore- Build/config changessecurity- Security improvements
Step 5: Push Changes
git push -f origin <your-pr-branch>
📋 Checklist
After migrating, verify:
- PR is rebased on latest
dev - No merge conflicts
- Backend tests pass locally
- Frontend builds successfully
- PR title follows Conventional Commits format
- All commits are meaningful
- Changes pushed to GitHub
🤖 What Happens After Migration?
After you push your changes:
- Automated checks will run (they won't block merging, just provide feedback)
- You'll get a comment with check results and suggestions
- Maintainers will review your PR with the new context
- Faster review thanks to pre-checks
❓ Troubleshooting
"Rebase conflicts"
If you get conflicts during rebase:
# Fix conflicts in your editor
# Then:
git add <fixed-files>
git rebase --continue
# Or abort and ask for help:
git rebase --abort
Need help? Just comment on your PR and we'll assist!
"Tests failing"
If tests fail:
# Run tests to see the error
go test ./...
# Fix the issue
# Then commit and push
git add .
git commit -m "fix: resolve test failures"
git push -f origin <your-pr-branch>
"Script not working"
If the migration script doesn't work:
- Check you have Go and Node.js installed
- Try manual migration (steps above)
- Ask for help in your PR comments
💡 Tips
Don't want to migrate?
- That's okay! Your PR will still be reviewed and merged
- Migration is optional but recommended
First time using Git rebase?
- Check our Git guide
- Ask questions in your PR - we're here to help!
Want to learn more?
📞 Need Help?
Stuck on migration?
- Comment on your PR
- Ask in Telegram
- Open a Discussion
We're here to help you succeed! 🚀
🎉 After Migration
Once migrated:
- ✅ Wait for automated checks to run
- ✅ Address any feedback in comments
- ✅ Wait for maintainer review
- ✅ Celebrate when merged! 🎉
Thank you for contributing to NOFX!