Patchwork is a web-based patch tracking system designed to facilitate the contribution and management of contributions to an open-source project. https://patchwork.ozlabs.org/project/patchwork/
  • Python 90.1%
  • HTML 5.9%
  • CSS 1.1%
  • JavaScript 1%
  • Shell 1%
  • Other 0.8%
Find a file
Robin Jarry 644cef7cd3
parsemail: wrap parse_mail() in a single transaction
Wrap the entire parse_mail() call in transaction.atomic() so that all
database writes from email parsing run inside a single transaction.
The existing transaction.atomic() blocks inside parse_mail() become
savepoints within this outer transaction. The series deduplication
retry logic continues to work since savepoint rollbacks are scoped
to their own savepoint.

This also ensures that any on_commit() callbacks registered by signal
handlers only fire after the full email has been parsed and all
patch/series associations are committed.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Slight tweaks to the release notes]
2026-06-10 13:12:31 +01:00
.github CI: Reduce number of tests run for docker-compose workflow 2026-06-07 17:01:53 +01:00
docs docs: Replace older release notes with static copy 2026-06-06 12:58:58 +01:00
htdocs views: Style modification forms as an action bar 2024-11-01 15:47:20 +00:00
lib lib: add missing permissions for patchwork_covercomment_id_seq 2023-08-01 18:25:29 +01:00
patchwork parsemail: wrap parse_mail() in a single transaction 2026-06-10 13:12:31 +01:00
releasenotes parsemail: wrap parse_mail() in a single transaction 2026-06-10 13:12:31 +01:00
templates views: Switch logout to POST 2024-11-01 15:46:25 +00:00
tools docker: Update to latest stable MySQL, PostgreSQL 2026-06-07 16:10:53 +01:00
.dockerignore docker: Ignore .tox, .backups directories 2019-10-17 12:02:39 +01:00
.git-blame-ignore-revs Create git-blame-ignore-revs file 2022-05-06 20:05:26 +01:00
.gitignore Add a Makefile 2026-06-07 19:05:23 +01:00
.mailmap mailmap: update email 2021-09-01 10:14:16 +10:00
.pre-commit-config.yaml Ignore Makefile from tabs remover 2026-06-07 19:40:26 +01:00
.pyup.yml pyup: Don't pin unpinned dependencies 2023-08-01 18:38:20 +01:00
.readthedocs.yaml readthedocs: Fix builds 2026-06-07 18:17:50 +01:00
CONTRIBUTING.rst docs: Note new requirement to include a SPDX line 2018-09-19 11:34:59 +01:00
COPYING COPYING: Add the text of the GPLv2 license 2014-11-10 20:17:26 +08:00
docker-compose-pg.yml docker: Update to latest stable MySQL, PostgreSQL 2026-06-07 16:10:53 +01:00
docker-compose-sqlite3.yml docker: Fix compat with latest patchwork/pyenv image 2026-06-07 16:10:53 +01:00
docker-compose.yml docker: Update to latest stable MySQL, PostgreSQL 2026-06-07 16:10:53 +01:00
Makefile Add a Makefile 2026-06-07 19:05:23 +01:00
manage.py Bump all the dependencies 2026-06-06 12:58:58 +01:00
pyproject.toml pre-commit: Switch to ruff 2024-01-16 21:58:30 +00:00
README.rst README: Remove codecov badge 2026-06-07 18:45:09 +01:00
requirements-dev.txt Bump all the dependencies 2026-06-06 12:58:58 +01:00
requirements-prod.txt Bump all the dependencies 2026-06-06 12:58:58 +01:00
requirements-test.txt Bump all the dependencies 2026-06-06 12:58:58 +01:00
tox.ini tests: Move unit tests to unit module 2026-06-07 19:04:22 +01:00
version.txt Post-release version bump 2024-10-23 18:37:48 +01:00

=========
Patchwork
=========

.. image:: https://pyup.io/repos/github/getpatchwork/patchwork/shield.svg
   :target: https://pyup.io/repos/github/getpatchwork/patchwork/
   :alt: Requirements Status

