From 42d678cd18c473244eef2f2bacf3a2da0709fc3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torben=20H=C3=B8rup?= Date: Tue, 3 Nov 2026 16:12:36 +0100 Subject: [PATCH] feat: allow deletion of deployments closes: #3464 --- gitlab/v4/objects/deployments.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gitlab/v4/objects/deployments.py b/gitlab/v4/objects/deployments.py index b7a186ca2..6fd875f5b 100644 --- a/gitlab/v4/objects/deployments.py +++ b/gitlab/v4/objects/deployments.py @@ -10,7 +10,14 @@ from gitlab import cli from gitlab import exceptions as exc from gitlab.base import RESTObject -from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin +from gitlab.mixins import ( + CreateMixin, + DeleteMixin, + ObjectDeleteMixin, + RetrieveMixin, + SaveMixin, + UpdateMixin, +) from gitlab.types import RequiredOptional from .merge_requests import ProjectDeploymentMergeRequestManager # noqa: F401 @@ -18,7 +25,7 @@ __all__ = ["ProjectDeployment", "ProjectDeploymentManager"] -class ProjectDeployment(SaveMixin, RESTObject): +class ProjectDeployment(SaveMixin, ObjectDeleteMixin, RESTObject): mergerequests: ProjectDeploymentMergeRequestManager @cli.register_custom_action( @@ -70,6 +77,7 @@ class ProjectDeploymentManager( RetrieveMixin[ProjectDeployment], CreateMixin[ProjectDeployment], UpdateMixin[ProjectDeployment], + DeleteMixin[ProjectDeployment], ): _path = "/projects/{project_id}/deployments" _obj_cls = ProjectDeployment