[PATCH 0/3] Allow a project to restrict submitter state changes

Stephen Finucane stephen at that.guru
Wed Aug 4 01:37:51 AEST 2021


On Tue, 2021-08-03 at 01:27 +1000, Daniel Axtens wrote:
> In discussions about how to make patchwork more user-friendly and
> suitable for more projects, we realised that perhaps the current
> ability for submitters to change their patch state to any value
> isn't the most appropriate setting for all maintainers, especially
> in light of increasing maintainer-driven API-centric automation.
> 
> This set of 3 patches allows a project to stop a submitter from
> changing the state of their patches - in the UI, via xmlrpc and via
> REST. This is not the default behaviour but can be set by a patchwork
> administrator on a per-project basis.

This is a sensible idea. I hadn't seen this gap myself since I'm a maintainer on
the only project I really care about rn, Patchwork itself. I've left reviews on
each of the patches. One additional suggestion that I would make is to allow
project maintainers to toggle this feature flag themselves rather than having to
ask a likely (overloaded) Patchwork admin to do this for them. However, this
would require a project "settings" page which, to the best of my knowledge, we
don't actually have yet. Perhaps we could simply expose this flag via the REST
API for now (note: would require a new API version) and add this project
settings page as part of/after Raxel's other UX changes? I'm pretty sure I
actually have just such a patch lying around somewhere, if only I could remember
where...

Stephen

> 
> Daniel Axtens (3):
>   Allow a project to restrict submitter state changes
>   xmlrpc: Allow a project to restrict submitter state changes
>   REST: Allow a project to restrict submitter state changes
> 
>  patchwork/api/patch.py                        | 10 +++
>  ...45_project_submitter_state_change_rules.py | 24 +++++
>  patchwork/models.py                           | 36 ++++++++
>  patchwork/tests/api/test_patch.py             | 70 +++++++++++++++
>  patchwork/tests/test_xmlrpc.py                | 90 +++++++++++++++++++
>  patchwork/views/__init__.py                   |  8 ++
>  patchwork/views/patch.py                      | 14 ++-
>  patchwork/views/xmlrpc.py                     |  4 +
>  8 files changed, 254 insertions(+), 2 deletions(-)
>  create mode 100644 patchwork/migrations/0045_project_submitter_state_change_rules.py
> 




More information about the Patchwork mailing list