Code Contributing

PolarDB for PostgreSQL is an open source product from PostgreSQL and other open source projects. Our main target is to create a larger community for PostgreSQL. Contributors are welcomed to submit their code and ideas. In a long run, we hope this project can be managed by developers from both inside and outside Alibaba.

Before Contributing

  • Read and follow our Code of Conduct.
  • Sign CLA of PolarDB for PostgreSQL: Please download PolarDB CLACode Contributing - 图1. Follow the instructions to sign it.

Here is a checklist to prepare and submit your PR (pull request):

  • Create your own Github branch by forking ApsaraDB/PolarDB-for-PostgreSQL.
  • Checkout documentations for how to start PolarDB from source code.
  • Push changes to your personal fork and make sure they follow our coding style.
  • Create a PR with a detailed description, if commit messages do not express themselves.
  • Submit PR for review and address all feedbacks.
  • Wait for merging (done by committers).

An Example of Submitting Code Change to PolarDB

Let’s use an example to walk through the list.

Fork Your Own Branch

On GitHub repository of PolarDB for PostgreSQLCode Contributing - 图2, Click fork button to create your own PolarDB repository.

Create Local Repository

  1. git clone https://github.com/your_github/PolarDB-for-PostgreSQL.git

Create a dev Branch (named as test-github)

  1. git checkout -b test-github

Make Changes and Commit Locally

  1. git status
  2. git add files-to-change
  3. git commit -m "modification for test-github"

Rebase and Commit to Remote Repository

  1. git checkout main
  2. git pull
  3. git checkout test-github
  4. git rebase main
  5. -- resolve conflict, compile and test --
  6. git push origin test-github

Create a PR

Click New pull request or Compare & pull request button, choose to compare branches ApsaraDB/PolarDB-for-PostgreSQL:main and your_github/PolarDB-for-PostgreSQL:test-github, and write PR description.

Address Reviewers’ Comments

Resolve all problems raised by reviewers and update PR.

Merge

It is done by PolarDB committers.

Edit this page on GitHub Code Contributing - 图3

Contributors: 北侠