1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

chore: add deprecation warning for gitlab group membership (#3451)

* chore: add deprecation warning

* chore: add deprecation message, version and collection

* chore: add changelog fragment

* docs: add deprecation info

* fix: max line length and whitespace

* fix continuation line under-indented

* Update changelogs/fragments/3451-gitlab-group-member-deprecate-name-and-path.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/source_control/gitlab/gitlab_group_members.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Frederic Werner 2021-09-27 21:49:52 +02:00 committed by GitHub
parent b6b7601615
commit ba2917a7dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,2 @@
deprecated_features:
- gitlab_group_members - setting ``gitlab_group`` to ``name`` or ``path`` is deprecated. Use ``full_path`` instead (https://github.com/ansible-collections/community.general/pull/3451).

View file

@ -27,7 +27,8 @@ options:
type: str type: str
gitlab_group: gitlab_group:
description: description:
- The name of the GitLab group the member is added to/removed from. - The C(full_path) of the GitLab group the member is added to/removed from.
- Setting this to C(name) or C(path) is deprecated and will be removed in community.general 6.0.0. Use C(full_path) instead.
required: true required: true
type: str type: str
gitlab_user: gitlab_user:
@ -185,6 +186,9 @@ class GitLabGroup(object):
return group.id return group.id
for group in groups: for group in groups:
if group.path == gitlab_group or group.name == gitlab_group: if group.path == gitlab_group or group.name == gitlab_group:
self._module.deprecate(
msg="Setting 'gitlab_group' to 'name' or 'path' is deprecated. Use 'full_path' instead",
version="6.0.0", collection_name="community.general")
return group.id return group.id
# get all members in a group # get all members in a group