]> git.ipfire.org Git - thirdparty/patchwork.git/log
thirdparty/patchwork.git
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>
2 years agodocs: Switch to furo theme
Stephen Finucane [Wed, 28 Jun 2023 09:22:27 +0000 (10:22 +0100)] 
docs: Switch to furo theme

The sphinx-rtd-theme theme is not compatible with Sphinx 7.x yet.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoreadthedocs: Specify requirements
Stephen Finucane [Tue, 27 Jun 2023 18:13:13 +0000 (19:13 +0100)] 
readthedocs: Specify requirements

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoreadthedocs: Specify OS, tools
Stephen Finucane [Tue, 27 Jun 2023 18:00:52 +0000 (19:00 +0100)] 
readthedocs: Specify OS, tools

This is required. The error message is misleading [1].

[1] https://github.com/readthedocs/readthedocs.org/issues/8912

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoAdd readthedocs config file
Stephen Finucane [Tue, 27 Jun 2023 17:50:16 +0000 (18:50 +0100)] 
Add readthedocs config file

We need this to maintain our docs build, which won't work with shallow
clones.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agolib: add missing permissions for patchwork_comment_id_seq
Ali Alnubani [Tue, 20 Jun 2023 11:06:07 +0000 (14:06 +0300)] 
lib: add missing permissions for patchwork_comment_id_seq

Grants UPDATE and SELECT privileges on patchwork_comment_id_seq table
for web and mail users to fix the following exception when comments
are parsed:
django.db.utils.ProgrammingError: permission denied for sequence
  patchwork_comment_id_seq

Fixes: 5b53f46def5f ("lib: fix table names")
Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
2 years agotests: Always enable REST API
Stephen Finucane [Mon, 15 May 2023 12:00:27 +0000 (13:00 +0100)] 
tests: Always enable REST API

This means django-rest-framework is now a hard requirement for unit
tests. That seems reasonable.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotests: Always enable XML-RPC API
Stephen Finucane [Mon, 15 May 2023 11:51:40 +0000 (12:51 +0100)] 
tests: Always enable XML-RPC API

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotemplates: Use REST API backend for pwclientrc
Stephen Finucane [Mon, 15 May 2023 10:54:56 +0000 (11:54 +0100)] 
templates: Use REST API backend for pwclientrc

If the REST API is enabled, we should generate a pwclientrc file that
uses it by default.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotrivial: Move test file
Stephen Finucane [Mon, 15 May 2023 11:30:55 +0000 (12:30 +0100)] 
trivial: Move test file

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump django-debug-toolbar to 4.0.x
Stephen Finucane [Mon, 8 May 2023 11:40:48 +0000 (12:40 +0100)] 
requirements: Bump django-debug-toolbar to 4.0.x

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoValidate email address in from_header
Nisha Poyarekar [Wed, 26 Apr 2023 18:23:24 +0000 (14:23 -0400)] 
Validate email address in from_header

Resolves #512

Signed-off-by: Nisha Poyarekar <nisha.s.menon@gmail.com>
2 years agorequirements: Bump Django to 4.2.x, django-filter to 23.2.0
Stephen Finucane [Mon, 8 May 2023 10:58:06 +0000 (11:58 +0100)] 
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>
2 years agoCI: Remove codecov package
Stephen Finucane [Thu, 27 Apr 2023 09:43:41 +0000 (10:43 +0100)] 
CI: Remove codecov package

This is no longer supported [1].

[1] https://about.codecov.io/blog/message-regarding-the-pypi-package/

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoxmlrpc: Doc improvement
Stephen Finucane [Thu, 27 Apr 2023 09:38:30 +0000 (10:38 +0100)] 
xmlrpc: Doc improvement

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoci: add Python 3.11 support
You-Sheng Yang (vicamo) [Mon, 16 Jan 2023 07:26:18 +0000 (15:26 +0800)] 
ci: add Python 3.11 support

Signed-off-by: You-Sheng Yang (vicamo) <vicamo@gmail.com>
2 years agoblack: address check failures against 23.1.0
You-Sheng Yang [Thu, 6 Apr 2023 16:10:41 +0000 (00:10 +0800)] 
black: address check failures against 23.1.0

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
2 years agoRemove tox-pyenv
Stephen Finucane [Wed, 25 Jan 2023 19:56:16 +0000 (19:56 +0000)] 
Remove tox-pyenv

