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

The validate-modules sanity test now also validates plugins #9

Closed
felixfontein opened this issue Mar 4, 2022 · 1 comment
Closed

Comments

@felixfontein
Copy link
Contributor

felixfontein commented Mar 4, 2022

Today ansible/ansible#71734 was merged to ansible-core's devel branch, which extends ansible-test's validate-modules sanity test to also validate the documentation (and thus configuration) for (documentable) plugins.

You might notice some CI failures related to this. Please note that some choices in the schema are opinionated, but I didn't make them up (all by) myself :) Some of these were discussed and settled by the core team in some issues (ansible/ansible#71792, ansible/ansible#71793, ansible/ansible#71794, ansible/ansible#71795, ansible/ansible#71796, ansible/ansible#71797, ansible/ansible#71798).

If you encounter a situation where you think something is wrong, feel free to mention that in the discussion: #11

@felixfontein felixfontein pinned this issue Mar 4, 2022
@felixfontein felixfontein unpinned this issue Mar 4, 2022
@ansible-collections ansible-collections locked and limited conversation to collaborators Mar 4, 2022
@felixfontein
Copy link
Contributor Author

Today an extension to validate-modules was merged (ansible/ansible#77268) that does some more checks for plugins, but also affects module validations. It affects only DOCUMENTATION, and thus also works for plugins:

  1. required: true and a present documentation default: raises an error (similar to when this is done in a module argspec);
  2. elements present without type=list raises an error (similar to when this is done in a module argspec);
  3. elements not present with type=list raises an error (similar to when this is done in a module argspec);
  4. the types of choices and default are checked if the type is a valid type for a plugin.

For modules, 4. can result in new errors. The most common is when using an integer as a choice or default value for type=str. (For choices this is a serious problem for plugins, as no conversion is done on choices elements. For default and for modules this is different.) While this isn't fully necessary, it makes rendering the proper type of a value easier (for everything that wants to render documentation) since this makes sure that the YAML type uses actually equals the documented type.

@mattclay mattclay closed this as completed Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants