Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions Create a Good PR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
## 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space between "Pull Request" and "(PR)" in first sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted as pointed above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted -> Create a Good PR
image


## Why It Matters

Contributing code is awesome—but making it **easy to review** is just as important. A thoughtful PR saves time for reviewers, avoids misunderstandings, and helps Oppia maintain a high standard of quality.

## Before You Open Your PR
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.
image


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**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format as a checklist using - [ ] ...? (Not sure)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted as pointed above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced all the "-" with "- [ ]"
image

- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the relevant github discussions category

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added that link
image

- Ask in Oppia’s chat or community channels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ from the previous bullet point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed "Ask in Oppia's chat or community channels"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really a good point. I removed "Ask in Oppia's chat or community channels"
image


Thanks for taking the time to make your PR shine.
High-quality PRs make Oppia better for everyone!
1 change: 1 addition & 0 deletions _Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* [[Tips for analyzing the codebase|Analyzing-the-codebase]]
* [[Learning resources for developers|Learning-Resources]]
* [[Rules for making PRs|Rules-for-making-PRs]]
* [[Create a Good PR|Create a Good PR]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should reorganize this section...

  • Good first issues (bolded)
  • Tips for finding the right code to change
    • Finding the commit that introduced a bug
    • Tips for analyzing the codebase
  • How to create a good PR (your new page, bolded)
    • Rules for making PRs
    • Coding style guide

and we move the learning resources for developers to the "getting started" section above? Just some thoughts, feel free to suggest a better ordering -- we want devs to discover this page. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted as pointed above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
adjusted as pointed

* [[Coding style guide|Coding-style-guide]]
* [[Debugging|Debugging]]
* [[Debugging Docs|Debugging-Docs]]
Expand Down