Skip to content

Fix ansible-doc rendering for all in-house plugins + guard (re-targeted to main)#267

Merged
markuslf merged 1 commit into
mainfrom
fix/plugin-doc-rendering-main
May 25, 2026
Merged

Fix ansible-doc rendering for all in-house plugins + guard (re-targeted to main)#267
markuslf merged 1 commit into
mainfrom
fix/plugin-doc-rendering-main

Conversation

@markuslf
Copy link
Copy Markdown
Member

Re-targets PR #266 to main. #266 was accidentally based on the refactor/plugins-bitwarden feature branch and merged there instead of into main, so its changes never reached main. This re-applies the same commit on top of current main.

The bug

In a description list, a bullet with a colon followed by a space is parsed by YAML as a mapping, so ansible-doc aborts with expected str instance, AnsibleMapping found. Fixed in:

  • nextcloud_occ_app_config, nextcloud_occ_system_config (top-level description)
  • uptimerobot_monitor (the alert_contacts and mwindows option docs)
  • uptimerobot_psp (the monitors option doc)

The guard

tests/unit/test_plugin_docs.py parses every in-house plugin's DOCUMENTATION/RETURN and asserts each description is a string or list of strings, so this class of error fails at unit-test time. Vendored plugins (ipa*, lvm_pv) are out of scope.

Validation

  • ansible-doc renders every in-house filter/lookup/module; only the 8 vendored ipa* modules still fail (their ansible-freeipa doc_fragment is not installed, unrelated).
  • tox green (36 tests).

A description bullet containing a colon followed by a space is parsed
by YAML as a mapping, which makes ansible-doc abort with
'expected str instance, AnsibleMapping found'. Rephrase the offending
bullets in the nextcloud_occ_app_config / nextcloud_occ_system_config
modules and the alert_contacts / mwindows / monitors option docs of the
uptimerobot_monitor / uptimerobot_psp modules.

Add tests/unit/test_plugin_docs.py, which parses every in-house plugin's
DOCUMENTATION/RETURN and asserts each description is a string or list of
strings, so this class of error fails at unit-test time instead of only
at render time. Vendored plugins are out of scope (the ipa* modules also
fail ansible-doc, but because their ansible-freeipa doc_fragment is not
installed, which is unrelated).
@markuslf markuslf requested a review from NavidSassan May 25, 2026 07:39
@markuslf markuslf merged commit a1eb662 into main May 25, 2026
10 checks passed
@markuslf markuslf deleted the fix/plugin-doc-rendering-main branch May 25, 2026 08:08
ebuerki-lf pushed a commit that referenced this pull request May 26, 2026
#267)

A description bullet containing a colon followed by a space is parsed
by YAML as a mapping, which makes ansible-doc abort with
'expected str instance, AnsibleMapping found'. Rephrase the offending
bullets in the nextcloud_occ_app_config / nextcloud_occ_system_config
modules and the alert_contacts / mwindows / monitors option docs of the
uptimerobot_monitor / uptimerobot_psp modules.

Add tests/unit/test_plugin_docs.py, which parses every in-house plugin's
DOCUMENTATION/RETURN and asserts each description is a string or list of
strings, so this class of error fails at unit-test time instead of only
at render time. Vendored plugins are out of scope (the ipa* modules also
fail ansible-doc, but because their ansible-freeipa doc_fragment is not
installed, which is unrelated).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant