]> git.ipfire.org Git - thirdparty/patchwork.git/log
thirdparty/patchwork.git
3 days agoparsemail: wrap parse_mail() in a single transaction main
Robin Jarry [Mon, 8 Jun 2026 11:59:43 +0000 (13:59 +0200)] 
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]

3 days agoparsemail: fix SeriesReference race with concurrent delivery
Robin Jarry [Mon, 8 Jun 2026 12:00:55 +0000 (14:00 +0200)] 
parsemail: fix SeriesReference race with concurrent delivery

When multiple parsemail processes run in parallel (e.g. postfix
delivering several messages from the same series at once), two
processes can try to create a SeriesReference for the same msgid
simultaneously. The second one fails with an IntegrityError:

  django.db.utils.IntegrityError: duplicate key value violates
  unique constraint "patchwork_seriesreference_project_id_msgid_..."
  DETAIL: Key (project_id, msgid)=(2, <...>) already exists.

This can result in incomplete series that never reach the
"received_all" state because the failed parsemail invocation
prevents one of the patches from being recorded.

The existing get/create pattern has a classic TOCTOU race: the get
succeeds (no reference found), but by the time create runs, another
process has already inserted the row. Replace both the try/get/
except/create block and the bare create call with get_or_create
which handles the race atomically at the database level.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviwed-by: Stephen Finucane <stephen@that.guru>
5 days agoIgnore Makefile from tabs remover
Stephen Finucane [Sun, 7 Jun 2026 18:40:26 +0000 (19:40 +0100)] 
Ignore Makefile from tabs remover

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agoAdd a Makefile
Stephen Finucane [Thu, 13 Sep 2018 17:13:20 +0000 (11:13 -0600)] 
Add a Makefile

Time to go old school. When using Docker, we can't simply use tox or
manage.py command as commands should run inside the container and not on
the host. To resolve this, we recommend using 'docker-compose run --rm
web tox', which will run tox in the container. Having to remember these
rather esoteric commands is annoying though (particularly when I haven't
run it recently and therefore can't find the command with '<Ctrl>+R'). A
series of make targets make this a heck of a lot easier for us.

Note that this isn't ideal and won't entirely remove the need to run the
above command. This is mostly due to how make is designed: namely, we
need to pass positional arguments but each positional argument in make
should be a target. This does, however, cover the biggest use cases and
is therefore worth doing.

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agotests: Move data to new directory
Stephen Finucane [Sun, 7 Jun 2026 16:30:21 +0000 (17:30 +0100)] 
tests: Move data to new directory

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agotests: Rework XMLRPC tests to avoid live server
Stephen Finucane [Sun, 7 Jun 2026 16:22:24 +0000 (17:22 +0100)] 
tests: Rework XMLRPC tests to avoid live server

This should speed them up somewhat and make the distinction between the
unit tests and upcoming e2e tests clearer.

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agotests: Move unit tests to unit module
Stephen Finucane [Sun, 7 Jun 2026 15:51:56 +0000 (16:51 +0100)] 
tests: Move unit tests to unit module

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agoREADME: Remove codecov badge
Stephen Finucane [Sun, 7 Jun 2026 17:45:09 +0000 (18:45 +0100)] 
README: Remove codecov badge

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agoreadthedocs: Fix builds
Stephen Finucane [Sun, 7 Jun 2026 17:17:50 +0000 (18:17 +0100)] 
readthedocs: Fix builds

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agotemplatetags: Render links as XHTML links
Abdun Nihaal [Mon, 14 Apr 2025 07:28:33 +0000 (12:58 +0530)] 
templatetags: Render links as XHTML links

Convert links in the commit message and comments, to be rendered as
clickable XHTML links for easy navigation.

Currently only http, https, ftp and git are recognized. And only links
that are not broken across lines are recognized.

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Closes: #591
5 days agoPrevent any user from updating public bundles
Abdun Nihaal [Wed, 16 Apr 2025 16:32:36 +0000 (22:02 +0530)] 
Prevent any user from updating public bundles

Currently, the web UI allows any logged in user to remove patches from
public bundles. However the correct behaviour is that only the owner of
the bundle should be allowed to update a bundle.

Fix that by adding checks in set_bundle() before adding or removing
patches from bundles.

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Closes: #599
5 days agonotifications.py: don't crash if notifications recipient is invalid
Mauro Carvalho Chehab [Tue, 30 Jan 2024 08:22:09 +0000 (08:22 +0000)] 
notifications.py: don't crash if notifications recipient is invalid

On Django 3:3.2.19, if recipient is not filled or is invalid, cron
job fails with:

  Traceback (most recent call last):
    File "/usr/local/patchwork/./manage.py", line 17, in <module>
      execute_from_command_line(sys.argv)
    File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
      utility.execute()
    File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 413, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 354, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 398, in execute
      output = self.handle(*args, **options)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/patchwork/patchwork/management/commands/cron.py", line 19, in handle
      errors = send_notifications()
               ^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/patchwork/patchwork/notifications.py", line 84, in send_notifications
      message.send()
    File "/usr/lib/python3/dist-packages/django/core/mail/message.py", line 284, in send
      return self.get_connection(fail_silently).send_messages([self])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 109, in send_messages
      sent = self._send(message)
             ^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 122, in _send
      recipients = [sanitize_address(addr, encoding) for addr in email_message.recipients()]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 122, in <listcomp>
      recipients = [sanitize_address(addr, encoding) for addr in email_message.recipients()]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/django/core/mail/message.py", line 99, in sanitize_address
      address_parts = nm + localpart + domain
                      ~~~^~~~~~~~~~~
  TypeError: can only concatenate str (not "NoneType") to str

As there's no point trying to send a notification to an invalid
e-mail, just drops it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Co-authored-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Updated to fix linter issues]

