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

docs: add argument specs to roles #27

Merged
merged 5 commits into from
Mar 5, 2023

Conversation

gardar
Copy link
Member

@gardar gardar commented Feb 22, 2023

Enables parameter validation in roles and opens up the possibility to auto generate docs with antsibull-docs

@gardar gardar force-pushed the docs/argument_specs branch 3 times, most recently from 0595d3d to 9fa93a6 Compare March 1, 2023 22:41
@paulfantom
Copy link
Member

Are those files something that could be generated from defaults.yaml or would we need to remember to change them when defaults.yaml are changed?

@gardar
Copy link
Member Author

gardar commented Mar 2, 2023

Unfortunately they are managed completely separate from the defaults. Here's a discussion on the topic, but sadly it didn't go anywhere. ansible/ansible#77664
We could go the same route as the OP in that issue and have a script that auto generates the defaults from the argument specs.

With that being said, you would discover pretty quickly when they are missing because the role is validated against the argument specs and you will get an error if you supply incorrect parameters to the role.

@gardar
Copy link
Member Author

gardar commented Mar 2, 2023

We can however stop updating the readme and perhaps remove most of it, because docs can be auto generated from the argument specs.

@paulfantom
Copy link
Member

With that being said, you would discover pretty quickly when they are missing because the role is validated against the argument specs and you will get an error if you supply incorrect parameters to the role.

That makes sense. Especially when we have a validation check in CI.

Signed-off-by: gardar <gardar@users.noreply.github.com>
Signed-off-by: gardar <gardar@users.noreply.github.com>
Signed-off-by: gardar <gardar@users.noreply.github.com>
Signed-off-by: gardar <gardar@users.noreply.github.com>
Signed-off-by: gardar <gardar@users.noreply.github.com>
@github-actions github-actions bot added trivial and removed trivial labels Mar 5, 2023
@gardar gardar merged commit b7b8e60 into prometheus-community:main Mar 5, 2023
@towolf
Copy link

towolf commented Mar 6, 2023

@gardar can't use 0.1.4 due to this:
image

@gardar
Copy link
Member Author

gardar commented Mar 6, 2023

Thanks for the heads up @towolf I've pushed a fix here: #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants