Code of Conduct
Everyone who participates in Apache Cloudberry, either as a user or a contributor, is obliged to follow our community Code of Conduct.
Ready to contribute
Before starting to contribute, please read the guide "How to Contribute" and make sure to learn Git & GitHub well.
Especially as a new code contributor, don't rush to start. We suggest that you understand our project, read the documentation, learn the code conventions, know how to write proposals, and familiarize yourself with the community. Then start small.
You can look for easy issues to fix or small features to add, such as the GitHub Issues with labels “good first issue” and "help wanted" which can help you familiarize yourself with the contribution workflow, and for the dev teams to become acquainted with you.
Don't import components under GPLv2/3 License or other non-OSI licenses for your code, which will interfere with Cloudberry's Apache License. If you are not sure, please contact dev@cloudberry.apache.org.
To avoid duplicating work, please review the Apache Cloudberry Proposals or ask directly in our Slack before you start work on a non-trivial feature.
Code Conventions
Source code should follow the PostgreSQL coding conventions.
Source Formatting
This includes source
formatting
with 4 column tab spacing, layout rules according to the BSD style and
line length within 80 columns. Though there are many different styles
in the PostgreSQL codebase we can try to make your patch consistent with nearby code
(See discussions in PostgreSQL mailing
list.)
We can use existing configurations for Apache Cloudberry development, such as Vim, Emacs, Clion and other editors.
Error Messages
Error messages style follows PostgreSQL Error Message Style Guide.
Contribution workflow
The following will describe how to submit your code contribution as
Pull Request
to Apache Cloudberry. If you still don't know well
how to work with Git and GitHub, please read our
guide again.
To contribute to Apache Cloudberry development:
-
Fork the Apache Cloudberry repo to your own GitHub account.
-
Clone down the repo to your local system.
$ git clone https://github.com/your-user-name/cloudberry.git
-
Add the upstream repo. (You only have to do this once, not every time.)
$ git remote add upstream https://github.com/apache/cloudberry.git
now, when you run
git remote -v
will show two remote repositories named:upstream
, which refers to the 'apache/cloudberry' repositoryorigin
, which refers to your personal fork
-
Create a new branch to hold your work.
$ git checkout -b new-branch-name
-
Work on your new code. Write and run tests.
-
Commit your changes. For writing a good commit message, please refer to Commit Conventions.
$ git add
$ git commit -
Push your changes to your GitHub repo.
git push origin branch-name
-
Open a PR(Pull Request).
Go to the Apache Cloudberry repo on GitHub. There will be a message about your recently pushed branch, asking if you would like to open a pull request. Follow the prompts, compare across repositories, and submit the PR.
For code contributors, don’t rebase your branch orotherwise modify published commits during the code review process, since this can remove existing comment history and confuse the reviewers when reviewing. When you make a revision, always push it in a new commit.
-
Get your code reviewed.
Apache Cloudberry maintainers and other contributors will review your PR. Please participate in the conversation, and try to make any requested changes. If you get no review comments within two weeks, feel free to ask for feedback by ask the cloudberry committers in your PR comment.
Once the maintainers are happy with your change, they'll approve the pull request. At this point, the maintainer will take over, possibly make some additional touch ups, and merge your changes into the codebase.
-
Congratulations! Once your PR is approved by at least 2 maintainers with write access, and passes the CI/CD without errors, then the code will be merged. Your code will be shipped in the recent future releases.
Before working on your next contribution, make sure your local repository is up to date:
-
Switch to the local main branch.
$ git checkout main
-
Fetch the latest changes from upstream.
$ git fetch upstream