5 days agoCI: Reduce number of tests run for docker-compose workflow
Stephen Finucane [Sun, 7 Jun 2026 15:46:11 +0000 (16:46 +0100)] 
CI: Reduce number of tests run for docker-compose workflow

We do not need to run the entire test suite again. Speed things up.

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agopatch.py: better handle color states
Mauro Carvalho Chehab [Wed, 27 May 2026 07:49:00 +0000 (07:49 +0000)] 
patch.py: better handle color states

The current logic applies checks color only once. That's
weird and makes harder for people to properly idenfify
CI checks when there are multiple CI reports at the same line.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
5 days agomodels: optimize with_tag_counts using case-when
Tales da Aparecida [Mon, 21 Oct 2024 12:14:03 +0000 (09:14 -0300)] 
models: optimize with_tag_counts using case-when

Leverage PatchTag index replacing the subquery counter with a JOIN.

The current code is too slow on MySQL, as it doesn't use indexes.
The new approach is more direct and allows proper index usage.

Signed-off-by: Tales da Aparecida <tales.aparecida@redhat.com>
5 days agodocker: Update to latest stable MySQL, PostgreSQL
Stephen Finucane [Sat, 6 Jun 2026 11:50:01 +0000 (12:50 +0100)] 
docker: Update to latest stable MySQL, PostgreSQL

MySQL 9.7 changed the default gtid_mode from OFF to ON (since 9.5). When
the MySQL Docker container initialises, the init scripts run with
GTID=ON, leaving non-empty GTID_EXECUTED in the binary log even though
the final server starts with --gtid-mode=OFF.

This causes two problems:

1. mysqldump always includes SET @@GLOBAL.GTID_PURGED when cloning
   test databases for parallel tests. Restoring this requires
   SYSTEM_VARIABLES_ADMIN, which was not granted.

2. mysqldump requires PROCESS to dump tablespace information. While
   PROCESS was being granted, SYSTEM_VARIABLES_ADMIN was missing
   from the grants, causing clone failures (exit code 5) for Django
   6.0's stricter parallel test runner.

Fix both issues by:

- Running RESET BINARY LOGS AND GTIDS before granting privileges,
  which clears the GTID state left by the init phase so mysqldump
  no longer emits GTID_PURGED statements.

- Adding SYSTEM_VARIABLES_ADMIN to the privilege grants so that if
  any GTID state is present (e.g. in future MySQL versions), the
  restore can set GTID_PURGED.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 days agodocker: Use default packages
Stephen Finucane [Sun, 7 Jun 2026 12:52:29 +0000 (13:52 +0100)] 
docker: Use default packages

These are also compatible with Debian.

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agodocker: Fix deprecation warning
Stephen Finucane [Sun, 7 Jun 2026 12:09:18 +0000 (13:09 +0100)] 
docker: Fix deprecation warning

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 days agodocker: Fix compat with latest patchwork/pyenv image
Stephen Finucane [Sat, 6 Jun 2026 12:04:43 +0000 (13:04 +0100)] 
docker: Fix compat with latest patchwork/pyenv image

We switched to the Ubuntu 24.04 base image some time back. This includes
an ubuntu user that conflicts with the patchwork user we were creating.
Simplify this by using the ubuntu user instead.

Signed-off-by: Stephen Finucane <stephen@that.guru>
7 days agodocs: Replace older release notes with static copy
Stephen Finucane [Sat, 6 Jun 2026 11:24:14 +0000 (12:24 +0100)] 
docs: Replace older release notes with static copy

Generated with:

  reno report --branch $branch --stop-at-branch-base --no-show-source

where $branch was the respective stable branch. This allows us to tag
and delete these old branches.

Signed-off-by: Stephen Finucane <stephen@that.guru>
7 days agoCI: Avoid duplication of jobs
Stephen Finucane [Sat, 6 Jun 2026 11:07:35 +0000 (12:07 +0100)] 
CI: Avoid duplication of jobs

Only run on pushes to main and stable branches.

Signed-off-by: Stephen Finucane <stephen@that.guru>
7 days agoparser: Strip NUL bytes
Stephen Finucane [Sat, 6 Jun 2026 11:33:39 +0000 (12:33 +0100)] 
parser: Strip NUL bytes

psycopg (v3) strictly rejects NUL bytes (0x00) in PostgreSQL text
fields, unlike psycopg2 which handled them silently. Malformed emails
(such as the codec-null.mbox fuzz fixture in our test suite) contain NUL
bytes in headers and body content, causing DataError on insert.

Strip NUL bytes from all text fields before they reach the database.
This is safe for all fields:

* Headers are restricted to printable ASCII by RFC 5322 meaning NUL
  bytes there always indicate corruption

* Email body / commit message content is plain text so NUL bytes are
  equally invalid here

* Unified diffs should also never contain NUL bytes. Git uses their
  presence as the heuristic to classify a file as binary, at which point
  it either emits 'Binary files ... differ' or, with --binary, a
  base85-encoded binary patch, both of which are entirely printable
  ASCII. A legitimate patch produced by git format-patch will therefore
  never carry NUL bytes in the diff text itself.

Signed-off-by: Stephen Finucane <stephen@that.guru>
7 days agoBump all the dependencies
Stephen Finucane [Sat, 6 Jun 2026 10:25:43 +0000 (11:25 +0100)] 
Bump all the dependencies

We also change our testing matrix so that we only test the upper and
lower bounds of supported Python releases. This should ease pressure on
CI somewhat. We also switch from the deprecated psycopg2 to psycopg
(which actually corresponds to v3 now).

Changes to the source were auto-generated with django-upgrade.

Signed-off-by: Stephen Finucane <stephen@that.guru>
7 days agopre-commit: Bump versions
Stephen Finucane [Sat, 6 Jun 2026 10:16:04 +0000 (11:16 +0100)] 
pre-commit: Bump versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agoCI: Enable pip caching
Stephen Finucane [Tue, 11 Mar 2025 09:15:15 +0000 (09:15 +0000)] 
CI: Enable pip caching

Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agorelease-notes: Add release note
Adam Hassick [Thu, 30 Jan 2025 19:56:42 +0000 (14:56 -0500)] 
release-notes: Add release note

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Rename Project field from parse_dependencies to
             show_dependencies]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agodocs: Add generated API schemas
Adam Hassick [Thu, 30 Jan 2025 19:56:41 +0000 (14:56 -0500)] 
docs: Add generated API schemas

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Rename Project field from parse_dependencies to
             show_dependencies.]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agodocs: Add feature info and increment API version
Adam Hassick [Thu, 30 Jan 2025 19:56:40 +0000 (14:56 -0500)] 
docs: Add feature info and increment API version

The following patch will add the generated schema files as they are very
large.

* Increment the API version from v1.3 to v1.4.
* Update schema documentation to reflect the version change.
* Add blurb documenting the "Depends-on" tag to the usage overview.

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Tweak docs]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agotests: Add tests for new functionality
Adam Hassick [Thu, 30 Jan 2025 19:56:39 +0000 (14:56 -0500)] 
tests: Add tests for new functionality

* Add tests for the API and parser changes.
* Add new test mbox files.
* Add new patch series tests.
* Add test to check that dependencies are not shown when disabled.

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Rename Project field from parse_dependencies to
             show_dependencies. Add some additional tests]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agoparser: Parse "Depends-on" tags in emails
Adam Hassick [Thu, 30 Jan 2025 19:56:38 +0000 (14:56 -0500)] 
parser: Parse "Depends-on" tags in emails

Add a new function to parse "Depends-on" tags to the parser. The value
may either be the message ID of a patch or cover letter email already
received by Patchwork, or the web URL of a patch or series. When this
tag is found, the parser will add the series (or the series the patch
belongs to) as a dependency to the series it is creating.

This parser feature is only active when the feature flag is enabled on
the project related to the patch or cover letter.

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Parse patch dependencies unconditionally]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agoadmin: Add Series.dependencies field
Stephen Finucane [Mon, 10 Mar 2025 20:57:01 +0000 (20:57 +0000)] 
admin: Add Series.dependencies field

Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agoapi: Add fields to series detail view
Adam Hassick [Thu, 30 Jan 2025 19:56:37 +0000 (14:56 -0500)] 
api: Add fields to series detail view

* Add the "dependencies" and "dependents" fields to the series detail
  view.
* Add "parse_dependencies" to the project detail view.

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Rename Project field from parse_dependencies to
             show_dependencies]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agomodels: Add fields for series dependencies
Adam Hassick [Thu, 30 Jan 2025 19:56:36 +0000 (14:56 -0500)] 
models: Add fields for series dependencies

* Add a ManyToMany field to represent a dependency relationship between
  patch series and a helper method to add dependencies.
* Add the parse_dependency field to the Project model.

Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Acked-by: Aaron Conole <aconole@redhat.com>
[stephenfin: Rename Project field from parse_dependencies to
             show_dependencies. Also add 'blank=True' to
             Series.cover_letter field]
Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agochore: fix docker compose files for macos
Victor Accarini [Thu, 26 Dec 2024 13:53:03 +0000 (10:53 -0300)] 
chore: fix docker compose files for macos

15 months agoRevert "docker: Remove remnants of .env file configuration"
Stephen Finucane [Mon, 10 Mar 2025 22:27:55 +0000 (22:27 +0000)] 
Revert "docker: Remove remnants of .env file configuration"

This reverts commit 359a8566dbbdfcd4463b261ecc377ed40deb6ace.
We can simply pass the '-o' / '--non-unique' argument instead.

Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agobuild(deps-dev): update django-debug-toolbar requirement
dependabot[bot] [Mon, 20 Jan 2025 11:17:10 +0000 (11:17 +0000)] 
build(deps-dev): update django-debug-toolbar requirement

Updates the requirements on [django-debug-toolbar](https://github.com/django-commons/django-debug-toolbar) to permit the latest version.
- [Release notes](https://github.com/django-commons/django-debug-toolbar/releases)
- [Changelog](https://github.com/django-commons/django-debug-toolbar/blob/main/docs/changes.rst)
- [Commits](https://github.com/django-commons/django-debug-toolbar/compare/4.4.6...5.0.1)

---
updated-dependencies:
- dependency-name: django-debug-toolbar
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
15 months agodocker: Remove remnants of .env file configuration
Stephen Finucane [Mon, 10 Mar 2025 20:36:12 +0000 (20:36 +0000)] 
docker: Remove remnants of .env file configuration

Signed-off-by: Stephen Finucane <stephen@that.guru>
15 months agopre-commit: Bump versions
Stephen Finucane [Sat, 8 Mar 2025 10:59:34 +0000 (10:59 +0000)] 
pre-commit: Bump versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoview: Show pagination ellipsis only when needed
Stephen Finucane [Mon, 4 Nov 2024 20:42:16 +0000 (20:42 +0000)] 
view: Show pagination ellipsis only when needed

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #614
19 months agoviews: Reverse pagination naming
Stephen Finucane [Mon, 4 Nov 2024 20:38:40 +0000 (20:38 +0000)] 
views: Reverse pagination naming

The leading_set contained the page numbers that should be shown trailing
(i.e. on the right of the paginator). This was confusing. Correct it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoviews: Style modification forms as an action bar
Raxel Gutierrez [Mon, 23 Aug 2021 18:28:32 +0000 (18:28 +0000)] 
views: Style modification forms as an action bar

Add styling to the new patch list html code to make the change property
and bundle action forms more usable. Before [1] and after [2] images for
reference.

[1] https://i.imgur.com/Pzelipp.png
[2] https://i.imgur.com/UtNJXuf.png

Signed-off-by: Raxel Gutierrez <raxel@google.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Addressed merge conflicts, tweak CSS slightly]

19 months agoviews: Move and refactor patch-forms
Raxel Gutierrez [Mon, 23 Aug 2021 18:28:31 +0000 (18:28 +0000)] 
views: Move and refactor patch-forms

Move patch forms in patch-list and detail page to a new template file
patch-forms.html and move them to the top of the patch-list page to
improve their discoverability.

Refactor forms.py, __init__.py, patch.py, and test_bundles.py files so
that the shared bundle form in patch-forms.html works for both the
patch-list and patch-detail pages. In particular, the changes normalize
the behavior of the error and update messages of the patch forms and
updates tests to reflect the changes. Overall, these changes make patch
forms ready for change and more synchronized in their behavior. More
specifically:

- Previously patch forms changes were separated between the patch-detail
  and patch-list pages. Thus, desired changes to the patch forms
  required changes to patch-list.html, submission.html, and forms.py.
  So, the most important benefit to this change is that forms.py and
  patch-forms.html become the two places to adjust the forms to handle
  form validation and functionality as well as UI changes.

- Previously the patch forms in patch-list.html handled error and
  update messages through views in patch.py, whereas the patch forms in
  submission.html handled the messages with forms.py. Now, with a single
  patch forms component in patch-forms.html, forms.py is set to handle
  the messages and handle form validation for both pages.

Signed-off-by: Raxel Gutierrez <raxel@google.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Address merge conflicts]

19 months agoviews: Move js code to separate file
Raxel Gutierrez [Mon, 23 Aug 2021 18:28:30 +0000 (18:28 +0000)] 
views: Move js code to separate file

Move patch-list related JS code to a new patch-list.js file, to
make the JavaScript easy to read and change in one place. This makes
automatic code formatting easier, makes it more straightforward to
measure test coverage and discover opportunities for refactoring, and
simplifies a possible future migration to TypeScript if the project
chooses to go in that direction.

No user-visible change should be noticed.

Signed-off-by: Raxel Gutierrez <raxel@google.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Addressed merged conflicts]

19 months agoviews: Clean up patch-list page
Raxel Gutierrez [Mon, 23 Aug 2021 18:28:29 +0000 (18:28 +0000)] 
views: Clean up patch-list page

Add ids to table cells, and rename selectors using hyphen delimited
strings to clean up and improve readability of patch-list.html. Also,
create a partial template errors.html for errors that render with form
submission.These changes make the code healthier, ready for change, and
overall more readable.

No user-visible change should be noticed.

Signed-off-by: Raxel Gutierrez <raxel@google.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Addressed merge conflicts and renamed some Python variables
             in snake_case also]

