]> git.ipfire.org Git - thirdparty/patchwork.git/log
thirdparty/patchwork.git
5 weeks agoparsemail: wrap parse_mail() in a single transaction stable/3.2
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]
(cherry picked from commit 644cef7cd369abd39eba9523f8ecbc16d2ea4206)

5 weeks 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>
(cherry picked from commit 3558907533a1a420ccceec6935635e7c2245eb69)

5 weeks 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>
(cherry picked from commit f51e30684ee10f093cc42df9783f68c009e75cba)

5 weeks 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>
(cherry picked from commit 338a976125fa492eb113d871df621bfd71068201)

5 weeks 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
(cherry picked from commit 980b27097a11c330b78b730d2877c2ea34c6a9e6)

5 weeks 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]
(cherry picked from commit 1139b9ae0e09e589073c506d4209dea865621eb1)

5 weeks 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>
(cherry picked from commit 52877f86048b0a9a8f99320ffbe871eae07f95eb)

5 weeks 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.

NOTE(stephenfin): Modified to use the correct lower and upper bound for
this branch.

Signed-off-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit cd6a64e63c24c713488727fd4ea555c6070c1f1a)

5 weeks 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>
(cherry picked from commit 4c7d6d83bd295ba74c23316bfc2271092d946479)

5 weeks ago[Stable-Only] docker: Pin postgres, mysql image versions
Stephen Finucane [Sun, 7 Jun 2026 16:01:19 +0000 (17:01 +0100)] 
[Stable-Only] docker: Pin postgres, mysql image versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
5 weeks ago[Stable-Only] Bump GitHub Actions versions
Stephen Finucane [Sat, 6 Jun 2026 10:25:43 +0000 (11:25 +0100)] 
[Stable-Only] Bump GitHub Actions versions

The versions we were using here are out of date and no longer supported.
Bump them all.

Signed-off-by: Stephen Finucane <stephen@that.guru>
20 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>
(cherry picked from commit 45f47e96c6c90aefac37b02e0e15052f6ba41a90)

20 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>
(cherry picked from commit c443cd9c0e96ca21842a188f9101b1a8244535ee)

20 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>
(cherry picked from commit fa14cf8480d9e515ed7a769adbd9eab33c6d82d9)

20 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>
(cherry picked from commit 09939ba107bde85e0b9df35c0dbbf90428789a94)

20 months agoFix version.txt
Stephen Finucane [Thu, 31 Oct 2024 22:58:34 +0000 (22:58 +0000)] 
Fix version.txt

Fixes: b2374a06 ("Post-release version bump")
Signed-off-by: Stephen Finucane <stephen@that.guru>
20 months agoPost-release version bump
Stephen Finucane [Thu, 31 Oct 2024 22:15:18 +0000 (22:15 +0000)] 
Post-release version bump

Signed-off-by: Stephen Finucane <stephen@that.guru>
20 months agoRelease 3.2.1 v3.2.1
Stephen Finucane [Thu, 31 Oct 2024 22:14:38 +0000 (22:14 +0000)] 
Release 3.2.1

Signed-off-by: Stephen Finucane <stephen@that.guru>
20 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>
(cherry picked from commit 13bbc0d94ea035c149f8acd042d2998778b9efd9)

20 months agodocker: Update tag
Stephen Finucane [Thu, 31 Oct 2024 22:03:28 +0000 (22:03 +0000)] 
docker: Update tag

This will need to be part of our release procedure going forward.

Signed-off-by: Stephen Finucane <stephen@that.guru>
20 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>
20 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>
20 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>
20 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>
20 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>
20 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>
20 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>
20 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>
20 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>
20 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>
20 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>
23 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agotemplates/base: generalise clipbboardjs initialisation
Ross Burton [Wed, 3 Jan 2024 17:44:54 +0000 (17:44 +0000)] 
templates/base: generalise clipbboardjs initialisation

Don't limit the clipboardjs hooking to button.btn-copy, as we may want
to use it on icons which are not buttons.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2 years agotemplates/submission: remove duplication when writing the Message ID
Ross Burton [Wed, 3 Jan 2024 17:47:47 +0000 (17:47 +0000)] 
templates/submission: remove duplication when writing the Message ID

