github_repo: deprecate force_defaults=true (#10435)
Some checks failed
EOL CI / EOL Sanity (Ⓐ2.16) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled

* github_repo: deprecate force_defaults=true

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-08-05 16:12:48 +12:00 committed by GitHub
commit 25163ed87a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View file

@ -0,0 +1,2 @@
deprecated_features:
- github_repo - deprecate ``force_defaults=true`` (https://github.com/ansible-collections/community.general/pull/10435).

View file

@ -83,11 +83,9 @@ options:
version_added: "3.5.0" version_added: "3.5.0"
force_defaults: force_defaults:
description: description:
- Overwrite current O(description) and O(private) attributes with defaults if set to V(true), which currently is the - If V(true), overwrite current O(description) and O(private) attributes with defaults.
default. - V(true) is deprecated for this option and will not be allowed starting in community.general 13.0.0. V(false) will be the default value then.
- The default for this option will be deprecated in a future version of this collection, and eventually change to V(false).
type: bool type: bool
default: true
required: false required: false
version_added: 4.1.0 version_added: 4.1.0
requirements: requirements:
@ -252,7 +250,7 @@ def main():
private=dict(type='bool'), private=dict(type='bool'),
description=dict(type='str'), description=dict(type='str'),
api_url=dict(type='str', default='https://api.github.com'), api_url=dict(type='str', default='https://api.github.com'),
force_defaults=dict(type='bool', default=True), force_defaults=dict(type='bool'),
) )
module = AnsibleModule( module = AnsibleModule(
argument_spec=module_args, argument_spec=module_args,
@ -262,6 +260,11 @@ def main():
mutually_exclusive=[('username', 'access_token')] mutually_exclusive=[('username', 'access_token')]
) )
if module.params['force_defaults'] is None:
module.deprecate("'force_defaults=true' is deprecated and will not be allowed in community.general 13.0.0, use 'force_defaults=false' instead",
version="13.0.0", collection_name="community.general")
module.params['force_defaults'] = True
if not HAS_GITHUB_PACKAGE: if not HAS_GITHUB_PACKAGE:
module.fail_json(msg=missing_required_lib( module.fail_json(msg=missing_required_lib(
"PyGithub"), exception=GITHUB_IMP_ERR) "PyGithub"), exception=GITHUB_IMP_ERR)