|
| 1 | +# Pull Request Guidelines |
| 2 | + |
| 3 | +Before submitting a pull request, please ensure you follow these important |
| 4 | +guidelines: |
| 5 | + |
| 6 | +## 1. GitHub Issue Requirements |
| 7 | + |
| 8 | +- Ensure you have a GitHub issue for your changes (except for trivial typo |
| 9 | + fixes) |
| 10 | +- Check existing issues to avoid duplicates |
| 11 | +- Wait for issue assessment and confirmation before starting work |
| 12 | +- Assign the issue to yourself when you start working to prevent duplicate |
| 13 | + efforts |
| 14 | + |
| 15 | +## 2. Branch Naming |
| 16 | + |
| 17 | +- Branch name should reference issue number (e.g., issue-123) |
| 18 | +- Create new branches from updated develop: |
| 19 | + ```bash |
| 20 | + git checkout develop |
| 21 | + git checkout -b issue-123 |
| 22 | + ``` |
| 23 | + |
| 24 | +## 3. Pull Request References |
| 25 | + |
| 26 | +- PR title must include issue number (e.g., "Fix #123: Improve error handling") |
| 27 | +- Include issue link in PR description |
| 28 | +- Title should clearly summarize the changes |
| 29 | + |
| 30 | +## 4. Target Branch |
| 31 | + |
| 32 | +- Always create PRs against the develop branch unless specified otherwise |
| 33 | +- Reviewers will handle backporting to other branches if needed |
| 34 | + |
| 35 | +## 5. Keep Updated |
| 36 | + |
| 37 | +- Pull latest changes before submitting PR: |
| 38 | + ```bash |
| 39 | + git pull --rebase upstream develop |
| 40 | + ``` |
| 41 | +- Run this daily when working on longer tickets |
| 42 | + |
| 43 | +## 6. Formating the Source code after making changes |
| 44 | + |
| 45 | +1. After making UI changes to the [frontend](./frontend/) directory , run the |
| 46 | + formatter to properly format the Frontend code |
| 47 | + |
| 48 | + cd frontend |
| 49 | + npm run format |
| 50 | + |
| 51 | +2. After making changes to the [backend](./src/) directory, run the formatter |
| 52 | + to properly format the Java code |
| 53 | + |
| 54 | + mvn spotless:apply |
| 55 | + |
| 56 | +## 7. Code Conventions |
| 57 | + |
| 58 | +- Follow project coding conventions |
| 59 | +- Configure IDE according to project guidelines |
| 60 | +- Review your diff carefully before committing |
| 61 | + |
| 62 | +## 8. Clean Pull Requests |
| 63 | + |
| 64 | +- Keep changes focused and related to the issue at hand |
| 65 | +- Avoid mixing unrelated changes in a single PR |
| 66 | +- Example of what NOT to do: |
| 67 | + ``` |
| 68 | + // Bad: Single PR with unrelated changes |
| 69 | + - Refactor utils class |
| 70 | + - Improve UI responsiveness in multiple components |
| 71 | + - Fix typos in documentation |
| 72 | + ``` |
| 73 | +- Instead, split into separate PRs: |
| 74 | + ``` |
| 75 | + // Good: Separate PRs for each concern |
| 76 | + PR #1: "Fix #123: Refactor utils class" |
| 77 | + PR #2: "Fix #124: Improve UI component responsiveness" |
| 78 | + PR #3: "Fix #125: Fix documentation typos" |
| 79 | + ``` |
| 80 | +- Consider squashing commits for bug fixes and small features |
| 81 | +- Don't worry about squashing review-related commits |
| 82 | +- Final squash will be handled during merge |
| 83 | + |
| 84 | +## 9. Descriptive Messages |
| 85 | + |
| 86 | +- Use meaningful PR descriptions |
| 87 | +- Include issue number and purpose |
| 88 | +- When in doubt, use the issue summary |
| 89 | + |
| 90 | +## 10. Review Process |
| 91 | + |
| 92 | +- Request review from appropriate team members |
| 93 | +- Add PR URL as comment on the issue |
| 94 | +- Address review comments promptly |
| 95 | + |
| 96 | +## 11. UI Changes |
| 97 | + |
| 98 | +- Attach screenshots to PR description or comments |
| 99 | +- Include before/after images for visual changes |
| 100 | +- For web apps, include preview links if possible |
| 101 | + |
| 102 | +## 12. Single Pull Request |
| 103 | + |
| 104 | +- Maintain one PR per issue |
| 105 | +- Push new commits to same branch to update PR |
| 106 | +- Only create new PR if original cannot be modified |
| 107 | + |
| 108 | +## 13. Replacing Pull Requests |
| 109 | + |
| 110 | +- Close old PR with explanation if creating new one |
| 111 | +- Reference new PR in closing comment |
| 112 | + |
| 113 | +## 14. Abandoning Work |
| 114 | + |
| 115 | +- Unassign yourself from issue if stopping work |
| 116 | +- Document useful findings in issue comments |
| 117 | +- Close any open PRs with explanation |
| 118 | + |
| 119 | +## 15. Build Verification |
| 120 | + |
| 121 | +- Check GitHub Actions build status |
| 122 | +- Investigate failures using "Details" link |
| 123 | +- Run `mvn clean install` locally before pushing |
| 124 | + |
| 125 | +Remember to review the "Using Git" documentation, particularly the "Submit the |
| 126 | +code" section, before creating pull requests. |
0 commit comments