9.4 KiB
π PR Management System Setup Guide
This guide will help you set up and activate the complete PR management system for NOFX.
π¦ What's Included
The PR management system includes:
1. Documentation
- β
CONTRIBUTING.md- Contributor guidelines - β
docs/maintainers/PR_REVIEW_GUIDE.md- Reviewer guidelines - β
docs/maintainers/PROJECT_MANAGEMENT.md- Project management workflow - β
docs/maintainers/SETUP_GUIDE.md- This file
2. GitHub Configuration
- β
.github/PULL_REQUEST_TEMPLATE.md- PR template (already exists) - β
.github/labels.yml- Label definitions - β
.github/labeler.yml- Auto-labeling rules - β
.github/workflows/pr-checks.yml- Automated PR checks
3. Automation
- β Automatic PR labeling
- β PR size checking
- β CI/CD tests
- β Security scanning
- β Commit message validation
π§ Setup Steps
Step 1: Sync GitHub Labels
Create the labels defined in .github/labels.yml:
# Option 1: Using gh CLI (recommended)
gh label list # See current labels
gh label delete <label-name> # Remove old labels if needed
gh label create "priority: critical" --color "d73a4a" --description "Critical priority"
# ... repeat for all labels in labels.yml
# Option 2: Use GitHub Labeler Action (automated)
# The workflow will sync labels automatically on push
Or use the GitHub Labeler Action (add to .github/workflows/sync-labels.yml):
name: Sync Labels
on:
push:
branches: [main, dev]
paths:
- '.github/labels.yml'
jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
Step 2: Enable GitHub Actions
- Go to Settings β Actions β General
- Enable "Allow all actions and reusable workflows"
- Set Workflow permissions to "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"
Step 3: Set Up Branch Protection Rules
For main branch:
- Go to Settings β Branches β Add rule
- Branch name pattern:
main - Configure:
- β Require a pull request before merging
- β Require approvals: 1
- β
Require status checks to pass before merging
- Select:
Backend Tests (Go) - Select:
Frontend Tests (React/TypeScript) - Select:
Security Scan
- Select:
- β Require conversation resolution before merging
- β Do not allow bypassing the above settings
- β Allow force pushes (disabled)
- β Allow deletions (disabled)
For dev branch:
- Same as above, but with:
- Require approvals: 1
- Less strict (allow maintainers to bypass if needed)
Step 4: Create GitHub Projects
-
Go to Projects β New project
-
Create "NOFX Development" board
- Template: Board
- Add columns:
Backlog,Triaged,In Progress,In Review,Done - Add views: Sprint, Roadmap, By Area, Priority
-
Create "Bounty Program" board
- Template: Board
- Add columns:
Available,Claimed,In Progress,Under Review,Paid
Step 5: Enable Discussions (Optional but Recommended)
- Go to Settings β General β Features
- Enable "Discussions"
- Create categories:
- π¬ General - General discussions
- π‘ Ideas - Feature ideas and suggestions
- π Q&A - Questions and answers
- π’ Announcements - Important updates
- π³οΈ Polls - Community polls
Step 6: Configure Issue Templates
The templates already exist in .github/ISSUE_TEMPLATE/. Verify they're working:
- Go to Issues β New issue
- You should see:
- π Bug Report
- β¨ Feature Request
- π° Bounty Claim
If not showing, check files are properly formatted YAML with frontmatter.
Step 7: Set Up Code Owners (Optional)
Create .github/CODEOWNERS:
# Global owners
* @tinkle @zack
# Frontend
/web/ @frontend-lead
# Exchange integrations
/internal/exchange/ @exchange-lead
# AI components
/internal/ai/ @ai-lead
# Documentation
/docs/ @tinkle @zack
*.md @tinkle @zack
Step 8: Configure Notifications
For Maintainers:
-
Go to Settings β Notifications
-
Enable:
- β Pull request reviews
- β Pull request pushes
- β Comments on issues and PRs
- β New issues
- β Security alerts
-
Set up email filters to organize notifications
For Repository:
- Go to Settings β Webhooks (if integrating with Slack/Discord)
- Add webhook for notifications
π Post-Setup Checklist
After setup, verify:
- Labels are created and visible
- Branch protection rules are active
- GitHub Actions workflows run on new PR
- Auto-labeling works (create a test PR)
- PR template shows when creating PR
- Issue templates show when creating issue
- Projects boards are accessible
- CONTRIBUTING.md is linked in README
π― How to Use the System
For Contributors
- Read CONTRIBUTING.md
- Check Roadmap for priorities
- Open issue or find existing one
- Create PR using the template
- Address review feedback
- Celebrate when merged! π
For Maintainers
- Daily: Triage new issues/PRs (15 min)
- Daily: Review assigned PRs
- Weekly: Sprint planning (Monday) and review (Friday)
- Follow: PR Review Guide
- Follow: Project Management Guide
For Bounty Hunters
- Check bounty issues with
bountylabel - Claim by commenting on issue
- Complete within deadline
- Submit PR with bounty claim section filled
- Get paid after merge
π Testing the System
Test 1: Create a Test PR
# Create a test branch
git checkout -b test/pr-system-check
# Make a small change
echo "# Test" >> TEST.md
# Commit and push
git add TEST.md
git commit -m "test: verify PR automation system"
git push origin test/pr-system-check
# Create PR on GitHub
# Verify:
# - PR template loads
# - Auto-labels are applied
# - CI checks run
# - Size label is added
Test 2: Create a Test Issue
- Go to Issues β New issue
- Select Bug Report
- Fill in template
- Submit
- Verify:
- Template renders correctly
- Issue can be labeled
- Issue appears in project board
Test 3: Test Auto-Labeling
Create PRs that change files in different areas:
# Test 1: Frontend changes
git checkout -b test/frontend-label
touch web/src/test.tsx
git add . && git commit -m "test: frontend labeling"
git push origin test/frontend-label
# Should get "area: frontend" label
# Test 2: Backend changes
git checkout -b test/backend-label
touch internal/test.go
git add . && git commit -m "test: backend labeling"
git push origin test/backend-label
# Should get "area: backend" label
π Troubleshooting
Issue: Labels not syncing
Solution:
# Delete all existing labels first
gh label list --json name --jq '.[].name' | xargs -I {} gh label delete "{}" --yes
# Then create from labels.yml manually or via action
Issue: GitHub Actions not running
Check:
- Actions are enabled in repository settings
- Workflow files are in
.github/workflows/ - YAML syntax is valid
- Permissions are set correctly
Debug:
# Validate workflow locally
act pull_request # Using 'act' tool
Issue: Branch protection blocking PRs
Check:
- Required checks are defined in workflow
- Check names match exactly
- Checks are completing (not stuck)
Temporary fix:
- Maintainers can bypass if urgent
- Adjust protection rules if too strict
Issue: Auto-labeler not working
Check:
.github/labeler.ymlexists and valid YAML- Labels defined in labeler.yml exist in repository
- Workflow has
pull-requests: writepermission
π Monitoring and Maintenance
Weekly Review
Check these metrics every week:
# Using gh CLI
gh pr list --state all --json number,createdAt,closedAt
gh issue list --state all --json number,createdAt,closedAt
# Or use GitHub Insights
# Repository β Insights β Pulse, Contributors, Traffic
Monthly Maintenance
- Review and update labels if needed
- Check for outdated dependencies in workflows
- Update CONTRIBUTING.md if processes change
- Review automation effectiveness
- Gather community feedback
π Training Resources
For New Contributors
For Maintainers
π You're All Set!
The PR management system is now ready to:
β Guide contributors with clear guidelines β Automate repetitive tasks β Maintain code quality β Track progress systematically β Scale the community
Questions? Reach out in the maintainer channel or open a discussion.
Let's build an amazing community! π