The output is identical, but this removes the duplication of the Message
ID itself in the source.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2 years agoUpgrade to Bootstrap 3.4.1
Ross Burton [Wed, 10 Jan 2024 17:23:54 +0000 (17:23 +0000)] 
Upgrade to Bootstrap 3.4.1

2 years agoUpgrade Bootstrap to 3.3.7
Ross Burton [Wed, 10 Jan 2024 17:16:00 +0000 (17:16 +0000)] 
Upgrade Bootstrap to 3.3.7

2 years agoFix docker apt install requirements
Miguel Saura [Thu, 4 Jan 2024 13:06:47 +0000 (14:06 +0100)] 
Fix docker apt install requirements

Add pkg-config dependency install for docker images. this is required
later on for mysql inside the container.

2 years agodocs: Replace hyperlink with doc role
Stephen Finucane [Wed, 4 Oct 2023 09:15:17 +0000 (10:15 +0100)] 
docs: Replace hyperlink with doc role

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoreadthedocs: Switch back to DirHTML builder
Stephen Finucane [Wed, 4 Oct 2023 09:09:32 +0000 (10:09 +0100)] 
readthedocs: Switch back to DirHTML builder

Looks like this got lost in the switch to the '.readthedocs.yaml'
configuration file.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoreadthedocs: Fetch all branches
Stephen Finucane [Wed, 4 Oct 2023 08:54:12 +0000 (09:54 +0100)] 
readthedocs: Fetch all branches

Third time lucky. As this is configured, we were only fetching the main
branch. Correct this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoreadthedocs: Also fetch all other branches
Stephen Finucane [Wed, 4 Oct 2023 08:42:10 +0000 (09:42 +0100)] 
readthedocs: Also fetch all other branches

'stable/2.0' is a branch, not a tag.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoreadthedocs: Also fetch tags
Stephen Finucane [Wed, 4 Oct 2023 08:39:01 +0000 (09:39 +0100)] 
readthedocs: Also fetch tags

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agodocs: Add note about 'series' querystring arg to api-ref
Stephen Finucane [Mon, 4 Sep 2023 12:25:31 +0000 (13:25 +0100)] 
docs: Add note about 'series' querystring arg to api-ref

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agodocs: Switch back to RTD theme
Stephen Finucane [Mon, 4 Sep 2023 12:15:18 +0000 (13:15 +0100)] 
docs: Switch back to RTD theme

The furo theme needs more work than originally expected, and
sphinx-rtd-theme now supports Sphinx 7.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotools: Add helper script to backup, restore DB
Stephen Finucane [Thu, 24 Aug 2023 12:56:49 +0000 (13:56 +0100)] 
tools: Add helper script to backup, restore DB

This is handier than doing it via Django and works for my simple,
local-only workflow.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopre-commit: Updates
Stephen Finucane [Thu, 24 Aug 2023 11:17:59 +0000 (12:17 +0100)] 
pre-commit: Updates

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotests: Remove use of deprecated method
Stephen Finucane [Wed, 2 Aug 2023 11:35:01 +0000 (12:35 +0100)] 
tests: Remove use of deprecated method

Resolve the following warning:

  RemovedInDjango51Warning: BaseUserManager.make_random_password() is
  deprecated.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotests: Add coloured runner
Stephen Finucane [Wed, 2 Aug 2023 11:23:45 +0000 (12:23 +0100)] 
tests: Add coloured runner

This is nicer to work with than a wall of red text.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoRemove filter for openapi-core
Stephen Finucane [Wed, 2 Aug 2023 10:19:36 +0000 (11:19 +0100)] 
Remove filter for openapi-core

Effectively revert commit 4ddcdea4: the PR referenced merged a long time
ago.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump openapi-core
Stephen Finucane [Tue, 1 Aug 2023 17:49:16 +0000 (18:49 +0100)] 
requirements: Bump openapi-core

Another slog. The joys of pre-v1.0.0 libraries!

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump mysqlclient to 2.1.x
Stephen Finucane [Tue, 1 Aug 2023 17:48:12 +0000 (18:48 +0100)] 
requirements: Bump mysqlclient to 2.1.x

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Unpin tblib
Stephen Finucane [Tue, 1 Aug 2023 17:47:45 +0000 (18:47 +0100)] 
requirements: Unpin tblib