.. image:: https://github.com/getpatchwork/patchwork/actions/workflows/ci.yaml/badge.svg
   :target: https://github.com/getpatchwork/patchwork/actions/workflows/ci.yaml
   :alt: Build Status

.. image:: https://readthedocs.org/projects/patchwork/badge/?version=latest
   :target: http://patchwork.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

.. image:: https://img.shields.io/discord/857116373653127208.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2
   :target: https://discord.gg/hGWjXVTAbB
   :alt: Discord

**Patchwork** is a patch tracking system for community-based projects. It is
intended to make the patch management process easier for both the project's
contributors and maintainers, leaving time for the more important (and more
interesting) stuff.

Patches that have been sent to a mailing list are "caught" by the system, and
appear on a web page. Any comments posted that reference the patch are appended
to the patch page too. The project's maintainer can then scan through the list
of patches, marking each with a certain state, such as Accepted, Rejected or
Under Review. Old patches can be sent to the archive or deleted.

Currently, Patchwork is being used for a number of open-source projects, mostly
subsystems of the Linux kernel. Although Patchwork has been developed with the
kernel workflow in mind, the aim is to be flexible enough to suit the majority
of community projects.

Usage
-----

Patchwork provides a web UI, a REST API, and a XML-RPC API (*deprecated*). You
can use the APIs to `build you own application`__ or you can use one the many
`existing clients`__.

There are many existing Patchwork instances. Unless you're a larger project
that is already hosting many of its own resources, you may wish to request a
project on one of these instances.

- patchwork.ozlabs.org
- patchwork.kernel.org
- patches.linaro.org
- patchwork.sourceware.org
- patchwork.open-mesh.org

__ https://patchwork.readthedocs.io/en/latest/development/api/
__ https://patchwork.readthedocs.io/en/latest/usage/clients/

Requirements
------------

Patchwork requires reasonably recent versions of:

- Python 3

- Django

- Django REST Framework

- Django Filters

The precise versions supported are listed in the `release notes`_.

Development Installation
------------------------

`Docker`_ is the recommended installation method for a Patchwork development
environment. To install Patchwork:

1. Install `Docker`_ and `docker-compose`_.

2. Clone the Patchwork repo::

       $ git clone https://github.com/getpatchwork/patchwork.git

3. (Optional) Create a ``.env`` file in the root directory of the project and
   store your ``UID`` and ``GID`` attributes there::

       $ cd patchwork && printf "UID=$(id -u)\nGID=$(id -g)\n" > .env

   This should only be necessary if you have a ``UID`` or ``GID`` other than
   ``1000``.

4. Build the images. This will download a number of packages from the internet,
   and compile several versions of Python::

       $ docker-compose build

5. Run `docker-compose up`::

       $ docker-compose up

The Patchwork instance will now be deployed at `http://localhost:8000/`.

For more information, including helpful command line options and alternative
installation methods, refer to the `documentation`_.

Talks and Presentations
-----------------------

* **Mailing List, Meet CI** (slides__) - FOSDEM 2017

* **Patches carved into stone tablets** (slides__) - Kernel Recipes Conference
  2016

* **A New Patchwork** (slides__) - FOSDEM 2016

* **Patchwork: reducing your patch workload** (slides__) - Linux Plumbers
  Conference 2011

__ https://speakerdeck.com/stephenfin/mailing-list-meet-ci
__ https://github.com/gregkh/presentation-stone-tools/blob/34a3963/stone-tools.pdf
__ https://speakerdeck.com/stephenfin/a-new-patchwork-bringing-ci-patch-tracking-and-more-to-the-mailing-list
__ https://www.linuxplumbersconf.org/2011/ocw/system/presentations/255/original/patchwork.pdf

Additional Information
----------------------

For further information, refer to the `documentation`_.

Contact
-------

For bug reports, patch submissions or other questions, use the `mailing list`_.

.. _release notes: https://patchwork.readthedocs.io/en/latest/releases/
.. _docker-compose: https://docs.docker.com/compose/install/
.. _Docker: https://docs.docker.com/engine/installation/linux/
.. _documentation: https://patchwork.readthedocs.io/
.. _mailing list: https://ozlabs.org/mailman/listinfo/patchwork