Skip to content
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

[PR #2386/17c3708f backport][stable-4] Bugfix: github_repo does not apply defaults on existing repos #3769

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Nov 22, 2021

This is a backport of PR #2386 as merged into main (17c3708).

SUMMARY

Fixes #2376.

Module github_repo sets parameter default values when not specified in existing repos.

ISSUE TYPE
  • Bugfix Pull Request
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 values
  • test_idempotency_existing_org_private_repo: preserve private and description on existing repos

* 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)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) source_control tests tests unit tests/unit and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Nov 22, 2021
@felixfontein felixfontein merged commit 3eab4fa into stable-4 Nov 22, 2021
@felixfontein felixfontein deleted the patchback/backports/stable-4/17c3708f31631ce6a10c39ccc0ef3405feb94f04/pr-2386 branch November 22, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type) source_control tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants