Pull Request Process
Overview
All code changes to BookWish must go through a pull request (PR) process. This ensures code quality, maintainability, and alignment with project standards.
Creating a Pull Request
Before You Start
- Check the issue tracker - Ensure your work aligns with planned features or bug fixes
- Review coding standards - Familiarize yourself with our Code Style Guide
- Create a branch - Use a descriptive branch name (e.g.,
feature/user-wishlist,fix/login-bug)
PR Requirements
Every pull request must include:
- Clear title - Describe what the PR does in one line
- Description - Explain the changes, why they're needed, and how they work
- Related issues - Link to any related issues or work packs
- Screenshots - For UI changes, include before/after screenshots
- Testing notes - Describe how you tested the changes
PR Checklist
Before submitting, ensure:
- All tests pass (
npm testin backend,flutter testin app) - Code follows our Code Style Guide
- No
anytypes in TypeScript code - No
console.logorprint()statements - No TODO comments in production code
- Linter passes with no errors (
npm run lint,flutter analyze) - Build succeeds (
npm run build,flutter build) - Commit messages follow our conventions
- Documentation is updated if needed
Code Review Process
Review Timeline
- PRs should be reviewed within 24-48 hours
- Address review comments within 24 hours
- Re-reviews typically happen within 24 hours
Review Criteria
Reviewers will check for:
- Correctness - Does the code work as intended?
- Style compliance - Does it follow our coding standards?
- Test coverage - Are there appropriate tests?
- Documentation - Is the code well-documented?
- Performance - Are there any performance concerns?
- Security - Are there any security issues?
Addressing Feedback
- Respond to all review comments
- Make requested changes in new commits (don't force push)
- Mark conversations as resolved when addressed
- Request re-review when ready
Merging
Merge Requirements
A PR can be merged when:
- At least one approval from a maintainer
- All CI checks pass
- All review comments are resolved
- No merge conflicts
Merge Strategy
- Use Squash and Merge for feature branches
- Ensure the squashed commit message is clear and follows our commit conventions
- Delete the branch after merging
Special Cases
Hotfixes
For critical production issues:
- Create a branch from
main(or production branch) - Make the minimal fix
- Fast-track review with
[HOTFIX]in the PR title - Deploy immediately after merge
Work-in-Progress PRs
- Use
[WIP]prefix or GitHub's draft PR feature - Useful for early feedback
- Cannot be merged until ready for review
Best Practices
Keep PRs Small
- Aim for PRs under 400 lines of changes
- Split large features into smaller, reviewable chunks
- Each PR should have a single, clear purpose
Write Good Descriptions
## What this PR does
Implements user wishlist feature allowing users to save books they want to read.
## Why
Users requested ability to track books they're interested in without purchasing.
## How to test
1. Log in as a test user
2. Navigate to a book detail page
3. Click "Add to Wishlist"
4. Verify book appears in wishlist page
## Related Issues
Closes #123
Respond to Reviews Gracefully
- Thank reviewers for their time
- Ask questions if feedback is unclear
- Explain your reasoning if you disagree
- Be open to suggestions and learning
Tools and Automation
CI Checks
All PRs automatically run:
- Linting (
eslint,flutter analyze) - Type checking (
tsc,dart analyze) - Tests (
jest,flutter test) - Build validation
Branch Protection
The main branch is protected and requires:
- Passing CI checks
- At least one approval
- Up-to-date with base branch
Getting Help
If you need help with your PR:
- Add a comment explaining where you're stuck
- Tag relevant maintainers with
@username - Join our development chat (if available)
- Check existing PRs for examples