|
| 1 | +# Pull Request Merge Policy |
| 2 | + |
| 3 | +This document outlines the process for reviewing and merging pull requests (PRs) into the InvokeAI repository. |
| 4 | + |
| 5 | +## Review Process |
| 6 | + |
| 7 | +### 1. Assignment |
| 8 | + |
| 9 | +One of the repository maintainers will assign collaborators to review a pull request. The assigned reviewer(s) will be responsible for conducting the code review. |
| 10 | + |
| 11 | +### 2. Review and Iteration |
| 12 | + |
| 13 | +The assignee is responsible for: |
| 14 | +- Reviewing the PR thoroughly |
| 15 | +- Providing constructive feedback |
| 16 | +- Iterating with the PR author until the assignee is satisfied that the PR is fit to merge |
| 17 | +- Ensuring the PR meets code quality standards, follows project conventions, and doesn't introduce bugs or regressions |
| 18 | + |
| 19 | +### 3. Approval and Notification |
| 20 | + |
| 21 | +Once the assignee is satisfied with the PR: |
| 22 | +- The assignee approves the PR |
| 23 | +- The assignee alerts one of the maintainers that the PR is ready for merge using the **#request-reviews Discord channel** |
| 24 | + |
| 25 | +### 4. Final Merge |
| 26 | + |
| 27 | +One of the maintainers is responsible for: |
| 28 | +- Performing a final check of the PR |
| 29 | +- Merging the PR into the appropriate branch |
| 30 | + |
| 31 | +**Important:** Collaborators are strongly discouraged from merging PRs on their own, except in case of emergency (e.g., critical bug fix and no maintainer is available). |
| 32 | + |
| 33 | +### 5. Release Policy |
| 34 | + |
| 35 | +Once a feature release candidate is published, no feature PRs are to |
| 36 | +be merged into main. Only bugfixes are allowed until the final |
| 37 | +release. |
| 38 | + |
| 39 | +## Best Practices |
| 40 | + |
| 41 | +### Clean Commit History |
| 42 | + |
| 43 | +To encourage a clean development log, PR authors are encouraged to use `git rebase -i` to suppress trivial commit messages (e.g., `ruff` and `prettier` formatting fixes) after the PR is accepted but before it is merged. |
| 44 | + |
| 45 | +### Merge Strategy |
| 46 | + |
| 47 | +The maintainer will perform either a **3-way merge** or **squash merge** when merging a PR into the `main` branch. This approach helps avoid rebase conflict hell and maintains a cleaner project history. |
| 48 | + |
| 49 | +### Attribution |
| 50 | + |
| 51 | +The PR author should reference any papers, source code or |
| 52 | +documentation that they used while creating the code both in the PR |
| 53 | +and as comments in the code itself. If there are any licensing |
| 54 | +restrictions, these should be linked to and/or reproduced in the repo |
| 55 | +root. |
| 56 | + |
| 57 | + |
| 58 | +## Summary |
| 59 | + |
| 60 | +This policy ensures that: |
| 61 | +- All PRs receive proper review from assigned collaborators |
| 62 | +- Maintainers have final oversight before code enters the main branch |
| 63 | +- The commit history remains clean and meaningful |
| 64 | +- Merge conflicts are minimized through appropriate merge strategies |
0 commit comments