Contributing to the Strata Cloud Manager Ansible Collection
Thank you for your interest in contributing to the Palo Alto Networks Strata Cloud Manager Ansible Collection. This guide provides information on how to contribute to this project effectively.
Getting Started
Setting Up Your Development Environment
- Fork and Clone the Repository:
- Install Development Dependencies:
- Create a Branch:
Development Workflow
Building and Testing
We provide a comprehensive Makefile with various commands to help you develop, test, and validate your contributions:
# Install dependencies
make setup
# Run linting
make lint
# Format code
make format
# Run tests
make test
# Build documentation
make docs
Code Style and Guidelines
The codebase follows these conventions:
- Python: Follow PEP 8 guidelines with a maximum line length of 100 characters
- Imports: Sort using isort with black profile
- Formatting: Use double quotes for strings and 4 spaces for indentation
- Documentation: Include docstrings with Args and Returns sections for functions
- Error Handling: Use try/except blocks with specific exceptions
Creating New Modules
When adding a new module:
-
Create Module File:
-
Create a new file in
pan_scm_ansible/plugins/modules/
-
Follow the structure of existing modules
-
Documentation:
-
Add DOCUMENTATION, EXAMPLES, and RETURN variables
-
Create a corresponding Markdown file in
docs/collection/modules/
-
Tests:
-
Create test playbooks in the
tests/
directory
Pull Request Process
-
Ensure Code Quality:
-
Run
make lint-format
to ensure your code passes all linting checks -
Run
make test
to validate functionality -
Update Documentation:
-
Ensure module documentation is complete
- Update README.md if necessary
-
If adding new features, update relevant docs
-
Submit Pull Request:
-
Create a PR against the
main
branch - Follow the PR template
-
Provide a clear description of your changes
-
Code Review:
-
Respond to reviewer feedback
- Make requested changes and push updates
Commit Guidelines
We follow the Conventional Commits standard:
feat:
for new featuresfix:
for bug fixesdocs:
for documentation changestest:
for test additions or modificationsrefactor:
for code refactoringchore:
for routine tasks, maintenance, etc.
Example:
feat: add support for address groups
Implement address_group module for managing static and dynamic address groups
in Strata Cloud Manager. Add corresponding documentation and tests.
Reporting Issues
If you find a bug or have a feature request:
- Check if the issue already exists in the GitHub Issues
- If not, create a new issue with:
- Clear description
- Steps to reproduce (for bugs)
- Expected behavior
- Actual behavior
- Version information
Development Best Practices
-
Keep Changes Focused:
-
Each PR should address a single concern
-
Avoid combining unrelated changes
-
Test Coverage:
-
Write tests for new functionality
-
Ensure existing tests pass
-
Documentation:
-
Update documentation to reflect changes
-
Include examples for new features
-
Backward Compatibility:
-
Maintain backward compatibility when possible
- Document breaking changes clearly
Thank you for contributing to the Strata Cloud Manager Ansible Collection!