Re: Poor performance of '/api/events'

2018-01-09 Thread Stephen Finucane
On Fri, 2017-11-24 at 11:12 +1100, Daniel Axtens wrote: > Stephen Finucane writes: > > > I've noticed some poor performance for > > 'patchwork.ozlabs.org/api/events' when > > accessed via a browser or fetched via cURL. I haven't seen similar > > issues on > > any other

[RFC 3/4] models: Migrate event fields to JSON field

2018-01-09 Thread Stephen Finucane
This allows us to remove swathes of ForeignKeys and greatly speed up the '/events' endpoint. This comes at the disadvantage of preventing us indexing the embedded fields and would result in different responses if the serializers ever change; however, we don't do the former at the moment and it's

[RFC 2/4] REST: Support embedded serializers without context

2018-01-09 Thread Stephen Finucane
The use of 'HyperlinkedIdentityField' in a serializer requires the presence of a request context so that it's possible to get URL information. In general, this is no issue. However, going forward, this will not be guaranteed. Support serialization without this information by simply setting this

[RFC 1/4] Automatically remove old events

2018-01-09 Thread Stephen Finucane
Events are created for most state changes in Patchwork which means they're fairly numerous. Start removing them after a (configurable) interval. Signed-off-by: Stephen Finucane --- docs/deployment/configuration.rst | 7 +++ docs/usage/overview.rst

[RFC 0/4] Add 'Event.payload' field

2018-01-09 Thread Stephen Finucane
The '/event' API endpoint is really slow due to the amount of JOINs necessary to retrieve records from the database. Resolve this by a static JSON representation of any embedded data in the database. This has some disadvantages, noted in the patches, but the performance improvement is huge and

Re: [PATCH 0/6] Random cleanups

2018-01-09 Thread Stephen Finucane
On Wed, 2018-01-10 at 00:05 +, Stephen Finucane wrote: > A couple of things I noticed while working on a resolution for the > '/events' performance issues. Because these are all nits and block the thing I really care about, I've gone ahead and just applied them. Ping me if I missed something.

[PATCH 4/6] REST: Add 'mbox' to cover-letter response

2018-01-09 Thread Stephen Finucane
This should have been here in the first place. Not sure why it was missed. Signed-off-by: Stephen Finucane --- NOTE: We need to add API versioning before we can release this. That can come later. --- patchwork/api/embedded.py | 4 ++--

[PATCH 0/6] Random cleanups

2018-01-09 Thread Stephen Finucane
A couple of things I noticed while working on a resolution for the '/events' performance issues. Stephen Finucane (6): gitignore: Ignore JSON files trivial: Remove additional Django < 1.8 code signals: Don't call event creation code for fixtures REST: Add 'mbox' to cover-letter response

[PATCH 2/6] trivial: Remove additional Django < 1.8 code

2018-01-09 Thread Stephen Finucane
This is no longer necessary, given that we don't support Django 1.6 or 1.7. This was missed in a previous patch. Signed-off-by: Stephen Finucane --- patchwork/fields.py| 10 +--- patchwork/settings/base.py | 60 -- 2

[PATCH 5/6] trivial: Fix some nits

2018-01-09 Thread Stephen Finucane
Signed-off-by: Stephen Finucane --- patchwork/signals.py | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/patchwork/signals.py b/patchwork/signals.py index e31ac2f3..e5e7370f 100644 --- a/patchwork/signals.py +++

Re: [PATCH v2] parser: Log when invalid project list-id passed

2018-01-09 Thread Stephen Finucane
On Thu, 2018-01-04 at 15:43 +, Stephen Finucane wrote: > I thought there was a bug. Turns out I was just using the wrong list- > id. > Make this clearer. > > Signed-off-by: Stephen Finucane Applied. ___ Patchwork mailing list

Re: [PATCH] parser: Fix parsing of pull request emails with CRLF line endings on Python 2

2018-01-09 Thread Stephen Finucane
On Tue, 2018-01-09 at 12:01 +1100, Andrew Donnellan wrote: > On 09/01/18 11:56, Daniel Axtens wrote: > > > diff --git a/patchwork/parser.py b/patchwork/parser.py > > > index 1568bc4..7c677db 100644 > > > --- a/patchwork/parser.py > > > +++ b/patchwork/parser.py > > > @@ -666,9 +666,13 @@ def

Re: [PATCH] docs/development: Fix tox invocation for listing targets

2018-01-09 Thread Stephen Finucane
On Fri, 2018-01-05 at 13:33 +1100, Andrew Donnellan wrote: > Signed-off-by: Andrew Donnellan Whoops. Reviewed-by: Stephen Finucane ___ Patchwork mailing list Patchwork@lists.ozlabs.org

Re: [PATCH 1/4] Modify sections used in release notes

2018-01-09 Thread Stephen Finucane
On Sun, 2017-12-10 at 17:30 +, Stephen Finucane wrote: > Add an 'api' section and remove 'security' and 'issues'. The former > will helps us group REST API related changes, while the latter are > not currently used and are unlikely to ever be used. > > Signed-off-by: Stephen Finucane

Re: [PATCH v2] models, templatetags: Make tag count column in patch list optional per tag

2018-01-09 Thread Stephen Finucane
On Tue, 2018-01-09 at 18:15 +1100, Andrew Donnellan wrote: > On 19/12/17 16:32, Andrew Donnellan wrote: > > Add a field, show_column, to the Tag model to determine whether the > > tag > > gets a tag count column in the patch list view. This allows the > > creation of > > tags that will be collated