-
Notifications
You must be signed in to change notification settings - Fork 103
Fix #356: Make "Create a Good PR" tutorial #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LittleRainC
wants to merge
5
commits into
oppia:develop
Choose a base branch
from
LittleRainC:dev_branch2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
## Table of contents | ||
|
||
- [Table of contents](#table-of-contents) | ||
- [Why It Matters](#why-it-matters) | ||
- [Before You Open Your PR](#before-you-open-your-pr) | ||
- [What Makes a PR “Great”](#what-makes-a-pr-great) | ||
- [1. Clear Purpose](#1-clear-purpose) | ||
- [2. Focused Scope](#2-focused-scope) | ||
- [3. Helpful Description](#3-helpful-description) | ||
- [4. Show, Don’t Tell](#4-show-dont-tell) | ||
- [5. Tested \& Verified](#5-tested--verified) | ||
- [Common Mistakes to Avoid](#common-mistakes-to-avoid) | ||
- [Final Checklist Before You Request Review](#final-checklist-before-you-request-review) | ||
- [Reviewers Appreciate...](#reviewers-appreciate) | ||
- [Need Help?](#need-help) | ||
|
||
This page is an introduction to creating a great Pull Request (PR). A great Pull Request (PR) is more than just code—it’s clean, clear, and easy for reviewers to understand. This guide shares best practices for writing high-quality PRs that are easy to review and quick to merge. | ||
|
||
## Why It Matters | ||
|
||
A good pull request isn’t just about working code—it’s about making collaboration easier. Clear, well-structured PRs save reviewers time, reduce confusion, and help maintain high code quality. In open source, thoughtful PRs build trust and keep the project maintainable for everyone. | ||
|
||
For the essential checklist and best practices, be sure to follow [Rules for making PRs](./rules-for-making-prs.md)—every good PR starts there. | ||
|
||
## Before You Open Your PR | ||
|
||
Make sure you’ve: | ||
|
||
- Created a branch off the latest `develop` | ||
- Pulled the latest code: `git pull upstream develop` | ||
- Tested your changes locally | ||
- Passed all relevant tests | ||
- Cleaned up your code (no stray debug logs or commented code) | ||
- Written a fix plan (if required) and got it approved | ||
|
||
## What Makes a PR “Great” | ||
|
||
Here’s what makes a PR stand out: | ||
|
||
### 1. Clear Purpose | ||
|
||
Use a **descriptive PR title** and mention the issue number. | ||
|
||
**Good:** | ||
`Fix #4567: Align navbar correctly on small screens` | ||
|
||
**Bad:** | ||
`Update UI stuff` | ||
|
||
### 2. Focused Scope | ||
|
||
- Stick to **one topic per PR** | ||
- Don’t sneak in unrelated changes | ||
- Keep your PRs small when possible—**smaller PRs are faster to review** | ||
|
||
### 3. Helpful Description | ||
|
||
Fill out the PR template completely: | ||
|
||
- What did you change? | ||
- Why was it needed? | ||
- Any tricky parts? | ||
- Screenshots for UI changes | ||
- Questions you want feedback on | ||
|
||
### 4. Show, Don’t Tell | ||
|
||
If your PR changes the UI, **include before-and-after screenshots**. This helps reviewers instantly understand the visual impact. | ||
|
||
### 5. Tested & Verified | ||
|
||
Before requesting review: | ||
|
||
- All tests pass (unit, integration, lint) | ||
- You've tested manually (especially for UI or logic changes) | ||
- Edge cases are handled | ||
|
||
## Common Mistakes to Avoid | ||
|
||
| ❌ Don’t Do This | ✅ Do This Instead | | ||
|------------------|--------------------| | ||
| "Fix some stuff" in title | "Fix #1234: Add padding to dashboard cards" | | ||
| Combine unrelated fixes | Separate into focused PRs | | ||
| Skip writing a description | Clearly explain what and why | | ||
| Add unfinished code | Only push code that’s ready | | ||
| Forget screenshots | Add visual proof for UI changes | | ||
|
||
## Final Checklist Before You Request Review | ||
|
||
- [ ] My PR addresses **one issue only** | ||
- [ ] I followed **Oppia’s code style** | ||
- [ ] All **tests pass** | ||
- [ ] I filled out the **PR template** | ||
- [ ] I included **screenshots** (if needed) | ||
- [ ] My commit message is clear and formatted | ||
- [ ] I pushed the **latest code** | ||
- [ ] I’m ready to **respond to reviews** promptly | ||
|
||
## Reviewers Appreciate... | ||
|
||
- Clean, readable code | ||
- Clear commit history | ||
- Context provided in comments if something’s non-obvious | ||
- Respect for their time | ||
|
||
## Need Help? | ||
|
||
Don’t be afraid to ask! You can: | ||
|
||
- Tag reviewers in comments | ||
- Use [GitHub Discussions](https://github.com/oppia/oppia/discussions) | ||
|
||
Thanks for taking the time to make your PR shine. | ||
High-quality PRs make Oppia better for everyone! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this doc, do you need to refer to the more detailed "PR guide" at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a link for the detailed PR guide as a essential checklist, and I think it might be okey?