|
| 1 | +# Pull Request (PR) Review Process |
| 2 | + |
| 3 | +Pull Requests (PRs) are a fundamental part of our development workflow. They enable collaboration, ensure code quality, and provide a structured mechanism for peer review. A well-defined PR review process not only improves the stability and readability of our codebase, but also encourages knowledge sharing and collective ownership among team members. |
| 4 | + |
| 5 | +This document serves as a guide for the entire PR lifecycle and review process, from creation to completion — by defining each status, outlining the responsibilities of the author and reviewers, and establishing best practices. Following this workflow will help ensure clarity, consistency, and efficiency across our engineering team. |
| 6 | + |
| 7 | +Use this guide as a reference to: |
| 8 | +- Understand the meaning and purpose of each PR status |
| 9 | +- Know what actions to take at every stage |
| 10 | +- Communicate effectively during the review process |
| 11 | +- Improve turnaround time and reduce merge conflicts |
| 12 | + |
| 13 | +Please note that we are using [this](https://github.com/orgs/json-schema-org/projects/41) project board, which implements the workflow described below. |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## 🔄 Types of PR Lifecycle Status |
| 18 | + |
| 19 | +### 1. 🟡 Unclear |
| 20 | +- **Definition:** The PR is open but lacks critical information such as purpose, context, or a clear problem statement. Reviewers are uncertain about what is expected or whether the PR is ready for review. |
| 21 | +- **Action:** The PR author must update the description, clarify the scope, link relevant issues or documentation, and ensure the PR is complete enough to be reviewed. |
| 22 | +- **Owner:** PR Author |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +### 2. 🟢 Ready to Review |
| 27 | +- **Definition:** The PR is considered complete from the author’s side and is ready to be evaluated. It should be in a clean state with all relevant changes pushed. |
| 28 | +- **Checklist:** |
| 29 | + - All required code changes and commits are included. |
| 30 | + - PR description is detailed and includes context, purpose, and any linked issues. |
| 31 | + - CI/CD checks (tests, linters, etc.) have passed. |
| 32 | +- **Action:** The author should notify assigned reviewers or tag relevant team members to begin the review process. |
| 33 | +- **Owner:** PR Author |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +### 3. 🧑💻 In Review Team |
| 38 | +- **Definition:** The PR has been acknowledged by one or more reviewers, and it is actively under review. Feedback may be ongoing or final decisions may be pending. |
| 39 | +- **Action:** Reviewers should assess the code quality, test coverage, and adherence to standards. Constructive feedback or approval should be provided in a timely manner. |
| 40 | +- **Owner:** Reviewers |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +### 4. 🔁 Changes Requested |
| 45 | +- **Definition:** Reviewers have reviewed the PR and determined that changes are needed before approval. These could include code fixes, style improvements, performance optimizations, or documentation updates. |
| 46 | +- **Action:** The PR author must address all comments and push the required changes. Once updates are made, the reviewers should be notified to re-review. |
| 47 | +- **Owner:** PR Author |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +### 5. ⏳ Waiting for Others to Review |
| 52 | +- **Definition:** The PR has been reviewed once and approved, but is still pending review from additional team members. |
| 53 | +- **Action:** Reviewers who have not yet reviewed should prioritize reviewing the PR to avoid blocking progress. |
| 54 | +- **Owner:** Reviewers |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +### 6. ✅ Ready to Merge |
| 59 | +- **Definition:** All required reviews have been completed, changes have been accepted, and CI pipelines are passing. The PR is now eligible to be merged into the main codebase. |
| 60 | +- **Action:** The maintainer or authorized team member should proceed with the merge, following the appropriate merge strategy (e.g., squash, rebase, or merge commit). |
| 61 | +- **Owner:** Maintainer |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +### 7. 🗃️ To Be Closed |
| 66 | +- **Definition:** The PR is no longer relevant or necessary, either due to project direction changes, duplication, or better alternatives implemented elsewhere. |
| 67 | +- **Action:** Leave a clear comment explaining the rationale for closing the PR. Then close it gracefully. |
| 68 | +- **Owner:** PR Author or Maintainer |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### 8. 🏁 Done |
| 73 | +- **Definition:** The PR has been successfully merged or intentionally closed. All related work is considered complete and requires no further action. |
| 74 | +- **Action:** No action required. Follow-up tasks (if any) should be documented in related issues or project boards. |
| 75 | +- **Owner:** System / Maintainer |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +## 📊 Summary Table |
| 80 | + |
| 81 | +| **Status** | **Definition** | **Owner** | **Action Required** | |
| 82 | +|-----------------------------|---------------------------------------------------------------------------------|---------------------|-------------------------------------------------------------------------------------| |
| 83 | +| Unclear | PR lacks context or clarity. | PR Author | Add description, clarify intent, link issues. | |
| 84 | +| Ready to Review | PR is complete and ready for review. | PR Author | Notify reviewers, ensure CI passes, add context. | |
| 85 | +| In Review Team | Reviewers are actively reviewing the PR. | Reviewers | Review code, leave comments or approvals. | |
| 86 | +| Changes Requested | Reviewers have asked for updates. | PR Author | Implement changes, respond to comments, push updates. | |
| 87 | +| Waiting for Others to Review| PR is pending additional review(s). | Reviewers | Remaining reviewers should review and respond. | |
| 88 | +| Ready to Merge | All approvals are in; the PR is good to go. | Maintainer | Merge the PR following branch strategy and CI validation. | |
| 89 | +| To Be Closed | PR is no longer needed or valid. | Author / Maintainer | Close the PR with a comment explaining why. | |
| 90 | +| Done | PR is merged or closed with no further actions required. | System | No further action needed. | |
| 91 | + |
| 92 | +## Flow Diagram |
| 93 | +```mermaid |
| 94 | +flowchart TD |
| 95 | + A[Unclear] --> B[Ready to Review] |
| 96 | + B --> C[In Review Team] |
| 97 | + C --> D[Changes Requested] |
| 98 | + D --> B |
| 99 | + C --> E[Waiting for Others to Review] |
| 100 | + E --> F[Ready to Merge] |
| 101 | + F --> G[Done] |
| 102 | + H[To be closed] --> G |
| 103 | +``` |
| 104 | + |
0 commit comments