This doesn't appear to be maintained and isn't necessary once we add a
missing 'pyenv init'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agodocs: Correct location of release note
Stephen Finucane [Wed, 25 Jan 2023 18:14:28 +0000 (18:14 +0000)] 
docs: Correct location of release note

Another one that ended up in the wrong place.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 2653fdbb ("urls: Encode slashes in message IDs")
2 years agoCorrectly append tags on patches without commit details
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
2 years agorequirements: Bump django-debug-toolbar to 3.8.x
Stephen Finucane [Tue, 24 Jan 2023 23:06:17 +0000 (23:06 +0000)] 
requirements: Bump django-debug-toolbar to 3.8.x

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoUncap openapi-core
Stephen Finucane [Tue, 24 Jan 2023 22:39:45 +0000 (22:39 +0000)] 
Uncap openapi-core

These issues have been fixed now.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoversion: format version following PEP-440
You-Sheng Yang (vicamo) [Tue, 1 Nov 2022 14:38:53 +0000 (22:38 +0800)] 
version: format version following PEP-440

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>
2 years agorequirements: Use sphinxcontrib-openapi 0.8.1
Stephen Finucane [Tue, 24 Jan 2023 22:22:53 +0000 (22:22 +0000)] 
requirements: Use sphinxcontrib-openapi 0.8.1

This contains an important fix for arrays of types.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoSimplify nullable field
Stephen Finucane [Fri, 13 Jan 2023 14:55:57 +0000 (14:55 +0000)] 
Simplify nullable field

openapi-validator requires we specify 'type' twice when using 'oneOf'.
Do this, removing some 'oneOf' declarations in the process.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Use sphinxcontrib-openapi 0.8.0
Stephen Finucane [Fri, 13 Jan 2023 13:37:03 +0000 (13:37 +0000)] 
requirements: Use sphinxcontrib-openapi 0.8.0

Turns out I could release after all.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoInstall sphinxcontrib-openapi from source
Stephen Finucane [Fri, 13 Jan 2023 12:42:25 +0000 (12:42 +0000)] 
Install sphinxcontrib-openapi from source

I'm hoping to get permission to publish new releases to this [1]. Until
that happens, we must install from source.

[1] https://github.com/pypi/support/issues/2463

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoAdd temporary cap to openapi-core
Stephen Finucane [Fri, 13 Jan 2023 12:33:29 +0000 (12:33 +0000)] 
Add temporary cap to openapi-core