19 months agoviews: Don't show chevron if user can't change sort order
Stephen Finucane [Fri, 1 Nov 2024 13:48:28 +0000 (13:48 +0000)] 
views: Don't show chevron if user can't change sort order

We prevent users changing the column that sorting is done on when
allowing users to change the order of patches in a bundle. However, we
still show a chevron and clicking the link will appear to do something.
This is confusing/misleading. Remove the chevron and the link in this
situation.

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoviews: Switch logout to POST
Stephen Finucane [Fri, 1 Nov 2024 15:45:03 +0000 (15:45 +0000)] 
views: Switch logout to POST

This was deprecated in 4.1 and removed in 5.0. I missed it.

[1] https://docs.djangoproject.com/en/5.0/releases/4.1/#features-deprecated-in-4-1

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agomodels: Add covering index for Patch.hash
Stephen Finucane [Wed, 24 Jan 2024 11:09:46 +0000 (11:09 +0000)] 
models: Add covering index for Patch.hash

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #579
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
19 months agocss: make diff colors more accessible
Robin Jarry [Wed, 5 Oct 2022 14:24:05 +0000 (16:24 +0200)] 
css: make diff colors more accessible

The colors used to display patch diffs are confusing. The context color
is very similar to the added line color and the contrast between added
and removed lines is very low.

Originally, the choice of purple/blue (instead of the more common
red/green palette) may have been made with colorblindness accessibility
in mind. However, after inspecting the current colors with
colorblindness "simulators", I found that the low contrast was
consistent no matter what vision deficiency (if any) you might have.

Update the colors to use a more common red/green palette. Add background
colors to increase contrast for colorblind people. Use less confusing
colors for context and diff hunks. Use normal line height to prevent
background colors from overlapping. Use a different color for email
quotes (blue) to avoid confusion with added lines.

I have made a compilation of the current and updated color palette
previews for normal vision and all common color deficiencies. I also
included the same diff as seen from Github interface for reference.

Link: http://files.diabeteman.com/patchwork-diff-colors/
Signed-off-by: Robin Jarry <robin@jarry.cc>
19 months agotests: Dump more info if version test fails
Stephen Finucane [Thu, 31 Oct 2024 22:59:18 +0000 (22:59 +0000)] 
tests: Dump more info if version test fails

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoCI: Cancel builds upon a new push
Stephen Finucane [Thu, 31 Oct 2024 22:18:20 +0000 (22:18 +0000)] 
CI: Cancel builds upon a new push

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agotemplates/submission: Fix alignment of commit message
Thomas Monjalon [Fri, 16 Aug 2024 07:20:28 +0000 (09:20 +0200)] 
templates/submission: Fix alignment of commit message

Preformatted content must not be indented
because any space is kept in the output,
making the content wrongly indented.

