[PATCH] RFC: Monkey-patch Django performance bug

2017-09-03 Thread Daniel Axtens
OzLabs noticed a performance regression, which was traced to the loading of the 'headers', 'content' and 'diff' fields, despite the 'defer()' call in views/__init__.py:generic_list() This is a django bug, reported upstream and fixed at: https://code.djangoproject.com/ticket/28549#ticket https://gi

Re: [PATCH] REST: Filter projects by 'linkname', not 'name'

2017-09-03 Thread Daniel Axtens
Hi Stephen, I was just reading though this before applying it when it occurred to me: > except ValueError: > -filters = {'name__iexact': ' '.join(value.split('-'))} > +filters = {'linkname__iexact': ' '.join(value.split('-'))} Surely a linkname shouldn't have spac

[PATCH 0/4] PostgreSQL fixes and test support

2017-09-03 Thread Daniel Axtens
Hi all, Apologies for the radio silence from me - I've been working mostly on this: Production deployments of Patchwork often use postgres instead of mysql. So far we haven't been testing that very well, and so when OzLabs was upgraded some bugs were discovered. jk has kindly sent patches to fix

[PATCH 2/4] Simplify docker-compose MySQL setup

2017-09-03 Thread Daniel Axtens
This moves the config from a separate Dockerfile to something integrated into the docker-compose.yml file. Signed-off-by: Daniel Axtens --- Having this set up with an image rather than a build makes it much easier for the postgres file to come. --- docker-compose.yml| 9 +++--

[PATCH 1/4] Enforce ordering of bundles in REST test

2017-09-03 Thread Daniel Axtens
This is required to make the tests pass on a recent version of postgres. Signed-off-by: Daniel Axtens --- patchwork/tests/test_rest_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/tests/test_rest_api.py b/patchwork/tests/test_rest_api.py index abffd17fddec..d

[PATCH 3/4] Support testing with PostgreSQL

2017-09-03 Thread Daniel Axtens
This allows us to easily test against PostgreSQL using the same tooling we normally use. This is helpful in (for example) shaking out the test failures that were observed on ozlabs.org To use it: docker-compose -f docker-compose-pg.yml (You may find it necessary to do a 'docker-compose down' f

[PATCH 4/4] Test postgresql support in Travis CI

2017-09-03 Thread Daniel Axtens
Use the most recent version of postgres (9.6) because we need a more recent version than the default to show up the broken bundle behaviour. This should prevent us from causing any further regressions. I've also had to flick from using the 'travis' user to the 'root' user for mysql - not entirely

Re: [PATCH] REST: Filter projects by 'linkname', not 'name'

2017-09-03 Thread Jeremy Kerr
Hi Dnaiel, > I was just reading though this before applying it when it occurred to > me: >> except ValueError: >> -filters = {'name__iexact': ' '.join(value.split('-'))} >> +filters = {'linkname__iexact': ' '.join(value.split('-'))} > > Surely a linkname shouldn't