This has broken us again :(

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoAdditional updates for compatibility with tox 4
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.

[1] https://github.com/tox-dev/tox/issues/2730
[2] https://github.com/tox-dev/tox/issues/2846

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotox: fix failure due to whitespaces in passenv
You-Sheng Yang (vicamo) [Fri, 13 Jan 2023 02:53:58 +0000 (10:53 +0800)] 
tox: fix failure due to whitespaces in passenv

When installed tox >= 4, space-separated variables specified for passenv
are no longer allowed.

Signed-off-by: You-Sheng Yang (vicamo) <vicamo@gmail.com>
2 years agorequirements: Bump openapi-core
Stephen Finucane [Tue, 11 Oct 2022 10:10:16 +0000 (11:10 +0100)] 
requirements: Bump openapi-core

openapi-core 0.16.2 includes support for null values [1]. We need this
to fix our CI.

[1] https://github.com/p1c2u/openapi-core/pull/432

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoConvert to OpenAPI 3.1
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.

[1] https://github.com/OAI/OpenAPI-Specification/issues/1368
[2] https://stackoverflow.com/a/48114924/613428
[3] https://github.com/OAI/OpenAPI-Specification/issues/1368#issuecomment-930112844

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoAdd support for openapi-core 0.16.x
Stephen Finucane [Mon, 10 Oct 2022 18:18:23 +0000 (19:18 +0100)] 
Add support for openapi-core 0.16.x

Take two! This time with the necessary fixes to make things actually
work.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoRevert "requirements: Bump openapi-core"
Stephen Finucane [Mon, 10 Oct 2022 18:17:40 +0000 (19:17 +0100)] 
Revert "requirements: Bump openapi-core"

This reverts commit ff990da728a6b4b172981d19953dfc1ece6954d9. It seems
this was premature. I didn't rebuild my tox virtualenv before pushing :(

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump djangorestframework version
Stephen Finucane [Mon, 10 Oct 2022 15:16:48 +0000 (16:16 +0100)] 
requirements: Bump djangorestframework version

This should have been done when we added support in commit 84ec76dd.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump Django version
Stephen Finucane [Mon, 10 Oct 2022 15:15:02 +0000 (16:15 +0100)] 
requirements: Bump Django version

This should have been done when we added support in commit 84ec76dd.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump openapi-core
Stephen Finucane [Mon, 10 Oct 2022 15:00:55 +0000 (16:00 +0100)] 
requirements: Bump openapi-core

This supports OpenAPI 3.1 finally [1] ðŸŽ‰. We can uncap jsonschema in the
process.

[1] https://github.com/p1c2u/openapi-core/pull/419

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agodocs: Update docs to point to v3.1.0 release
Stephen Finucane [Mon, 10 Oct 2022 14:38:04 +0000 (15:38 +0100)] 
docs: Update docs to point to v3.1.0 release

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoviews: Redirect to login on password reset
Stephen Finucane [Tue, 19 Jul 2022 14:06:36 +0000 (15:06 +0100)] 
views: Redirect to login on password reset

There's no need for a separate reset confirmation page.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoforms: Trivial cleanup
Stephen Finucane [Tue, 19 Jul 2022 15:05:32 +0000 (16:05 +0100)] 
forms: Trivial cleanup

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotrivial: Remove unnecessary whitespace
Stephen Finucane [Tue, 19 Jul 2022 15:07:38 +0000 (16:07 +0100)] 
trivial: Remove unnecessary whitespace

This was added when we ran black over the codebase.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agourls: Encode slashes in message IDs
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
2 years agoREST: Add missing 'url' parameter for comments
Stephen Finucane [Fri, 30 Sep 2022 14:01:14 +0000 (15:01 +0100)] 
REST: Add missing 'url' parameter for comments

This should be present on all resources.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 88f56051 ("api: add comments detail endpoint")
2 years agomodels: Cache 'list_archive_url' property
Stephen Finucane [Fri, 30 Sep 2022 15:10:27 +0000 (16:10 +0100)] 
models: Cache 'list_archive_url' property

We really need to get rid of this from the embedded view. It's way too
slow. For now, we just cache it and leave a note for future us.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoREST: De-duplicate handling of nested resource URLs
Stephen Finucane [Fri, 30 Sep 2022 13:57:25 +0000 (14:57 +0100)] 
REST: De-duplicate handling of nested resource URLs

These were all doing the same thing. Make things more generic.

We also speed up test (inadvertently) by using the 'patch_id' attribute
of the 'Check' model rather than 'patch.id', thus avoiding the JOIN.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agoREST: Fix issues with comment-related events
Stephen Finucane [Fri, 30 Sep 2022 13:21:09 +0000 (14:21 +0100)] 
REST: Fix issues with comment-related events

When we introduced this functionality, we missed the fact that these
resources use nested-style URLs that need to be specially handled. Fix
this now.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: e3d8f7548 ("REST: Add 'patch-comment-created', 'cover-comment-created' events")
Cc: Siddhesh Poyarekar <sipoyare@redhat.com>
Cc: DJ Delorie <dj@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
2 years agomanage: Check Django version on startup
Stephen Finucane [Fri, 30 Sep 2022 13:04:19 +0000 (14:04 +0100)] 
manage: Check Django version on startup

This was recently reported as an issue. Add a simple check to ensure
people update their dependencies as expected.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Cc: Siddhesh Poyarekar <sipoyare@redhat.com>
Cc: DJ Delorie <dj@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
2 years agorequirements: Bump Django to 3.2.x, djangorestframework to 4.16.0
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>
2 years agotox: Output test times, more verbose output
Stephen Finucane [Fri, 30 Sep 2022 16:07:48 +0000 (17:07 +0100)] 
tox: Output test times, more verbose output

Just a bit more useful for CI logs

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotrivial: Remove unnecessary unicode prefixes
Stephen Finucane [Fri, 30 Sep 2022 12:50:40 +0000 (13:50 +0100)] 
trivial: Remove unnecessary unicode prefixes

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agotests: Change from expectedFailure to skip
Stephen Finucane [Fri, 30 Sep 2022 15:42:52 +0000 (16:42 +0100)] 
tests: Change from expectedFailure to skip

Python 3.10 recognises unexpected passes as failures now.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2 years agorequirements: Bump django-debug-toolbar to 3.7.x
Stephen Finucane [Fri, 30 Sep 2022 12:14:04 +0000 (13:14 +0100)] 
requirements: Bump django-debug-toolbar to 3.7.x

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocs: Add info on contributing docs
Stephen Finucane [Fri, 9 Sep 2022 14:28:45 +0000 (15:28 +0100)] 
docs: Add info on contributing docs

Noticed while whipping up a patch to document the new VSCode extension.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocs: Add references to VSCode Patchwork plugin
Stephen Finucane [Fri, 9 Sep 2022 14:17:34 +0000 (15:17 +0100)] 
docs: Add references to VSCode Patchwork plugin

Signed-off-by: Stephen Finucane <stephen@that.guru>
Cc: Florent Revest <revest@chromium.org>
3 years agotrivial: Fix style issues
Stephen Finucane [Thu, 8 Sep 2022 20:43:59 +0000 (21:43 +0100)] 
trivial: Fix style issues

New flake8, same issues.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocs: Update sample tox environment
Stephen Finucane [Tue, 19 Jul 2022 15:30:02 +0000 (16:30 +0100)] 
docs: Update sample tox environment

There's no py27-django18 environment anymore.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoUse a static file for versioning
Stephen Finucane [Wed, 5 Jun 2019 22:33:05 +0000 (23:33 +0100)] 
Use a static file for versioning

This means you don't have to install all dependencies simply to read the
version.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocs: Actually configure reno to use the main branch
Stephen Finucane [Mon, 18 Jul 2022 11:28:24 +0000 (12:28 +0100)] 
docs: Actually configure reno to use the main branch

I used the wrong setting [1]

[1] https://docs.openstack.org/reno/latest/user/usage.html#configuring-reno

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoReplace references to master with main
Stephen Finucane [Mon, 18 Jul 2022 09:34:59 +0000 (10:34 +0100)] 
Replace references to master with main

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocs: Update reno for stable/3.1
Stephen Finucane [Fri, 15 Jul 2022 16:19:33 +0000 (17:19 +0100)] 
docs: Update reno for stable/3.1

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoPost-release version bump
Stephen Finucane [Fri, 15 Jul 2022 16:20:08 +0000 (17:20 +0100)] 
Post-release version bump

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoRelease 3.1.0 v3.1.0
Stephen Finucane [Fri, 15 Jul 2022 16:14:57 +0000 (17:14 +0100)] 
Release 3.1.0

A smaller release including a new API version (v1.3) and changes to the
supported Python and Django versions.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocs: Bump API version in docs to 1.3
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>
3 years agotox: Run Python 3.10 tests in Python 3.10 environment
Stephen Finucane [Fri, 15 Jul 2022 15:53:56 +0000 (16:53 +0100)] 
tox: Run Python 3.10 tests in Python 3.10 environment

Correct a typo introduced when we added 3.10 support.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: dda111234 ("Add Python 3.10 support, drop Python 3.6 support")
3 years agoBump django-filter, django-debug-toolbar versions
Stephen Finucane [Fri, 15 Jul 2022 15:47:33 +0000 (16:47 +0100)] 
Bump django-filter, django-debug-toolbar versions

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoCI: Drop Python 3.6 testing, add Python 3.10, update actions
Stephen Finucane [Fri, 15 Jul 2022 15:38:01 +0000 (16:38 +0100)] 
CI: Drop Python 3.6 testing, add Python 3.10, update actions

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoparser: Handle binary git patches
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
3 years agolib: fix table names
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>
3 years agohtdocs: Update package versions
Stephen Finucane [Sun, 9 Sep 2018 01:37:46 +0000 (19:37 -0600)] 
htdocs: Update package versions

  checkboxes.js            1.0.6   1.2.2
  clipboard.js             1.7.1   1.7.1
  jquery                  1.10.1   3.6.0
  selectize               0.11.2  0.13.5
  sticky-table-headers     ?.?.?  0.1.24
  tablednd                 0.4.0   1.0.5

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.

[1] https://rmariuzzo.github.io/checkboxes.js/#range-selection-of-checkboxes

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agotox: Trivial indentation fix
Stephen Finucane [Mon, 9 May 2022 10:45:09 +0000 (11:45 +0100)] 
tox: Trivial indentation fix

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoSilence warnings from openapi-core
Stephen Finucane [Mon, 9 May 2022 10:27:11 +0000 (11:27 +0100)] 
Silence warnings from openapi-core

This uses distutils. Hopefully my PR will be merged eventually. Until
then, silencing the warning is good enough (Python 3.12 is aaaages away)

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoRemove 'default_app_config'
Stephen Finucane [Mon, 9 May 2022 10:26:23 +0000 (11:26 +0100)] 
Remove 'default_app_config'

This is no longer necessary since we don't support Django < 3.2, which
is where the automatic configuration behavior was added [1].

[1] https://docs.djangoproject.com/en/4.0/releases/3.2/#automatic-appconfig-discovery

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoparser: Ignore CFWS in Message-ID header
Stephen Finucane [Fri, 6 May 2022 17:21:02 +0000 (18:21 +0100)] 
parser: Ignore CFWS in Message-ID header

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

3 years agoparser: Ignore CFWS in In-Reply-To, References headers
Stephen Finucane [Fri, 6 May 2022 16:53:13 +0000 (17:53 +0100)] 
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.

[1] https://tools.ietf.org/html/rfc2822#section-3.6.4

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: DJ Delorie <dj@redhat.com>
Closes: #399
3 years agopre-commit: Ignore files we don't have access to
Stephen Finucane [Fri, 6 May 2022 19:06:30 +0000 (20:06 +0100)] 
pre-commit: Ignore files we don't have access to

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoEnable black in pep8 tox job, pre-commit
Stephen Finucane [Fri, 6 May 2022 19:01:43 +0000 (20:01 +0100)] 
Enable black in pep8 tox job, pre-commit

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoUpdate pre-commit plugins
Stephen Finucane [Fri, 6 May 2022 19:00:19 +0000 (20:00 +0100)] 
Update pre-commit plugins

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoCreate git-blame-ignore-revs file
Stephen Finucane [Fri, 6 May 2022 18:58:30 +0000 (19:58 +0100)] 
Create git-blame-ignore-revs file

Allows us to ignore the application of black to the codebase.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoBlackify code
Stephen Finucane [Fri, 6 May 2022 18:57:37 +0000 (19:57 +0100)] 
Blackify code

Run code through black.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoREST: Include 'first', 'last' refs in 'Link' header
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>
3 years agotemplatetags: Add 'site_admins' tag
Stephen Finucane [Fri, 10 Apr 2020 16:34:15 +0000 (17:34 +0100)] 
templatetags: Add 'site_admins' tag

This lets us avoid complex templating.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agotemplatetags: Trivial cleanup
Stephen Finucane [Fri, 10 Apr 2020 16:33:02 +0000 (17:33 +0100)] 
templatetags: Trivial cleanup

Make this a little nicer to read.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agotemplates: Use standard indentation
Stephen Finucane [Fri, 10 Apr 2020 13:02:39 +0000 (14:02 +0100)] 
templates: Use standard indentation

Use a standard two space indentation across files, rewrapping some stuff
as we go along.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoREST: Add 'patch-comment-created', 'cover-comment-created' events
DJ Delorie [Tue, 29 Mar 2022 18:57:32 +0000 (19:57 +0100)] 
REST: Add 'patch-comment-created', 'cover-comment-created' events

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]

