[PATCH v4 0/4] Store the 'actor' responsible for events
Stephen Finucane
stephen at that.guru
Sun Dec 1 23:11:17 AEDT 2019
On Sun, 2019-12-01 at 02:49 +0100, Johan Herland wrote:
> 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 actually updated the patch state/delegate. The need for
> this enhancement is also documented in Issue #73.
>
> This patch series adds an 'actor' field to the Event model, and - for
> applicable events - stores the user responsible for that event (i.e. the
> current/active user, if any) into this field.
>
> This applies to the following events:
> - patch-state-changed
> - patch-delegated
> - check-created
>
> The other events are all generated in response to incoming emails, and
> therefore have no responsible actor at all (in the sense of a logged-in
> user performing an action to trigger the event). In these cases
> (and any other scenario where we cannot find the active/current user)
> the Event.actor field is simply left as null/None.
>
> Finally, the new Event.actor field is exposed in the events view of the
> REST API (as of API version 1.2), and we also allow filtering by actor.
Thanks for the quick turnaround on this. I squashed patches 3 and 4,
added a release note, fixed a minor issue with the schema documentation
and pushed everything. It will form part of Patchwork v2.2 which I'm
hoping to get out this coming week.
Cheers,
Stephen
> Changes since v3:
> - Drop wiring up the actor in patch-created, patch-completed, and
> series-completed events (as there are triggered by emails).
> - Add patch #4 to allow filtering events by actor.
>
>
> Have fun!
> ...Johan
>
>
> Johan Herland (4):
> models.Event: Add the user responsible for the event
> Include the responsible actor in applicable events
> /api/events: Add 'actor' field to generated JSON
> /api/events: Allow filtering by 'actor' field
>
> docs/api/schemas/latest/patchwork.yaml | 6 ++++
> docs/api/schemas/patchwork.j2 | 8 +++++
> docs/api/schemas/v1.2/patchwork.yaml | 6 ++++
> docs/usage/overview.rst | 3 ++
> patchwork/api/event.py | 10 ++++--
> patchwork/api/filters.py | 5 ++-
> patchwork/migrations/0037_event_actor.py | 21 +++++++++++
> patchwork/models.py | 10 +++++-
> patchwork/signals.py | 3 ++
> patchwork/tests/api/test_event.py | 46 ++++++++++++++++++++++++
> patchwork/tests/test_events.py | 7 ++++
> 11 files changed, 120 insertions(+), 5 deletions(-)
> create mode 100644 patchwork/migrations/0037_event_actor.py
>
More information about the Patchwork
mailing list