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

Collection requirements: undocumented-parameter must only be used for deprecated parameters or internal parameters #989

Merged
merged 2 commits into from Jan 31, 2024

Conversation

felixfontein
Copy link
Collaborator

Proposal: update the collection requirements so that undocumented-parameter in tests/sanity/ignore-*.txt is allowed in specific circumstances:

  1. deprecated parameters;
  2. internal parameters used to transport data from an action plugin to a module.

Right now undocumented-parameter is listed as explicitly forbidden. Some collections in Ansible violate this rule, especially for 2 above. But let me give some more details:

Rationale for exception 1: This has been used in the past when removing dangerous parameters to make sure that users get a useful error message. One such case was ansible-collections/community.general@11ef03e.

Rationale for exception 2: If code has to be spread over both an action plugin and a module, some data often needs to be passed from the action plugin to the module. The only way to do this is to add a module parameter. The validate-modules sanity tests requires this parameter to be documented, which is wrong since the user cannot use that parameter - it is provided directly by the action plugin. Since there is no mechanism to disable the error for a specific module parameter, it needs to be disabled completely. Example: https://github.com/ansible-collections/community.docker/blob/main/plugins/action/docker_container_copy_into.py#L28https://github.com/ansible-collections/community.docker/blob/main/plugins/modules/docker_container_copy_into.py#L776.

I'll create a discussion in the forum where we can also vote on this.

@ansible-documentation-bot ansible-documentation-bot bot added the sc_approval This PR requires approval from the Ansible Community Steering Committee label Dec 23, 2023
Comment on lines 409 to 412
* The following validations MUST not be ignored except in specific circumstances:
* ``validate-modules:undocumented-parameter``: this MUST only be ignored in one of these two cases:
1. A dangerous module parameter has been deprecated or removed, and code is present to inform the user that they should not use this specific parameter anymore or that it stopped working intentionally.
2. Module parameters are only used to pass in data from an accompanying action plugin.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem the nested ordered list is formatted correctly:

Rendered

@felixfontein felixfontein changed the title [WIP] Collection requirements: undocumented-parameter must only be used for deprecated parameters or internal parameters [waiting for SC/community vote] Collection requirements: undocumented-parameter must only be used for deprecated parameters or internal parameters Jan 16, 2024
@felixfontein felixfontein changed the title [waiting for SC/community vote] Collection requirements: undocumented-parameter must only be used for deprecated parameters or internal parameters Collection requirements: undocumented-parameter must only be used for deprecated parameters or internal parameters Jan 31, 2024
@felixfontein felixfontein marked this pull request as ready for review January 31, 2024 17:42
@felixfontein felixfontein requested a review from a team as a code owner January 31, 2024 17:42
@felixfontein felixfontein merged commit 9aed903 into ansible:devel Jan 31, 2024
8 checks passed
@felixfontein felixfontein deleted the undocumented-parameters branch January 31, 2024 17:56
@felixfontein felixfontein added the backport-2.16 Automatically create a backport for the stable-2.16 branch label Jan 31, 2024
Copy link

patchback bot commented Jan 31, 2024

Backport to stable-2.16: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-2.16/9aed903be131c4bd6249296ad51bd826c2316157/pr-989

Backported as #1100

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jan 31, 2024
… deprecated parameters or internal parameters (#989)

* undocumented-parameter must only be used for deprecated parameters or internal parameters.

* Add newline.

(cherry picked from commit 9aed903)
felixfontein added a commit that referenced this pull request Jan 31, 2024
… deprecated parameters or internal parameters (#989) (#1100)

* undocumented-parameter must only be used for deprecated parameters or internal parameters.

* Add newline.

(cherry picked from commit 9aed903)

Co-authored-by: Felix Fontein <felix@fontein.de>
oraNod pushed a commit to BhattacharjeeSutapa/ansible-documentation that referenced this pull request Feb 12, 2024
… deprecated parameters or internal parameters (ansible#989)

* undocumented-parameter must only be used for deprecated parameters or internal parameters.

* Add newline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2.16 Automatically create a backport for the stable-2.16 branch sc_approval This PR requires approval from the Ansible Community Steering Committee
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants