From c4d8ec48d7ce4030e3fc5f8753179242310d8dd7 Mon Sep 17 00:00:00 2001 From: David Davis Date: Mon, 29 Dec 2025 20:11:52 +0000 Subject: [PATCH] Override modify task in the plugin API --- CHANGES/plugin_api/+override-modify-task.feature | 2 ++ pulpcore/plugin/actions.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 CHANGES/plugin_api/+override-modify-task.feature diff --git a/CHANGES/plugin_api/+override-modify-task.feature b/CHANGES/plugin_api/+override-modify-task.feature new file mode 100644 index 00000000000..c643a4eb8bc --- /dev/null +++ b/CHANGES/plugin_api/+override-modify-task.feature @@ -0,0 +1,2 @@ +Added `modify_task` property to `ModifyRepositoryActionMixin` so plugin writers can override the +task that Pulp calls. diff --git a/pulpcore/plugin/actions.py b/pulpcore/plugin/actions.py index ce9d1c225b1..2a98d917895 100644 --- a/pulpcore/plugin/actions.py +++ b/pulpcore/plugin/actions.py @@ -15,6 +15,8 @@ class ModifyRepositoryActionMixin: + modify_task = tasks.repository.add_and_remove + @extend_schema( description="Trigger an asynchronous task to create a new repository version.", summary="Modify Repository Content", @@ -35,7 +37,7 @@ def modify(self, request, pk): base_version_pk = None task = dispatch( - tasks.repository.add_and_remove, + self.modify_task, exclusive_resources=[repository], kwargs={ "repository_pk": pk,