Shouldn't have merged the pyup bot proposed change.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoPin tblib to latest version 2.0.0
pyup-bot [Thu, 22 Jun 2023 08:55:25 +0000 (09:55 +0100)] 
Pin tblib to latest version 2.0.0

2 years agorequirements: Bump django-debug-toolbar to 4.1.x
Stephen Finucane [Tue, 1 Aug 2023 17:43:01 +0000 (18:43 +0100)] 
requirements: Bump django-debug-toolbar to 4.1.x

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopyup: Don't pin unpinned dependencies
Stephen Finucane [Tue, 1 Aug 2023 17:38:20 +0000 (18:38 +0100)] 
pyup: Don't pin unpinned dependencies

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoConfigure dependabot
Stephen Finucane [Tue, 1 Aug 2023 17:34:36 +0000 (18:34 +0100)] 
Configure dependabot

2 years agolib: add missing permissions for patchwork_covercomment_id_seq
Ali Alnubani [Tue, 1 Aug 2023 08:15:35 +0000 (11:15 +0300)] 
lib: add missing permissions for patchwork_covercomment_id_seq

Grants UPDATE and SELECT privileges on patchwork_covercomment_id_seq table
for user 'nobody' to fix the following exception when cover comments
are being parsed:
django.db.utils.ProgrammingError: permission denied for sequence
  patchwork_covercomment_id_seq

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
2 years agolib: add missing permissions for patchwork_cover_id_seq
Ali Alnubani [Mon, 31 Jul 2023 10:54:21 +0000 (13:54 +0300)] 
lib: add missing permissions for patchwork_cover_id_seq

Grants UPDATE and SELECT privileges on patchwork_cover_id_seq table
for user 'nobody' to fix the following exception when cover letters
are being parsed:
django.db.utils.ProgrammingError: permission denied for sequence
  patchwork_cover_id_seq

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
2 years agourls: Also decode slashes in message IDs
Stephen Finucane [Tue, 1 Aug 2023 17:05:03 +0000 (18:05 +0100)] 
urls: Also decode slashes in message IDs

In commit 2653fdbb2, we started encoding slashes in message IDs
presented to users. This allowed us to support message IDs containing
slashes, which are allowed per the RFC and have been seen in the wild.
However, we continue to store the original unencoded message IDs in the
database and unfortunately we neglected to reverse the decoding in the
functions for downloading patch diffs and mboxes. Address this now.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 2653fdbb2 ("urls: Encode slashes in message IDs")
Closes: #518
Cc: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: DJ Delorie <dj@delorie.com>
2 years agoDrop Python 3.7 support
Stephen Finucane [Tue, 1 Aug 2023 16:44:40 +0000 (17:44 +0100)] 
Drop Python 3.7 support

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotox: Remove redundant environments
Stephen Finucane [Tue, 1 Aug 2023 16:33:39 +0000 (17:33 +0100)] 
tox: Remove redundant environments

These were not being used.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotox: Use pre-commit for pep8 environment
Stephen Finucane [Tue, 1 Aug 2023 16:35:35 +0000 (17:35 +0100)] 
tox: Use pre-commit for pep8 environment

Avoid duplication.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopre-commit: Reorder
Stephen Finucane [Tue, 1 Aug 2023 16:34:16 +0000 (17:34 +0100)] 
pre-commit: Reorder

Place faster checks first.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agopre-commit: Add bashate
Stephen Finucane [Tue, 1 Aug 2023 16:32:02 +0000 (17:32 +0100)] 
pre-commit: Add bashate

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoRewrap some bash
Stephen Finucane [Tue, 1 Aug 2023 16:32:27 +0000 (17:32 +0100)] 
Rewrap some bash

Keep bashate happy.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoBump pre-commit versions
Stephen Finucane [Tue, 1 Aug 2023 16:27:25 +0000 (17:27 +0100)] 
Bump pre-commit versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotests: Address flake8 issue
Stephen Finucane [Tue, 1 Aug 2023 16:26:17 +0000 (17:26 +0100)] 
tests: Address flake8 issue

Signed-off-by: Stephen Finucane <stephen@that.guru>