Merge to Main - Quick Start Guide
February 12, 2026 ยท View on GitHub
๐ฏ Goal
Safely merge your changes to the main branch with zero chaos.
โก Quick Steps
Before Creating a PR
# 1. Run the merge gate locally
./merge-gate.sh
# 2. If any issues, fix them:
npm run lint:fix # Fix linting errors
npm run typecheck # Check type errors
npm test # Run tests
# 3. Commit your fixes
git add .
git commit -m "Fix issues from merge gate"
# 4. Re-run merge gate until it passes
./merge-gate.sh
# 5. Push your branch
git push origin your-branch-name
Creating the PR
- Go to GitHub: https://github.com/InfinityXOneSystems/quantum-x-builder
- Click "New Pull Request"
- Select your branch
- Fill in the PR template with:
- Title: Clear, descriptive title
- Description: What changed and why
- Testing: How you validated the changes
- Create the PR
After Creating the PR
-
Wait for Automated Checks โ
- Pre-merge validation will run automatically
- All checks must be green before merging
- Check the "Checks" tab on your PR
-
If Checks Fail โ
- Review the failed check logs
- Fix issues in your branch
- Push fixes (checks re-run automatically)
- Repeat until all green
-
When All Green โ
- Request review (if needed)
- Click "Squash and merge" or "Merge pull request"
- Delete your branch after merge
๐ก๏ธ Safety Features
The system has multiple safety gates:
Automated (No Action Required)
- โ Kill switch check
- โ Manifest validation
- โ Lint & type checks
- โ Test suite
- โ Component validation
- โ Integration validation
- โ Security audit
Manual (You Control)
- ๐ Local merge gate (
./merge-gate.sh) - ๐ Smoke tests (
./smoke-test.sh) - ๐ Integration validation (
./validate-integration.sh)
๐ Pre-Merge Checklist
Use this checklist for every merge:
- [ ] Ran ./merge-gate.sh and all gates passed
- [ ] Tested changes locally
- [ ] All automated checks are green on PR
- [ ] No merge conflicts
- [ ] Documentation updated (if needed)
- [ ] Ready to monitor post-merge for 30 minutes
๐จ Troubleshooting
Issue: Merge gate fails locally
Solution:
# Check which gate failed and fix it
npm run lint:fix # For lint errors
npm run typecheck # For type errors
npm test # For test failures
npm install # For dependency issues
Issue: PR checks fail but local passes
Solution:
- Make sure you pushed latest changes
- Check Node.js version (should be 20)
- Review CI logs for specific errors
- Ensure package-lock.json is committed
Issue: Merge conflicts
Solution:
# Update your branch from main
git checkout your-branch
git fetch origin
git merge origin/main
# Resolve conflicts in your editor
# Test after resolving
./merge-gate.sh
# Commit and push
git add .
git commit -m "Resolve merge conflicts"
git push origin your-branch
Issue: Tests pass locally but fail in CI
Solution:
- Check Node.js version matches (20)
- Ensure all dependencies are in package.json
- Check for environment-specific code
- Review CI logs for the specific error
๐ฌ Complete Example
Here's a complete example workflow:
# 1. Create feature branch
git checkout -b feature/my-awesome-feature
# 2. Make your changes
# ... edit files ...
# 3. Commit changes
git add .
git commit -m "Add awesome feature"
# 4. Run merge gate
./merge-gate.sh
# 5. Fix any issues
npm run lint:fix
git add .
git commit -m "Fix lint issues"
# 6. Re-run merge gate
./merge-gate.sh
# โ ALL GATES PASSED
# 7. Push branch
git push origin feature/my-awesome-feature
# 8. Create PR on GitHub
# - Go to repo
# - Click "New Pull Request"
# - Select your branch
# - Fill in description
# - Create PR
# 9. Wait for checks
# โ Pre-merge validation: PASSED
# โ All checks green
# 10. Merge!
# Click "Squash and merge" on GitHub
# 11. Monitor (watch for 30 min)
# Check CI on main branch
# Check for any errors
# 12. Done! ๐
๐ Post-Merge Monitoring
After merging, monitor for 30 minutes:
# 1. Pull latest main
git checkout main
git pull origin main
# 2. Run smoke tests
./smoke-test.sh
# 3. Check CI status
gh run list --branch main --limit 1
# 4. Watch for issues
# - Check GitHub Actions
# - Review _OPS/AUDIT/ logs
# - Monitor error logs
# If issues detected โ See rollback procedure in SAFE_MERGE_STRATEGY.md
๐ Related Documentation
- Full Strategy: SAFE_MERGE_STRATEGY.md - Complete merge strategy guide
- Integration: validate-integration.sh - Integration validation script
- Smoke Tests: smoke-test.sh - Quick system health checks
- Merge Gate: merge-gate.sh - Local pre-merge validation
๐ Need Help?
- Check Documentation: Read SAFE_MERGE_STRATEGY.md
- Run Validation:
./validate-integration.sh - Check Logs: Review
_OPS/AUDIT/and_OPS/OUTPUT/ - Rollback if Needed: Follow Phase 6 in SAFE_MERGE_STRATEGY.md
- Activate Kill Switch: If critical issues occur
๐ก Tips
- โ Run merge-gate.sh before every PR - Catches issues early
- โ Small, focused PRs - Easier to review and merge
- โ Test locally first - Don't rely only on CI
- โ Monitor after merge - Catch issues quickly
- โ Document changes - Clear PR descriptions help reviewers
- โ Don't merge red PRs - All checks must be green
- โ Don't rush - Take time to validate properly
- โ Don't force push to main - Destroys history
๐ Success Criteria
Your merge is successful when:
- โ All pre-merge validation checks passed
- โ PR merged without conflicts
- โ CI passes on main branch
- โ Smoke tests pass
- โ No errors in first 30 minutes
- โ System operates normally
Remember: It's better to delay a merge and validate properly than to rush and break the system. Safety first, always.
Last Updated: 2026-02-12 Version: 1.0