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

x*: adjust docs #9308

Merged
merged 6 commits into from
Dec 23, 2024
Merged

Conversation

russoz
Copy link
Collaborator

@russoz russoz commented Dec 22, 2024

SUMMARY

Adjust documentation blocks.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

plugins/modules/xattr.py
plugins/modules/xbps.py
plugins/modules/xcc_redfish_command.py
plugins/modules/xenserver_facts.py
plugins/modules/xenserver_guest.py
plugins/modules/xenserver_guest_info.py
plugins/modules/xenserver_guest_powerstate.py
plugins/modules/xfconf.py
plugins/modules/xfconf_info.py
plugins/modules/xfs_quota.py
plugins/modules/xml.py

@ansibullbot ansibullbot added docs module module plugins plugin (any type) labels Dec 22, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 branch labels Dec 22, 2024
plugins/modules/xattr.py Show resolved Hide resolved
plugins/modules/xml.py Outdated Show resolved Hide resolved
plugins/modules/xml.py Outdated Show resolved Hide resolved
@bvitnik
Copy link

bvitnik commented Dec 22, 2024

Hi. Is there a discussion regarding these changes? I'd just like to understand the background.

Co-authored-by: Felix Fontein <[email protected]>
@russoz
Copy link
Collaborator Author

russoz commented Dec 22, 2024

Hi @bvitnik , there has been no prior discussion, but the main motivation behind this initiative is the fact that the documentation blocks (including EXAMPLES and RETURN) have inconsistencies across the modules, and no mechanism to fix them.

The main issues (but not limited to) in the YAML docs are:

  • inconsistent indentation within the YAML doc, and between different modules
  • capitalisation and punctuation of descriptions and notes
  • use of markup

As a maintainer of the collection I have been building this tool andebox (published in PyPI) primarily to help running tests, but then a feature of generating the docsite to check how those docs are rendered was added, and the latest addition is exactly one that goes through the module, extract the YAML blocks, manipulates them and write them back.

The library ruamel.yaml is being used to manipulate the YAML content. The result is far from perfect, I have to verify and oft times adjust them, but it beats doing that manually for every single module.

If you (or any maintainer of modules) are not happy with the reformatting, I will gladly roll it back, though perhaps keeping some of the corrections in markup, capitalisation and punctuation.

Hope that clarifies what's going on.

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 22, 2024
@russoz russoz changed the title adjust docs x*: adjust docs Dec 23, 2024
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 23, 2024
Comment on lines +104 to +105
- 'Example:'
- ' folder: /folder1/folder2'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bvitnik I think this would be better suited for the EXAMPLES block below, but I am not too familiar with xenserver to be sure of where/how to place it.

Copy link

Choose a reason for hiding this comment

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

I think it's better to leave it here. It would be hard to spot in the EXAMPLES block. The idea here is to emphasize the format of the value. Not many people know that folders can have arbitrarily deep hierarchy.

Comment on lines +18 to +29
- Minimal supported version of XenServer is 5.6.
- Module was tested with XenServer 6.5, 7.1, 7.2, 7.6, Citrix Hypervisor 8.0, XCP-ng 7.6 and 8.0.
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside Citrix
Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the C(XenAPI.py) file from the SDK to your Python site-packages on your Ansible
Control Node to use it. Latest version of the library can also be acquired from GitHub:
U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py)'
- 'If no scheme is specified in C(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you
are accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To use C(https://) scheme for C(hostname) you have to either import host certificate to your OS certificate store or use O(validate_certs=no) which
requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.'
requirements:
- XenAPI
- XenAPI
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bvitnik also, this block is repeated in all but one of the modules. I would suggest transofrming it into a doc fragment, to make it DRY.

Copy link

@bvitnik bvitnik Dec 23, 2024

Choose a reason for hiding this comment

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

This is a good idea now that I look at it. My initial idea was probably to keep notes specific to the module because there was a plan to implement a slew of other modules that never came into being. Each module was expected to have slightly different notes. Also, the three modules mentioned here were originally a single module and were split into three at later time (copy-paste job). Since there are some updates to be made on the notes anyway, I will consider moving them to doc fragment.

@felixfontein
Copy link
Collaborator

Looks good from my side. @bvitnik do you want to take a closer look as well?

@bvitnik
Copy link

bvitnik commented Dec 23, 2024

@russoz Hi. Sorry for the late response. Thanks for sharing the background, much appreciated. While I don't like the proposed indentation style, if it is for a greater good (global consistency), I will not complain :). You are good to go.

@felixfontein, we are good to go.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Dec 23, 2024
@felixfontein felixfontein merged commit f9bfe4e into ansible-collections:main Dec 23, 2024
129 checks passed
Copy link

patchback bot commented Dec 23, 2024

Backport to stable-9: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply f9bfe4e on top of patchback/backports/stable-9/f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6/pr-9308

Backporting merged PR #9308 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.general.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-9/f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6/pr-9308 upstream/stable-9
  4. Now, cherry-pick PR x*: adjust docs #9308 contents into that branch:
    $ git cherry-pick -x f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6
    If it'll yell at you with something like fatal: Commit f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR x*: adjust docs #9308 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-9/f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6/pr-9308
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

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

Copy link

patchback bot commented Dec 23, 2024

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/f9bfe4e4a6838c7a9a7aedde72be32611fcff7f6/pr-9308

Backported as #9342

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

@felixfontein
Copy link
Collaborator

@russoz thanks for working on this!
@bvitnik thanks for reviewing! :)

patchback bot pushed a commit that referenced this pull request Dec 23, 2024
* adjust docs

* Update plugins/modules/xml.py

Co-authored-by: Felix Fontein <[email protected]>

* fix capitalisation

* add markup to references of the xe command (xenserver)

* add missing markup

* Update plugins/modules/xml.py

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit f9bfe4e)
felixfontein pushed a commit that referenced this pull request Dec 23, 2024
x*: adjust docs (#9308)

* adjust docs

* Update plugins/modules/xml.py

Co-authored-by: Felix Fontein <[email protected]>

* fix capitalisation

* add markup to references of the xe command (xenserver)

* add missing markup

* Update plugins/modules/xml.py

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit f9bfe4e)

Co-authored-by: Alexei Znamensky <[email protected]>
@russoz russoz deleted the xmods-docs branch December 23, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 branch docs has_issue module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants