Pull Request Guidelines
How to submit high-quality pull requests to Sayr
This guide covers how to create and submit pull requests that are easy to review and likely to be merged.
Before You Start
- Check existing issues - Look for related issues or PRs before starting work
- Discuss large changes - For significant features, open an issue first to discuss the approach
- Keep PRs focused - One PR should address one concern (feature, bug fix, refactor)
Branch Naming
Use descriptive branch names with a prefix:
| Prefix | Use Case |
|---|---|
feat/ | New features |
fix/ | Bug fixes |
docs/ | Documentation changes |
refactor/ | Code refactoring |
test/ | Adding or updating tests |
chore/ | Maintenance tasks |
Examples:
feat/task-filteringfix/login-redirect-loopdocs/contributing-guiderefactor/task-service
Commit Messages
Follow Conventional Commits format:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]Types
| Type | Description |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, no code change |
refactor | Code change that neither fixes nor adds |
test | Adding or updating tests |
chore | Maintenance, dependencies |
Examples
# Feature
feat(tasks): add task filtering by status
# Bug fix
fix(auth): resolve redirect loop on login
# With scope and body
feat(api): add rate limiting to public endpoints
Implements token bucket algorithm with configurable
limits per endpoint. Default is 100 requests per minute.
Closes #123Tips
- Use imperative mood: "add feature" not "added feature"
- Keep the first line under 72 characters
- Reference issues in the footer:
Closes #123,Fixes #456
Creating a Pull Request
1. Ensure Quality
Before creating your PR, run these checks locally:
# Lint your code
pnpm lint
# Fix auto-fixable issues
pnpm lint:fix
# Check types
pnpm check-types
# Run tests (if applicable)
pnpm -F start test2. Write a Good Description
Your PR description should include:
Summary: What does this PR do? (1-2 sentences)
Changes: List the key changes made
Testing: How was this tested?
Screenshots: For UI changes, include before/after screenshots
Related Issues: Link to related issues
PR Description Template
## Summary
Brief description of what this PR accomplishes.
## Changes
- Added X component for Y functionality
- Updated Z service to handle edge case
- Fixed bug where A caused B
## Testing
- [ ] Tested locally with `pnpm dev`
- [ ] Added/updated tests
- [ ] Verified on multiple browsers (if UI change)
## Screenshots
<!-- For UI changes, add screenshots here -->
## Related Issues
Closes #1233. Keep PRs Small
Aim for PRs that can be reviewed in 15-30 minutes:
- Under 400 lines of code changes (excluding generated files)
- Focused on a single concern
- Easy to understand without extensive context
If your change is large, consider splitting it into multiple PRs.
Review Process
What Reviewers Look For
- Correctness: Does the code do what it's supposed to?
- Code style: Does it follow our conventions?
- Performance: Are there any obvious performance issues?
- Security: Are there any security concerns?
- Tests: Are there adequate tests?
- Documentation: Are comments and docs updated?
Responding to Feedback
- Be responsive: Try to address feedback within a few days
- Ask questions: If feedback is unclear, ask for clarification
- Discuss disagreements: It's okay to discuss, but be respectful
- Update your PR: Push new commits to address feedback
Approval Requirements
- At least one approval from a maintainer
- All CI checks passing
- No unresolved conversations
After Merging
- Delete your branch (GitHub can do this automatically)
- Close related issues if not auto-closed
- Update any related documentation if needed
Common Issues
CI Failures
Lint errors:
pnpm lint:fixType errors:
pnpm check-types
# Fix reported issuesTest failures:
pnpm -F start test
# Review and fix failing testsMerge Conflicts
If your branch has conflicts with main:
# Fetch latest changes
git fetch origin
# Rebase onto main
git rebase origin/main
# Resolve conflicts, then continue
git add .
git rebase --continue
# Force push (only on your feature branch!)
git push --force-with-leaseLarge PRs
If reviewers ask you to split your PR:
- Identify logical groupings of changes
- Create new branches for each group
- Submit separate PRs
- Reference the original PR in descriptions
Checklist
Before marking your PR ready for review:
- Branch is up to date with
main - Code follows the style guide
-
pnpm lintpasses -
pnpm check-typespasses - Tests pass (if applicable)
- PR description is complete
- Screenshots added (for UI changes)
- Related issues linked
- No
console.logor debug code left in - No commented-out code
- Environment variables documented (if new)
Getting Help
If you're stuck or have questions:
- Comment on the related issue
- Ask in the PR comments
- Reach out on GitHub Discussions
We're happy to help guide you through the process!