-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: github_repo does not apply defaults on existing repos #2386
Conversation
This comment has been minimized.
This comment has been minimized.
Thanks for your contribution! Please add a changelog fragment. Also if you're changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR does something else than fixing #2376. (In particular, it is a breaking change, since not specifying description
no longer sets the description to an empty string, and similar for private
.)
(While I prefer the new behavior, it is still a breaking change and needs a deprecation period.)
BTW, this is a PR which removes similar bad defaults in a backwards compatible way for docker_container: #1343 |
Sorry, I don't see why it is a breaking change. For PyGithub, an empty string in description is the same as Keeping current version of the module breaks idempotency and results are unexpected. |
@aminvakil @felixfontein This was left pending. It is not clear to me what remains to be done with this PR. The latest talk was about a breaking change but I need more information on how to deal with the deprecation period. |
This is still a breaking change. You need to keep the default values in this PR, and (once this is merged) create a new PR which adds a |
hi @atorrescogollo are you still planning on working on this? needs_revision |
Hi @russoz and @felixfontein , now the same behaviour is given with force_defaults enabled (default behaviour) in order to deal with breaking change. When disabled, it won't change description and private attributes. Next step should be to change the default behaviour of force_defaults to disabled in other PR. |
Co-authored-by: Felix Fontein <felix@fontein.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Will merge by Monday if nobody complains.
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #3769 🤖 @patchback |
* github_repo do not apply defaults on currently existing repos * Fixed sanity * Fixed doc defaults * Added changelog * Fix "or" statement and some formatting * Improve description change check * Added api_url parameter for unit tests and default values for private and description parameters * Added force_defaults parameter * Improved docs * Fixed doc anchors for force_defaults parameter * Update plugins/modules/source_control/github/github_repo.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 17c3708)
@atorrescogollo thanks for improving this! |
…#3769) * github_repo do not apply defaults on currently existing repos * Fixed sanity * Fixed doc defaults * Added changelog * Fix "or" statement and some formatting * Improve description change check * Added api_url parameter for unit tests and default values for private and description parameters * Added force_defaults parameter * Improved docs * Fixed doc anchors for force_defaults parameter * Update plugins/modules/source_control/github/github_repo.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 17c3708) Co-authored-by: Álvaro Torres Cogollo <atorrescogollo@gmail.com>
SUMMARY
Fixes #2376.
Module github_repo sets parameter default values when not specified in existing repos.
ISSUE TYPE
COMPONENT NAME
github_repo
ADDITIONAL INFORMATION
Module github_repo is applying defaults when repo already exists. However, defaults must be set only when the repo is created. Otherwise, not specifying a parameter will apply default value, which is a wrong behaviour.
Also, two tests are include in order to ensure this behaviour:
test_create_new_org_repo_incomplete
: new repo with default valuestest_idempotency_existing_org_private_repo
: preserveprivate
anddescription
on existing repos