[PATCH 2/3] Include the responsible user in patch-related events

2019-10-06 Thread Johan Herland
We want to use the events as an audit log of patch state/delegate changes. An important part of this is recording _who_ changed the patch state/delegate. To do this, we need to know the active user (request.user) at the point where we create the Event instance. Event creation is currently triggere

[PATCH 1/3] models.Event: Add the user responsible for the event

2019-10-06 Thread Johan Herland
This allows using the events as a kind of audit log, to see how a patch came to its current state/delegate. Cc: Mauro Carvalho Chehab Signed-off-by: Johan Herland --- patchwork/migrations/0037_event_user.py | 23 +++ patchwork/models.py | 4 2 files

[PATCH 3/3] /api/events: Add 'user' field to generated JSON

2019-10-06 Thread Johan Herland
Cc: Mauro Carvalho Chehab Signed-off-by: Johan Herland --- docs/api/schemas/latest/patchwork.yaml | 6 ++ docs/api/schemas/patchwork.j2 | 6 ++ docs/api/schemas/v1.0/patchwork.yaml | 6 ++ docs/api/schemas/v1.1/patchwork.yaml | 6 ++ docs/api/schemas/v1.2/patchwo

[PATCH 0/3] Store the user responsible for patch-related events

2019-10-06 Thread Johan Herland
The V4L project (https://patchwork.linuxtv.org) uses patch states and delegates extensively to track progress. We want an audit log to keep track of the changes made to these patch fields. The Event model already records this information, but leaves out one crucial detail: which maintainer/user act