1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-24 20:59:16 +00:00

gitlab_project_variable - use find_project() for graceful error handling (#11878)

* gitlab_project_variable - use find_project() for consistent error handling

Replace the bare projects.get() call in GitlabProjectVariables.get_project()
with find_project() from module_utils/gitlab, which all other GitLab modules
already use. This ensures a graceful fail_json (with a clear error message)
when the project is not found, rather than an unhandled GitlabGetError
propagating as a module traceback.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* Add changelog fragment for PR 11878

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* minor adjustment in f-string

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky 2026-04-19 22:42:37 +12:00 committed by GitHub
parent 77509be2aa
commit 1b0b8d5cc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -0,0 +1,5 @@
bugfixes:
- gitlab_project_variable - use ``find_project()`` from module utils for project lookup, consistent
with all other GitLab modules in the collection
(https://github.com/ansible-collections/community.general/issues/3157,
https://github.com/ansible-collections/community.general/pull/11878).