When aligning message headers to the left,
the new HTML code has been indented
including some preformatted content indented with two spaces.

The fix is to remove the indent of the content.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Fixes: fe34ab2ffad3 ("patch-detail: left align message headers")
Reviewed-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Stephen Finucane <stephen@that.guru>
19 months agoCI: Bump action versions
Stephen Finucane [Wed, 23 Oct 2024 18:14:57 +0000 (19:14 +0100)] 
CI: Bump action versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agodocs: Fix typo
Stephen Finucane [Wed, 23 Oct 2024 17:46:23 +0000 (18:46 +0100)] 
docs: Fix typo

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoUpdate reno for stable/3.2
Stephen Finucane [Wed, 23 Oct 2024 17:40:35 +0000 (18:40 +0100)] 
Update reno for stable/3.2

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoPost-release version bump
Stephen Finucane [Wed, 23 Oct 2024 17:37:48 +0000 (18:37 +0100)] 
Post-release version bump

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoRelease 3.2.0 v3.2.0
Stephen Finucane [Wed, 23 Oct 2024 17:35:50 +0000 (18:35 +0100)] 
Release 3.2.0

Another smaller release, this time with no new API versions.

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agodocs: Update release note to reflect timelines
Stephen Finucane [Wed, 23 Oct 2024 17:28:23 +0000 (18:28 +0100)] 
docs: Update release note to reflect timelines

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agodependabot: Manage GitHub Action workflows also
Stephen Finucane [Wed, 23 Oct 2024 17:22:31 +0000 (18:22 +0100)] 
dependabot: Manage GitHub Action workflows also

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agodependabot: Ignore (most) patch update
Stephen Finucane [Wed, 23 Oct 2024 17:21:04 +0000 (18:21 +0100)] 
dependabot: Ignore (most) patch update

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agodocker-compose: Remove version
Stephen Finucane [Wed, 23 Oct 2024 17:14:49 +0000 (18:14 +0100)] 
docker-compose: Remove version

This is obsolete, apparently.

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agorequirements: Bump versions
Stephen Finucane [Wed, 23 Oct 2024 17:10:51 +0000 (18:10 +0100)] 
requirements: Bump versions

We also add a release note for the Django version bump. We should have
done both in commit 5e2f3b8c0c.

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoAdd Python 3.13 support
Stephen Finucane [Wed, 23 Oct 2024 16:47:54 +0000 (17:47 +0100)] 
Add Python 3.13 support

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agorequirements: Bump Django to 5.1.x, django-filter to 24.3.0
Stephen Finucane [Wed, 23 Oct 2024 16:47:36 +0000 (17:47 +0100)] 
requirements: Bump Django to 5.1.x, django-filter to 24.3.0

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoDrop Python 3.8 support
Stephen Finucane [Wed, 23 Oct 2024 16:37:18 +0000 (17:37 +0100)] 
Drop Python 3.8 support

We also add a release note for Python 3.12 support.

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agopre-commit: Bump versions
Stephen Finucane [Wed, 23 Oct 2024 16:38:53 +0000 (17:38 +0100)] 
pre-commit: Bump versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
19 months agoCI: docker-compose -> docker compose
Stephen Finucane [Wed, 23 Oct 2024 16:53:48 +0000 (17:53 +0100)] 
CI: docker-compose -> docker compose

Per [1].

[1] https://github.com/orgs/community/discussions/116610

Signed-off-by: Stephen Finucane <stephen@that.guru>
22 months agobuild(deps): update sqlparse requirement from ~=0.5.0 to ~=0.5.1
dependabot[bot] [Mon, 22 Jul 2024 11:50:44 +0000 (11:50 +0000)] 
build(deps): update sqlparse requirement from ~=0.5.0 to ~=0.5.1

Updates the requirements on [sqlparse](https://github.com/andialbrecht/sqlparse) to permit the latest version.
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.5.0...0.5.1)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobuild(deps-dev): update django-debug-toolbar requirement
dependabot[bot] [Mon, 15 Jul 2024 11:56:06 +0000 (11:56 +0000)] 
build(deps-dev): update django-debug-toolbar requirement

Updates the requirements on [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) to permit the latest version.
- [Release notes](https://github.com/jazzband/django-debug-toolbar/releases)
- [Changelog](https://github.com/jazzband/django-debug-toolbar/blob/main/docs/changes.rst)
- [Commits](https://github.com/jazzband/django-debug-toolbar/compare/4.4...4.4.6)

---
updated-dependencies:
- dependency-name: django-debug-toolbar
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobuild(deps): update mysqlclient requirement from ~=2.2.0 to ~=2.2.4
dependabot[bot] [Mon, 15 Jul 2024 11:56:09 +0000 (11:56 +0000)] 
build(deps): update mysqlclient requirement from ~=2.2.0 to ~=2.2.4

Updates the requirements on [mysqlclient](https://github.com/PyMySQL/mysqlclient) to permit the latest version.
- [Release notes](https://github.com/PyMySQL/mysqlclient/releases)
- [Changelog](https://github.com/PyMySQL/mysqlclient/blob/main/HISTORY.rst)
- [Commits](https://github.com/PyMySQL/mysqlclient/compare/v2.2.0...v2.2.4)

---
updated-dependencies:
- dependency-name: mysqlclient
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobuild(deps): update openapi-core requirement from ~=0.19.0 to ~=0.19.2
dependabot[bot] [Mon, 15 Jul 2024 11:56:13 +0000 (11:56 +0000)] 
build(deps): update openapi-core requirement from ~=0.19.0 to ~=0.19.2

Updates the requirements on [openapi-core](https://github.com/python-openapi/openapi-core) to permit the latest version.
- [Release notes](https://github.com/python-openapi/openapi-core/releases)
- [Commits](https://github.com/python-openapi/openapi-core/compare/0.19.0...0.19.2)

---
updated-dependencies:
- dependency-name: openapi-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
23 months agopre-commit: Everything in Python 3 now
Stephen Finucane [Fri, 12 Jul 2024 16:21:52 +0000 (17:21 +0100)] 
pre-commit: Everything in Python 3 now

No need to set the default Python version.

Signed-off-by: Stephen Finucane <stephen@that.guru>
23 months agobuild(deps): update psycopg2-binary requirement from ~=2.9.0 to ~=2.9.9
dependabot[bot] [Fri, 12 Jul 2024 16:23:39 +0000 (16:23 +0000)] 
build(deps): update psycopg2-binary requirement from ~=2.9.0 to ~=2.9.9

Updates the requirements on [psycopg2-binary](https://github.com/psycopg/psycopg2) to permit the latest version.
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/compare/2.9.6...2.9.9)

---
updated-dependencies:
- dependency-name: psycopg2-binary
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
23 months agobuild(deps): update django requirement from ~=5.0.0 to ~=5.0.7
dependabot[bot] [Fri, 12 Jul 2024 16:23:43 +0000 (16:23 +0000)] 
build(deps): update django requirement from ~=5.0.0 to ~=5.0.7

Updates the requirements on [django](https://github.com/django/django) to permit the latest version.
- [Commits](https://github.com/django/django/compare/5.0...5.0.7)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
23 months agobuild(deps): update psycopg2 requirement from ~=2.9.0 to ~=2.9.9
dependabot[bot] [Fri, 12 Jul 2024 15:24:53 +0000 (15:24 +0000)] 
build(deps): update psycopg2 requirement from ~=2.9.0 to ~=2.9.9

Updates the requirements on [psycopg2](https://github.com/psycopg/psycopg2) to permit the latest version.
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/compare/2.9.6...2.9.9)

---
updated-dependencies:
- dependency-name: psycopg2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
23 months agoRemove unused import
Stephen Finucane [Fri, 12 Jul 2024 15:20:09 +0000 (16:20 +0100)] 
Remove unused import

Signed-off-by: Stephen Finucane <stephen@that.guru>
23 months agorequirements: Bump various libraries
Stephen Finucane [Fri, 12 Jul 2024 09:38:34 +0000 (10:38 +0100)] 
requirements: Bump various libraries

djangorestframework, django-filter, django-debug-toolbar, sqlparse,
python-dateutil and openapi-core all have updates.

The only change here is, yet again, openapi-core related, as we swap out
a deprecated API with its replacement.

Signed-off-by: Stephen Finucane <stephen@that.guru>
23 months agodocker: Make .env file optional
Stephen Finucane [Fri, 12 Jul 2024 13:32:43 +0000 (14:32 +0100)] 
docker: Make .env file optional

I now have a standard UID and GID of 1000, making this file unnecessary.

Signed-off-by: Stephen Finucane <stephen@that.guru>
23 months agopre-commit: Bump versions
Stephen Finucane [Mon, 8 Apr 2024 09:52:30 +0000 (10:52 +0100)] 
pre-commit: Bump versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotrivial: Prepare for ruff bump
Stephen Finucane [Mon, 8 Apr 2024 09:52:17 +0000 (10:52 +0100)] 
trivial: Prepare for ruff bump

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotypo fix
Avinesh Kumar [Wed, 6 Mar 2024 19:38:05 +0000 (20:38 +0100)] 
typo fix

2 years agoopenapi: Add path descriptions
Stephen Finucane [Mon, 22 Jan 2024 20:28:31 +0000 (20:28 +0000)] 
openapi: Add path descriptions

These are a little more detailed than the summaries.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Set summary for paths
Stephen Finucane [Mon, 22 Jan 2024 20:03:49 +0000 (20:03 +0000)] 
openapi: Set summary for paths

This shows up in e.g. reDoc, while the description does not. We will add
more detailed descriptions later.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Fix issues with events API
Stephen Finucane [Sun, 21 Jan 2024 10:34:41 +0000 (10:34 +0000)] 
openapi: Fix issues with events API

The previous_delegate and current_delegate fields are nullable.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Add more descriptions
Stephen Finucane [Sun, 21 Jan 2024 09:55:43 +0000 (09:55 +0000)] 
openapi: Add more descriptions

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Add tag definitions
Stephen Finucane [Sat, 20 Jan 2024 15:12:39 +0000 (15:12 +0000)] 
openapi: Add tag definitions

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Add component descriptions
Stephen Finucane [Sat, 20 Jan 2024 16:56:53 +0000 (16:56 +0000)] 
openapi: Add component descriptions

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Correct security definition
Stephen Finucane [Sat, 20 Jan 2024 18:05:01 +0000 (18:05 +0000)] 
openapi: Correct security definition

It's not using bearer token format.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Consistent wrapping
Stephen Finucane [Sat, 20 Jan 2024 11:23:45 +0000 (11:23 +0000)] 
openapi: Consistent wrapping

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoopenapi: Remove trailing slashes
Stephen Finucane [Sat, 20 Jan 2024 12:23:05 +0000 (12:23 +0000)] 
openapi: Remove trailing slashes

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotox: Add tox-gh-actions config for Python 3.12
Stephen Finucane [Wed, 17 Jan 2024 15:14:42 +0000 (15:14 +0000)] 
tox: Add tox-gh-actions config for Python 3.12

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoCI: Set up go
Stephen Finucane [Wed, 17 Jan 2024 15:09:19 +0000 (15:09 +0000)] 
CI: Set up go

Needed for the vacuum pre-commit hook.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopre-commit: Switch to ruff
Stephen Finucane [Tue, 16 Jan 2024 21:53:00 +0000 (21:53 +0000)] 
pre-commit: Switch to ruff

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotrivial: Apply ruff fixes
Stephen Finucane [Tue, 16 Jan 2024 21:54:20 +0000 (21:54 +0000)] 
trivial: Apply ruff fixes

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoReplace use of datetime.datetime.utcfromtimestamp()
Stephen Finucane [Tue, 16 Jan 2024 21:02:45 +0000 (21:02 +0000)] 
Replace use of datetime.datetime.utcfromtimestamp()

This is deprecated in Python 3.12.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoReplace use of datetime.datetime.utcnow()
Stephen Finucane [Tue, 16 Jan 2024 19:14:10 +0000 (19:14 +0000)] 
Replace use of datetime.datetime.utcnow()

This is deprecated in Python 3.12.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoci: Add Python 3.12 support
Stephen Finucane [Tue, 16 Jan 2024 21:56:28 +0000 (21:56 +0000)] 
ci: Add Python 3.12 support

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump Django to 5.x.x, django-filter to 23.5.0
Stephen Finucane [Tue, 16 Jan 2024 18:50:50 +0000 (18:50 +0000)] 
requirements: Bump Django to 5.x.x, django-filter to 23.5.0

One issue to address, which is caused by changes in Django commit
500e01073ad [1].

We also drop support for Django 3.2, which goes EOL in April 2024, and
Django 4.1, which already went EOL in December 2023.

[1] https://github.com/django/django/commit/500e01073ad

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopre-commit: Add vacuum
Stephen Finucane [Tue, 16 Jan 2024 15:57:39 +0000 (15:57 +0000)] 
pre-commit: Add vacuum

Lint our OpenAPI specs.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopre-commit: Bump versions
Stephen Finucane [Tue, 16 Jan 2024 16:04:21 +0000 (16:04 +0000)] 
pre-commit: Bump versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotemplates/submission: add button to copy the message ID to clipboard
Ross Burton [Tue, 17 Oct 2023 11:41:24 +0000 (12:41 +0100)] 
templates/submission: add button to copy the message ID to clipboard

Add an icon alongside the message ID to copy the message ID to the
clipboard, to ease integration with eg b4.

Signed-off-by: Ross Burton <ross.burton@arm.com>