requirements: Bump Django to 4.2.x, django-filter to 23.2.0
There are no apparent issues to be addressed this go round. Hurrah!
We also formally drop support for Django 4.0. This doesn't really mean
anything since we still support 3.2, but it means we can keep our test
matrix as small as possible.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Stephen Finucane [Tue, 24 Jan 2023 23:31:22 +0000 (23:31 +0000)]
Correctly append tags on patches without commit details
Only a commit summary (a.k.a. patch subject) is necessary in Git: we
don't need details. The regex we were using to search for postscripts
however assumed that there would be _something_ before the postscript,
resulting in a newline. This wasn't the case. Correct this assumption by
instead using 're.MULTILINE' and matching on '^' and '$' for newlines
instead of '\n'.
Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #516 Cc: siddhesh@gotplt.org
PEP-440 regulates public and local version schemes. Git version string
will use local version scheme and alpha/stable releases will follow the
public one.
Signed-off-by: You-Sheng Yang (vicamo) <vicamo@gmail.com>
Stephen Finucane [Fri, 13 Jan 2023 12:20:01 +0000 (12:20 +0000)]
Additional updates for compatibility with tox 4
'[tox] skipsdist' behaves differently in tox 4 [1]. In addition, setting
'[testenv] basepython' with '[tox] ignore_basepython_conflict' has been
the cause of a few tox 4 bugs (most since fixed, thankfully) and might
be deprecated [2]. Remove it since we don't need it in any of our
environments.
Stephen Finucane [Mon, 10 Oct 2022 17:18:41 +0000 (18:18 +0100)]
Convert to OpenAPI 3.1
OpenAPI 3.0 has some unspecified behavior regarding the combination of
reference objects with 'nullable' [1]. Despite what random StackOverflow
answers [2] suggest, combining nullable with '$ref' still doesn't work.
Do what's suggested in the issue reporting this behavior [3] and upgrade
to OpenAPI 3.1, allowing us to work around this.
Stephen Finucane [Wed, 11 May 2022 13:52:36 +0000 (14:52 +0100)]
urls: Encode slashes in message IDs
We were attempting to work around the fact that message IDs could
contain slashes which in some cases broke our ability to generate
meaningful URLs. Rather than doing this, insist that users encode these
slashes so that we can distinguish between semantically meaningful
slashes and those that form the URL. This is a slightly breaking change,
but the current behavior is already broken (see the linked bug) so this
seems reasonable.
Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #433 Cc: dja@axtens.net Cc: siddhesh@gotplt.org
Stephen Finucane [Fri, 30 Sep 2022 12:17:46 +0000 (13:17 +0100)]
requirements: Bump Django to 3.2.x, djangorestframework to 4.16.0
There are two issues to be addressed:
RemovedInDjango50Warning: Passing response to assertFormError() is
deprecated. Use the form object directly:
RemovedInDjango50Warning: The "default.html" templates for forms and
formsets will be removed. These were proxies to the equivalent
"table.html" templates, but the new "div.html" templates will be the
default from Django 5.0. Transitional renderers are provided to allow
you to opt-in to the new output style now. See
https://docs.djangoproject.com/en/4.1/releases/4.1/ for more details
Nothing complicated in fixing either of these. For the former, we must
do as we're told and use the form object directly. For the latter, we
need to configure our own form renderer so we can continue using the
table form renderer for now.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Stephen Finucane [Fri, 15 Jul 2022 16:02:36 +0000 (17:02 +0100)]
docs: Bump API version in docs to 1.3
We also need to add missing API documentation pages for this new API
version. These should have been added in commit 5b03443c ("api: add
auto-generated OpenAPI schema files")
Signed-off-by: Stephen Finucane <stephen@that.guru>
Stephen Finucane [Wed, 11 May 2022 09:30:45 +0000 (10:30 +0100)]
parser: Handle binary git patches
'git-format-patch' is able to generate binary patches. Fortunately,
these are quite easy to spot since they're explicitly labelled as such.
Add support for parsing these to the parser.
Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #463
Ali Alnubani [Sun, 24 Apr 2022 20:59:35 +0000 (23:59 +0300)]
lib: fix table names
Migration 0042 (introduced in 0686a73) renamed the "Comment" model
to "PatchComment", and some of the table names changed in a51e7cf
were already correct.
This reverts a51e7cf and removes a nonexistent table name to resolve
the following error:
$ psql -f lib/sql/grant-all.postgres.sql DATABASE_NAME
BEGIN
psql:lib/sql/grant-all.postgres.sql:38: ERROR: relation
"patchwork_comment" does not exist
Fixes: a51e7cfd95e2 ("lib: Correct PatchComment table") Fixes: 7b967db4e12f ("lib: Update DB permissions to reflect model changes") Cc: stephen@that.guru Closes: #396 Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Amazingly, the only functional change required here is to add an
additional piece of code to re-enable shift-select [1]. This is
otherwise a straight swap.
We recently started stripping comments and folding white space from the
In-Reply-To and References headers. Do so also for the Message-ID
header. Because of the importance of the Message-ID header, we accept
even non-compliant headers and because we now have a pattern for this,
we also start (re-)accepting non-compliant In-Reply-To headers.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Related: #399
parser: Ignore CFWS in In-Reply-To, References headers
RFC2822 states that [1] a comment or folding white space is permitted to
be inserted before or after a msg-id in in the Message-ID, In-Reply-To
or References fields. Allow for this.
Stephen Finucane [Tue, 14 Apr 2020 09:46:05 +0000 (10:46 +0100)]
REST: Include 'first', 'last' refs in 'Link' header
I've no idea why this wasn't done from day one, but it's a huge
usability win for anyone attempting to do pagination with this header.
Note that this change is not versioned as I haven't figured out how to
do that at this layer.
Signed-off-by: Stephen Finucane <stephen@that.guru>
This patch stitches in "comment created" events for patches and cover
letter into the event queue.
Signed-off-by: DJ Delorie <dj@redhat.com> Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #424
[stephenfin: Extend to cover letters also. Fix some formatting issues.
Add a release note]
Stephen Finucane [Fri, 25 Mar 2022 11:57:33 +0000 (11:57 +0000)]
docker: Further refine logic to apply migrations
We don't want to apply migrations by default since this will cause WIP
migrations to be applied if someone runs e.g. 'docker-compose run'. What
we really want to check is "are there any migrations currently applied?"
and skip if so, but Django doesn't provide an easy way to do this, so we
instead check for a random Django application.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Stephen Finucane [Fri, 25 Mar 2022 09:30:08 +0000 (09:30 +0000)]
docker: Bump tested database versions
We were attempting to test with PostgreSQL 9.6, but Django 4.0 requires
PostgreSQL 10.0 or greater [1]. This was causing failures like those
seens at [2]. Configure jobs to use 'latest' like we do in CI to avoid
this issue.
While we're here, we also switch from MariaDB to MySQL and use the
'latest' tag of this. Once again, this was what we were actually using
in CI and doing this limits future work.
You-Sheng Yang [Thu, 9 Dec 2021 03:38:41 +0000 (11:38 +0800)]
docker: Drop database maintenance stuff
Trying to re-create database inside a client docker could be risky and
error prone.
1. The previous handling process may fail service startup when an empty
database was created. `test_database()` will always succeed as it tests
only the existence of the database, not any table inside. Without
migrations being called on such empty database, patchwork cannot work
normally.
2. Checking the existence of a patchwork specific table is also invalid
under the empty database scenario, because migrations might still remain
to be done.
As a result, we shall test if the database exist and do migrations
always, so this change removes database maintenance functions.
Signed-off-by: You-Sheng Yang <vicamo@gmail.com> Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin] Removed release note, since this is not end-user focused
You-Sheng Yang [Thu, 9 Dec 2021 03:38:39 +0000 (11:38 +0800)]
docker: Remove deprecated startup arguments
This also adds a default CMD directive so that it will launch a
patchwork instance when started with no argument.
Signed-off-by: You-Sheng Yang <vicamo@gmail.com> Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin] Removed release note, since this is not end-user focused
You-Sheng Yang [Sun, 12 Dec 2021 06:17:40 +0000 (14:17 +0800)]
docker: Rebase onto custom image
Rebuild pyenv environments can be time-consuming and irrelevant to this
project. Use a prebuild image to save some time here.
Signed-off-by: You-Sheng Yang <vicamo@gmail.com> Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Modified to use our own vendored image]