apps/www/_blog/2022-10-27-postgresql-commitfest.mdx
The PostgreSQL community has a specific, effective, and time-tested method for contributing to the core code.
Proposals and changes to PostgreSQL (called patches) are submitted via email to the common Postgres hackers' mailing list [email protected]. Then you can track all activity simply by reading your mailbox. You can also follow this mailing list online at postgresql.org/list/pgadmin-hackers.
The mailing list contains a lot of different discussions. Some of the patches are preliminary POCs (proof-of-concept) not to be committed to the core directly, and some are urgent bug fixes. When a feature is intended for merging this should be done by creating a Commitfest entry, which resembles a pull request.
Commitfest is a month-long activity where Postgres contributors and core staff (committers) dedicate to looking at the patches, reviewing them, improving, and committing to the master branch. Effectively these are the months you most probably get feedback on your patches.
There are 5 commitfests each year. You can see the schedule at commitfest.postgresql.org. You can only attach a patch to a commitfest that hasn't started yet (i.e. before 1st day of a commitfest month).
There are numerous benefits:
Generally, all patches that touch the core code are welcome. It's not necessary that they are complex. In fact, it's an excellent strategy to start by fixing or improving something small.
The main topics to propose are: bugfixes, performance, server features, clients, security, SQL commands, testing improvements, replication and recovery, procedural languages, code refactoring (yes, it's very important!), monitoring and control, and documentation.
Some ideas on what to submit:
You can find a list of patches for the upcoming commitfest here: commitfest.postgresql.org/40
Make a git branch that is based on the most recent master branch (github.com/postgres/postgres):
git clone https://github.com/postgres/postgres
git checkout master
git checkout -b your_branch_name
Add your code to the branch (i.e. cherry-pick your commits from another branch).
Rebase and squash your patch code to be 1 commit against master:
git rebase -i HEAD~5
# This will take the last 5 commits in a branch
# and you can do anything with them:
# squash, change order, change commit message, etc
Edit your commit message to be meaningful and clear. Be concise, but don't be too short. Reviewers enjoy understanding the purpose of a patch and what it does. This is especially important if the patchset consists of several patches. The first line of the commit message will become the patch name on a step later so make that line particularly clear and concise.
Don't forget to add all the patch authors with their emails to the commit message.
git format-patch -1 -v13
# 1 = patch depth.
# The number of topmost patches to include
# v13 = the patch version.
# Make new version number anytime you want to
# send updated patch to the same thread)
Attach the file(s) to an email message (they look like v13-0001-Naming-of-a-patch.patch)
Compose email message to [email protected]. Write all rationale and details of your proposal. The main thing to bear in mind is that attracting attention to your proposal is like 50% of success. Also, please be polite.
It's encouraged to split complicated patches into several independently working parts as it's much easier to review (although not all complicated patches are easy to decompose).
After you have created a patch, you can attach it to a Commitfest thread:
Message-ID: <CANbhV-FG-1ZNMBuwhUF7AxxJz3u5137dYL-o6hchK1V_dMw86g@mail.gmail.com>)That's all. Congrats!
After you have a submitted your patch, several things will happen:
The commit process is a two-step:
The time and attention of committers are limited, which is why there is a two-step process. Some patches that pass the initial review won't receive reviewers' attention. In that case, they will be transferred to the next commitfest automatically.
CF finishes around the 1st day of the next month (i.e. November CF starts on November 1 and finishes on December 1). For any patches that do not get merged:
All these "automatic" things are actually done by commitfest managers (volunteers), so if you have any requests, doubts, or questions you can write them personally.
Please note that hackers almost never reject patches! They just return it and the author if he is still willing and has time to work on the patch further can attach it (the same thread) to the next commitfest anytime.
Feature-freeze is an annual event that targets patches released into a major PostgreSQL version. Feature-freeze for the "current-year" release is at the end of a March commitfest. All patches committed on and before will be released in the PG major release (in October). Everything committed after March (July, September, etc) will go into next year's major release.
For that reason, the March Commitfest takes 10-15 days longer than the usual 1 month, finishing in mid-April. It's important for the author to continue watching your patches and feedback until that time. Commits in early April are big!
[offlist] to the message subject to prevent confusion.If you're interested in contributing to PostgreSQL full time, Supabase is hiring Postgres Core Contributors.