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

consolidate argument specs and doc fragments #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikemorency
Copy link
Collaborator

@mikemorency mikemorency commented Dec 11, 2024

SUMMARY

Combining #86 and #87

This removes instances of repeated option documentation and redundant spec args.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

doc fragments
argument specs

ADDITIONAL INFORMATION

While I was working on this, I found the kubernetes collection has a pretty nice pattern for breaking out the doc fragments. I tried to copy theirs, https://github.com/ansible-collections/kubernetes.core/tree/main/plugins/doc_fragments
Similar pattern for the arg specs too https://github.com/ansible-collections/kubernetes.core/blob/main/plugins/module_utils/args_common.py

@mikemorency mikemorency force-pushed the feature/consolidate-arg-specs-and-docs branch from 9d32d91 to 6a60822 Compare December 11, 2024 02:06
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.03%. Comparing base (94ea806) to head (8b142d4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   27.48%   28.03%   +0.54%     
==========================================
  Files          24       25       +1     
  Lines        2059     2076      +17     
  Branches      385      385              
==========================================
+ Hits          566      582      +16     
- Misses       1493     1494       +1     
Flag Coverage Δ
sanity 28.03% <100.00%> (+0.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

proxy_protocol:
description:
- The proxy connection protocol to use.
- This is option is used if the correct proxy protocol cannot be automatically determined.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- This is option is used if the correct proxy protocol cannot be automatically determined.
- This option is used if the correct proxy protocol cannot be automatically determined.

# This vmware.vmware.base_options fragment covers the arg spec provided by the base_argument_spec() function
DOCUMENTATION = r'''
notes:
- All modules require API write access and hence is not supported on a free ESXi license.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- All modules require API write access and hence is not supported on a free ESXi license.
- All modules require API write access and hence are not supported on a free ESXi license.

default: 443
proxy_host:
description:
- Address of a proxy that will receive all HTTPS requests and relay them.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Address of a proxy that will receive all HTTPS requests and relay them.
- The address of a proxy that will receive all HTTPS requests and relay them.

required: false
proxy_port:
description:
- Port of the HTTP proxy that will receive all HTTPS requests and relay them.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Port of the HTTP proxy that will receive all HTTPS requests and relay them.
- The port of the HTTP proxy that will receive all HTTPS requests and relay them.

"""
This returns a dictionary that can be used as the baseline for all REST module specs.
If your module uses the REST API, you should use this instead of the base_argument_spec.
If your module uses both this and the pyvmomi SDK, you should still use this spec.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
If your module uses both this and the pyvmomi SDK, you should still use this spec.
If your module uses both this spec and the pyvmomi SDK, you should still use this spec.


def base_argument_spec():
"""
This returns a dictionary that can be used as the baseline for all vmware module specs. Any arguments
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
This returns a dictionary that can be used as the baseline for all vmware module specs. Any arguments
This returns a dictionary that can be used as the baseline for all VMware module specs. Any arguments

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.

2 participants