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

ansible-doc: export has_action when --json is used #72359

Merged
merged 4 commits into from
Oct 30, 2020

Conversation

felixfontein
Copy link
Contributor

SUMMARY

Improve feature parity between ansible-doc and ansible-doc --json. Needed to include this information in the docs build.

ISSUE TYPE
  • Docs Pull Request
  • Feature Pull Request
COMPONENT NAME

ansible-doc

felixfontein added a commit to felixfontein/antsibull that referenced this pull request Oct 27, 2020
felixfontein added a commit to felixfontein/antsibull that referenced this pull request Oct 27, 2020
@acozine
Copy link
Contributor

acozine commented Oct 27, 2020

This would help users who needed the details of action plugins when they need them. Thanks @felixfontein.

@ansibot ansibot added affects_2.11 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 27, 2020
@abadger
Copy link
Contributor

abadger commented Oct 27, 2020

Looks good! +1

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 27, 2020
@felixfontein
Copy link
Contributor Author

Corresponding antsibull change: ansible-community/antsibull#206

@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Oct 29, 2020
else:
doc['action'] = False

doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
Copy link
Member

Choose a reason for hiding this comment

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

why are you removing these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean now_date and docuri? Because they are not used at all. In this code-path, they are only passed to get_snippet_text and get_man_text:

  1. get_snippet_text uses only short_description, module and options.
  2. get_man_text explicitly ignores them as they are in DocCLI.IGNORE.

(Besides that, what the code does with docuri is strange and will probably fail if that key is ever encountered, since doc[plugin_type] usually results in a KeyError nowadays.)

@bcoca bcoca merged commit 4fb336c into ansible:devel Oct 30, 2020
@felixfontein felixfontein deleted the ansible-doc-has_action branch October 30, 2020 14:58
@felixfontein
Copy link
Contributor Author

@bcoca @abadger thanks for reviewing and merging!

felixfontein added a commit to felixfontein/ansible that referenced this pull request Oct 30, 2020
* ansible-doc: export has_action when --json is used.
* Remove docuri and now_data, which were not used resp. ignored in format_plugin_doc and the functions it calls anyway.
* Add function _combine_plugin_doc.

(cherry picked from commit 4fb336c)
felixfontein added a commit to felixfontein/ansible that referenced this pull request Oct 30, 2020
* ansible-doc: export has_action when --json is used.
* Remove docuri and now_data, which were not used resp. ignored in format_plugin_doc and the functions it calls anyway.
* Add function _combine_plugin_doc.

(cherry picked from commit 4fb336c)
felixfontein added a commit to felixfontein/antsibull that referenced this pull request Nov 2, 2020
felixfontein added a commit to felixfontein/antsibull that referenced this pull request Nov 2, 2020
felixfontein added a commit to felixfontein/antsibull that referenced this pull request Nov 2, 2020
abadger pushed a commit to ansible-community/antsibull that referenced this pull request Nov 3, 2020
* Add new doc parsing backend script which more efficiently dumps all necessary data about collections and plugin docs.
* Use new script instead of ansible-doc.
* Make sure that proper JSON serialization is used.
* Make doc parsing backend configurable.
* Improve filtering.
* Equivalent to ansible/ansible#72359.
* Change default backend to ansible-internal.
@ansible ansible locked and limited conversation to collaborators Nov 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.11 docs This issue/PR relates to or includes documentation. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants