Skip to content

Commit 55dde60

Browse files
committed
Site/contributing: add recommendations for working with PRs
This change updates the PR guidelines on the "Contributing" web page after [this discussion](https://lists.apache.org/thread/kfxo3cqmw3pgrpgtgqvqpwvn46yw8q7h).
1 parent 0eafcaa commit 55dde60

File tree

1 file changed

+50
-22
lines changed

1 file changed

+50
-22
lines changed

CONTRIBUTING.md

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,60 @@ Before starting on a large code change, please describe the concept/design of wh
6464

6565
The best way to provide changes is to fork Apache Polaris repository on GitHub and provide a Pull Request with your changes. To make it easy to apply your changes please use the following conventions:
6666

67-
* Every Pull Request should have a matching GitHub Issue.
68-
* Create a branch that will house your change:
69-
70-
```bash
71-
git clone https://github.com/apache/polaris
72-
cd polaris
73-
git fetch --all
74-
git checkout -b my-branch origin/main
75-
```
76-
77-
Don't forget to periodically rebase your branch:
78-
79-
```bash
80-
git pull --rebase
81-
git push GitHubUser my-branch --force
82-
```
83-
84-
Ensure the code is properly formatted:
85-
86-
```bash
87-
./gradlew format
88-
```
67+
#### Before opening a pull request
8968

9069
* Pull Requests should be based on the `main` branch.
70+
* Create a branch that will house your change:
71+
```bash
72+
git clone https://github.com/apache/polaris
73+
cd polaris
74+
git checkout main
75+
git pull
76+
git checkout -b my-branch
77+
```
78+
* Work on the changes of your pull requests locally.
79+
* Ensure the code is properly formatted:
80+
```bash
81+
./gradlew format
82+
```
83+
* Ensure the code is passing the tests:
84+
```bash
85+
./gradlew check
86+
```
87+
* You may want to push your changes to your personal Polaris fork. Git will emit a URL that you can use to create the pull request. Do not create the pull request yet.
88+
```bash
89+
git push --set-upstream your-github-accout
90+
```
91+
92+
#### Opening a pull request
93+
94+
* Before opening a pull request, squash all commits in your branch into a single commit
95+
* Update the subject and message of the commit to match the summary and description of the latter pull-request, GitHub will populate the PR summary and description from the "single" commit.
96+
* Make sure that the summary reflects the targeted area of the code base, for example `docs` or `CI`. Get inspired by [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
97+
* The PR description should describe the background of the change and a description of the changes in way that someone who has no prior knowledge can understand the rationale of the change and the change itself.
98+
* If there is a matching GitHub Issue, add a separate line at the end of the commit message of the issue that the PR fixes. Do not add the issue number into the subject.
99+
```
100+
Fixes #123456
101+
```
102+
If the PR does not fully fix the issue, use `Related to #123456` instead of `Fixes #123456`.
103+
* When opening a PR consider whether the PR is "draft" or already "ready for review". "Draft" means work in progress, things will change, but comments are welcome. "Ready for review" means that the PR is requested to be merged as is (pending review feedback).
104+
105+
#### Working on a pull request
106+
107+
* Don't forget to periodically rebase your branch:
108+
```bash
109+
git pull --rebase
110+
git push your-github-accout my-branch --force
111+
```
91112
* Test that your changes works by adapting or adding tests. Verify the build passes (see `README.md` for build instructions).
92113
* If your Pull Request has conflicts with the `main` branch, please rebase and fix the conflicts.
114+
* If your PR requires more work or time or bigger changes, please put the PR to "draft" state to indicate that it is not meant to be "thoroughly" reviewed at this point.
115+
116+
#### Merging a pull request
117+
118+
* When a PR is about to be merged, cross-check the commit summary and message for the merged Git commit.
119+
* Keep in mind that the Git commit subject and message is going to be read by other people, potentially even after years. The Git commit subject and message will appear "as is" in release notes.
120+
* Make sure the subject and message are properly formatted and contains a concise description of the changes in way that someone who has no prior knowledge can understand the rationale of the change and the change itself. Remove information that's of no use for someone reading the Git commit log, for example single intermediate commit messages like `formatting` or `fix test`.
93121

94122
## Java version requirements
95123

0 commit comments

Comments
 (0)