From 275b979f7ce39b6d4a0035849f8da6a42400ba09 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 25 Feb 2021 10:22:12 +0100 Subject: [PATCH] Tidy up sanity checks ignore lines for source_control/* modules (#1893) (#1897) * fixed validation-modules for plugins/modules/source_control/git* * Tidy up sanity checks ignore lines for source_control/* modules * removed unnecessary ignore lines from 2.9 and 2.11 (cherry picked from commit cf5e9bf44c46932d59cdf5c8140342ee2f80eed1) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- plugins/modules/source_control/git_config.py | 5 +++++ .../source_control/github/github_deploy_key.py | 9 +++++++++ plugins/modules/source_control/github/github_issue.py | 4 ++++ plugins/modules/source_control/github/github_key.py | 4 ++++ .../modules/source_control/github/github_release.py | 9 +++++++++ .../modules/source_control/github/github_webhook.py | 9 +++++++++ .../source_control/github/github_webhook_info.py | 5 +++++ tests/sanity/ignore-2.10.txt | 11 ----------- tests/sanity/ignore-2.11.txt | 11 ----------- tests/sanity/ignore-2.9.txt | 11 ----------- 10 files changed, 45 insertions(+), 33 deletions(-) diff --git a/plugins/modules/source_control/git_config.py b/plugins/modules/source_control/git_config.py index 8c63a8436f..84a5f95b0e 100644 --- a/plugins/modules/source_control/git_config.py +++ b/plugins/modules/source_control/git_config.py @@ -34,10 +34,12 @@ options: description: - The name of the setting. If no value is supplied, the value will be read from the config if it has been set. + type: str repo: description: - Path to a git repository for reading and writing values from a specific repo. + type: path scope: description: - Specify which scope to read/set values from. This is required @@ -45,6 +47,7 @@ options: also specify the repo parameter. It defaults to system only when not using I(list_all)=yes. choices: [ "local", "global", "system" ] + type: str state: description: - "Indicates the setting should be set/unset. @@ -52,10 +55,12 @@ options: when I(state)=absent and I(value) is defined, I(value) is discarded." choices: [ 'present', 'absent' ] default: 'present' + type: str value: description: - When specifying the name of a single setting, supply a value to set that setting to the given value. + type: str ''' EXAMPLES = ''' diff --git a/plugins/modules/source_control/github/github_deploy_key.py b/plugins/modules/source_control/github/github_deploy_key.py index 8836454e05..8954317b71 100644 --- a/plugins/modules/source_control/github/github_deploy_key.py +++ b/plugins/modules/source_control/github/github_deploy_key.py @@ -29,20 +29,24 @@ options: - The name of the individual account or organization that owns the GitHub repository. required: true aliases: [ 'account', 'organization' ] + type: str repo: description: - The name of the GitHub repository. required: true aliases: [ 'repository' ] + type: str name: description: - The name for the deploy key. required: true aliases: [ 'title', 'label' ] + type: str key: description: - The SSH public key to add to the repository as a deploy key. required: true + type: str read_only: description: - If C(true), the deploy key will only be able to read repository contents. Otherwise, the deploy key will be able to read and write. @@ -53,6 +57,7 @@ options: - The state of the deploy key. default: "present" choices: [ "present", "absent" ] + type: str force: description: - If C(true), forcefully adds the deploy key by deleting any existing deploy key with the same public key or title. @@ -61,16 +66,20 @@ options: username: description: - The username to authenticate with. Should not be set when using personal access token + type: str password: description: - The password to authenticate with. Alternatively, a personal access token can be used instead of I(username) and I(password) combination. + type: str token: description: - The OAuth2 token or personal access token to authenticate with. Mutually exclusive with I(password). + type: str otp: description: - The 6 digit One Time Password for 2-Factor Authentication. Required together with I(username) and I(password). aliases: ['2fa_token'] + type: int notes: - "Refer to GitHub's API documentation here: https://developer.github.com/v3/repos/keys/." ''' diff --git a/plugins/modules/source_control/github/github_issue.py b/plugins/modules/source_control/github/github_issue.py index 9c4b558bd5..66d26c8301 100644 --- a/plugins/modules/source_control/github/github_issue.py +++ b/plugins/modules/source_control/github/github_issue.py @@ -18,20 +18,24 @@ options: description: - Name of repository from which issue needs to be retrieved. required: true + type: str organization: description: - Name of the GitHub organization in which the repository is hosted. required: true + type: str issue: description: - Issue number for which information is required. required: true + type: int action: description: - Get various details about issue depending upon action specified. default: 'get_status' choices: - 'get_status' + type: str author: - Abhijeet Kasurde (@Akasurde) ''' diff --git a/plugins/modules/source_control/github/github_key.py b/plugins/modules/source_control/github/github_key.py index 415065f88e..616636edea 100644 --- a/plugins/modules/source_control/github/github_key.py +++ b/plugins/modules/source_control/github/github_key.py @@ -17,18 +17,22 @@ options: description: - GitHub Access Token with permission to list and create public keys. required: true + type: str name: description: - SSH key name required: true + type: str pubkey: description: - SSH public key value. Required when C(state=present). + type: str state: description: - Whether to remove a key, ensure that it exists, or update its value. choices: ['present', 'absent'] default: 'present' + type: str force: description: - The default is C(yes), which will replace the existing remote key diff --git a/plugins/modules/source_control/github/github_release.py b/plugins/modules/source_control/github/github_release.py index 5372d6e898..7813ba1d89 100644 --- a/plugins/modules/source_control/github/github_release.py +++ b/plugins/modules/source_control/github/github_release.py @@ -18,34 +18,43 @@ options: token: description: - GitHub Personal Access Token for authenticating. Mutually exclusive with C(password). + type: str user: description: - The GitHub account that owns the repository + type: str required: true password: description: - The GitHub account password for the user. Mutually exclusive with C(token). + type: str repo: description: - Repository name + type: str required: true action: description: - Action to perform + type: str required: true choices: [ 'latest_release', 'create_release' ] tag: description: - Tag name when creating a release. Required when using action is set to C(create_release). + type: str target: description: - Target of release when creating a release + type: str name: description: - Name of release when creating a release + type: str body: description: - Description of the release when creating a release + type: str draft: description: - Sets if the release is a draft or not. (boolean) diff --git a/plugins/modules/source_control/github/github_webhook.py b/plugins/modules/source_control/github/github_webhook.py index ac15368986..2a737ef5a4 100644 --- a/plugins/modules/source_control/github/github_webhook.py +++ b/plugins/modules/source_control/github/github_webhook.py @@ -18,22 +18,26 @@ options: repository: description: - Full name of the repository to configure a hook for + type: str required: true aliases: - repo url: description: - URL to which payloads will be delivered + type: str required: true content_type: description: - The media type used to serialize the payloads + type: str required: false choices: [ form, json ] default: form secret: description: - The shared secret between GitHub and the payload URL. + type: str required: false insecure_ssl: description: @@ -61,24 +65,29 @@ options: state: description: - Whether the hook should be present or absent + type: str required: false choices: [ absent, present ] default: present user: description: - User to authenticate to GitHub as + type: str required: true password: description: - Password to authenticate to GitHub with + type: str required: false token: description: - Token to authenticate to GitHub with + type: str required: false github_url: description: - Base URL of the GitHub API + type: str required: false default: https://api.github.com diff --git a/plugins/modules/source_control/github/github_webhook_info.py b/plugins/modules/source_control/github/github_webhook_info.py index f99a0a0328..0fd0b97bc2 100644 --- a/plugins/modules/source_control/github/github_webhook_info.py +++ b/plugins/modules/source_control/github/github_webhook_info.py @@ -19,24 +19,29 @@ options: repository: description: - Full name of the repository to configure a hook for + type: str required: true aliases: - repo user: description: - User to authenticate to GitHub as + type: str required: true password: description: - Password to authenticate to GitHub with + type: str required: false token: description: - Token to authenticate to GitHub with + type: str required: false github_url: description: - Base URL of the github api + type: str required: false default: https://api.github.com diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index e5a953d017..4ab2987620 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -381,19 +381,8 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def plugins/modules/remote_management/stacki/stacki_host.py validate-modules:no-default-for-required-parameter plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter -plugins/modules/source_control/git_config.py validate-modules:doc-missing-type -plugins/modules/source_control/git_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_deploy_key.py validate-modules:doc-missing-type plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid -plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-type-not-in-doc plugins/modules/source_control/github/github_hooks.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_issue.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_issue.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_key.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_release.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_release.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_webhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_webhook_info.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:parameter-list-no-elements plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 47aee5bdc4..bae40b11e6 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -369,19 +369,8 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def plugins/modules/remote_management/stacki/stacki_host.py validate-modules:no-default-for-required-parameter plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter -plugins/modules/source_control/git_config.py validate-modules:doc-missing-type -plugins/modules/source_control/git_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_deploy_key.py validate-modules:doc-missing-type plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid -plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-type-not-in-doc plugins/modules/source_control/github/github_hooks.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_issue.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_issue.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_key.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_release.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_release.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_webhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_webhook_info.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:parameter-list-no-elements plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 4a3b159744..63b80731c1 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -350,21 +350,10 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def plugins/modules/remote_management/stacki/stacki_host.py validate-modules:no-default-for-required-parameter plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter -plugins/modules/source_control/git_config.py validate-modules:doc-missing-type -plugins/modules/source_control/git_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_deploy_key.py validate-modules:doc-missing-type plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid -plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-type-not-in-doc plugins/modules/source_control/github/github_hooks.py validate-modules:deprecation-mismatch plugins/modules/source_control/github/github_hooks.py validate-modules:invalid-documentation plugins/modules/source_control/github/github_hooks.py validate-modules:missing-main-call -plugins/modules/source_control/github/github_issue.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_issue.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_key.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_release.py validate-modules:doc-missing-type -plugins/modules/source_control/github/github_release.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_webhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/source_control/github/github_webhook_info.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-type-not-in-doc plugins/modules/storage/netapp/na_cdot_aggregate.py validate-modules:deprecation-mismatch