* Fix gitlab_hook: only pass releases_events to API when specified
The releases_events parameter now only gets passed to the GitLab API:
- On create: always passed (fixes 500 error when not specified)
- On update: only passed when explicitly specified by user
This avoids forcing the releases_events value during updates when not
intended by the user.
Fixes: https://github.com/ansible-collections/community.general/issues/11269
* Add changelog fragment for gitlab_hook releases_events fix
Fixes: https://github.com/ansible-collections/community.general/issues/11269
* Add PR link to changelog fragment
* Use .get() for safer dict access in releases_events handling
* Update plugins/modules/gitlab_hook.py
remove `.get()`
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/gitlab_hook.py
Remove the null check for `options[“releases_events”]`
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Charles Chia <charleschia@email.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Make all doc fragments private.
* Make all plugin utils private.
* Make all module utils private.
* Reformat.
* Changelog fragment.
* Update configs and ignores.
* Adjust unit test names.
* Adjust all __future__ imports:
for i in $(grep -REl "__future__.*absolute_import" plugins/ tests/); do
sed -e 's/from __future__ import .*/from __future__ import annotations/g' -i $i;
done
* Remove all UTF-8 encoding specifications for Python source files:
for i in $(grep -REl '[-][*]- coding: utf-8 -[*]-' plugins/ tests/); do
sed -e '/^# -\*- coding: utf-8 -\*-/d' -i $i;
done
* Remove __metaclass__ = type:
for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
sed -e '/^__metaclass__ = type/d' -i $i;
done
* fix(modules/gitlab_runner): Use correct argument to list all runners
python-gitlab 4.0.0 removed support for the `as_list=False` parameter.
This functionality is now available as `iterator=True`.
Without this change, the module actually only retrieves the first
20 results, which can lead to non-idempotent behavior, such as
registering a runner again.
* Add changelog entry (#7790)
* gitlab_runner: Check python-gitlab version when listing runners
* gitlab: Add list_all_kwargs variable to module_utils
* refactor(gitlab modules): use list_all_kwargs where it helps (#7790)
I did not change every instance of all=True or all=False, only those
which could obviously benefit from simplifying:
* Code using `all=True` but then searching for any items that match a
condition (no need to collect the full list).
* Code that basically reimplements `all=True` with manual pagination.
(These could be changed to `all=True`, but `list_all_kwargs` also
sets per_page to 100, to gather data faster.)
* gitlab_instance_variable: Use list_all_kwargs
* Add new changelog entry for gitlab module changes (#7790)
* Adding releases events option to gitlab_hook module
* Fixing typo in documentation for gitlab_hook module
* No default value for releases_events
* Adding changelog fragment