3 years agodocs: Don't version events
Stephen Finucane [Tue, 29 Mar 2022 18:57:31 +0000 (19:57 +0100)] 
docs: Don't version events

We don't actually version the types of events we emit. Doing so would be
possible, but this ship has already sailed (with API version 1.2).

We also remove some unnecessary line breaks.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agorequirements: Add pointer to fix for openapi-core
Stephen Finucane [Fri, 6 May 2022 14:50:49 +0000 (15:50 +0100)] 
requirements: Add pointer to fix for openapi-core

This will be fixed in a future openapi-core release [1]. Indicate as
much.

[1] https://github.com/p1c2u/openapi-core/pull/373

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agorequirements: Drop Django 2.2 support
Stephen Finucane [Fri, 6 May 2022 14:38:13 +0000 (15:38 +0100)] 
requirements: Drop Django 2.2 support

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agorequirements: Bump django-debug-toolbar to 3.4.x
Stephen Finucane [Fri, 6 May 2022 14:33:42 +0000 (15:33 +0100)] 
requirements: Bump django-debug-toolbar to 3.4.x

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agoviews: Fix typo
Stephen Finucane [Mon, 4 Apr 2022 17:16:19 +0000 (18:16 +0100)] 
views: Fix typo

The filename field for a patch returned by the XML-RPC API does *not*
include a file extension. This was misleading.

Signed-off-by: Stephen Finucane <stephen@that.guru>
3 years agodocker: Further refine logic to apply migrations
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>