Skip to content

Commit 2b8a94a

Browse files
nejchJohnVillalovos
authored andcommitted
refactor(objects): remove deprecated tag release API
BREAKING CHANGE: remove deprecated tag release API. This was removed in GitLab 14.0
1 parent ca7777e commit 2b8a94a

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

gitlab/v4/objects/tags.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from gitlab import cli
2-
from gitlab import exceptions as exc
31
from gitlab.base import RequiredOptional, RESTManager, RESTObject
42
from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin
53

@@ -15,41 +13,6 @@ class ProjectTag(ObjectDeleteMixin, RESTObject):
1513
_id_attr = "name"
1614
_short_print_attr = "name"
1715

18-
@cli.register_custom_action("ProjectTag", ("description",))
19-
def set_release_description(self, description, **kwargs):
20-
"""Set the release notes on the tag.
21-
22-
If the release doesn't exist yet, it will be created. If it already
23-
exists, its description will be updated.
24-
25-
Args:
26-
description (str): Description of the release.
27-
**kwargs: Extra options to send to the server (e.g. sudo)
28-
29-
Raises:
30-
GitlabAuthenticationError: If authentication is not correct
31-
GitlabCreateError: If the server fails to create the release
32-
GitlabUpdateError: If the server fails to update the release
33-
"""
34-
id = self.get_id().replace("/", "%2F")
35-
path = "%s/%s/release" % (self.manager.path, id)
36-
data = {"description": description}
37-
if self.release is None:
38-
try:
39-
server_data = self.manager.gitlab.http_post(
40-
path, post_data=data, **kwargs
41-
)
42-
except exc.GitlabHttpError as e:
43-
raise exc.GitlabCreateError(e.response_code, e.error_message) from e
44-
else:
45-
try:
46-
server_data = self.manager.gitlab.http_put(
47-
path, post_data=data, **kwargs
48-
)
49-
except exc.GitlabHttpError as e:
50-
raise exc.GitlabUpdateError(e.response_code, e.error_message) from e
51-
self.release = server_data
52-
5316

5417
class ProjectTagManager(NoUpdateMixin, RESTManager):
5518
_path = "/projects/%(project_id)s/repository/tags"

tests/functional/api/test_projects.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@ def test_project_tags(project, project_file):
243243
tag = project.tags.create({"tag_name": "v1.0", "ref": "master"})
244244
assert len(project.tags.list()) == 1
245245

246-
tag.set_release_description("Description 1")
247-
tag.set_release_description("Description 2")
248-
assert tag.release["description"] == "Description 2"
249-
250246
tag.delete()
251247
assert len(project.tags.list()) == 0
252248

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy