[PATCH 1/2] docker: Use Ubuntu ports repositories on non-x86 architectures

2019-04-30 Thread Russell Currey
This should allow Patchwork to run "out of the box" in Docker on any architecture with a) an Ubuntu port and b) support in the Postgres multiarch Docker image, which includes at least arm64 and ppc64le. It's a little gross hacking the Dockerfile like this, but I'm not sure there's a more elegant w

[PATCH 2/2] docs: Mention Postgres for Docker development install

2019-04-30 Thread Russell Currey
Might as well since it's there, and it gives some clue to anyone trying to use Docker on non-x86. I figured it was best to leave this out of the README since it's incredibly niche. Signed-off-by: Russell Currey --- docs/development/installation.rst | 4 1 file changed, 4 insertions(+) dif

[PATCH] docker: Install libpq-dev to fix psycopg2-binary build

2019-04-30 Thread Russell Currey
psycopg2-binary fails if pg_config isn't installed, which is provided by libpq-dev. This seems strange to me since psycopg2-binary suggests that you use psycopg2-binary instead (of itself) if you don't want to build psycopg2 so you wouldn't need pg_config, which is very confusing. It's possible t

[PATCH] README: add .env file to installation instructions

2019-04-30 Thread Russell Currey
Creating the .env file is mentioned in the installation documentation but not in the README, so following only the steps mentioned there will fail. Add this and add a `cd patchwork` in there for good measure so you could straight up copy paste the steps. Signed-off-by: Russell Currey --- README

Re: [PATCH 07/10] Add support for Django REST Framework 3.7, 3.8

2019-04-30 Thread Daniel Axtens
Stephen Finucane writes: > On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: >> From: Stephen Finucane >> >> No breaking changes that concern us here. >> >> Signed-off-by: Stephen Finucane >> Reviewed-by: Daniel Axtens >> Signed-off-by: Daniel Axtens >> (cherry picked from commit a27f

Re: [PATCH 01/10] REST: Check.user is not read-only

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:02 +1000, Daniel Axtens wrote: > From: Stephen Finucane > > We only support 'Check' creation - not check updating. As a result, > there's no real reason that the 'Check.user' field should be read-only > and this is causing an issue with Django REST Framework 3.7. Simply >

Re: [PATCH 04/10] REST: Handle JSON requests

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: > From: Stephen Finucane > > This was raising an attribute error when switching tests to use JSON > bodies instead of form-data. > > AttributeError: 'dict' object has no attribute '_mutable' > > The easy fix is to check if it's a diction

Re: [PATCH 02/10] REST: Add new setting for maximum API page size

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: > From: Andrew Donnellan > > In 41790caf59ad ("REST: Limit max page size") we limited the maximum page > size to the default page size in the settings. > > This turns out to be rather restrictive, as we usually want to keep the > default pa

Re: [PATCH 07/10] Add support for Django REST Framework 3.7, 3.8

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: > From: Stephen Finucane > > No breaking changes that concern us here. > > Signed-off-by: Stephen Finucane > Reviewed-by: Daniel Axtens > Signed-off-by: Daniel Axtens > (cherry picked from commit a27f36fb784867e434527b8e65064ae3bdb12c82)

Re: [PATCH 06/10] REST: A check must specify a state

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: > The Ozlabs crew noticed that a check without a state caused a > KeyError in data['state']. Mark state as mandatory, check for > it, and add a test. > > Reported-by: Russell Currey > Reported-by: Jeremy Kerr > Signed-off-by: Daniel Axtens

Re: [PATCH 03/10] notifications: fix notification expiry when no user is associated

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: > From: Jeremy Kerr > > It's possible that an EmailConfirmation object will have no associated > user (eg, for email opt-out, which does not require a user object). In > this case, we will see a NULL value for EmailConfirmation.user_id. > >

Re: [PATCH 05/10] REST: Handle regular form data requests for checks

2019-04-30 Thread Stephen Finucane
On Tue, 2019-04-30 at 16:03 +1000, Daniel Axtens wrote: > 08d1459a4a40 ("Add REST API validation using OpenAPI schema") moved > all API requests to JSON blobs rather than form data. > > dc48fbce99ef ("REST: Handle JSON requests") attempted to change the > check serialiser to handle this. However,