First off, thank you for considering contributing to code3tech.devtools! It's people like you that make this collection better for everyone.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Style Guidelines
- Testing
- Documentation
- Community
This project and everyone participating in it is governed by respect and professionalism. By participating, you are expected to uphold this standard. Please be respectful and constructive in your interactions.
Before creating bug reports, please check the existing issues to avoid duplicates.
When you create a bug report, please include as many details as possible:
Use the following template:
**Description:**
A clear and concise description of the bug.
**To Reproduce:**
Steps to reproduce the behavior:
1. Run command '...'
2. With these variables '...'
3. See error
**Expected behavior:**
What you expected to happen.
**Environment:**
- OS: [e.g. Ubuntu 22.04]
- Ansible Version: [e.g. 2.15.0]
- Collection Version: [e.g. 1.0.0]
- Python Version: [e.g. 3.11]
**Additional context:**
Add any other context about the problem here (logs, screenshots, etc.).Enhancement suggestions are tracked as GitHub issues.
When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful to most users
- List any alternative solutions you've considered
- Fork the repository and create your branch from
main - Make your changes following our style guidelines
- Add tests for your changes
- Ensure all tests pass (
make test) - Ensure linting passes (
make lint) - Update documentation if needed
- Commit your changes using conventional commits
- Push to your fork and submit a pull request
Pull Request Template:
**Description:**
Brief description of what this PR does.
**Related Issue:**
Fixes #(issue number)
**Type of Change:**
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
**Checklist:**
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
**Testing:**
Describe the tests you ran and their results.- Python 3.11+
- Git
- asdf (recommended for version management)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/ansible-devtools.git
cd ansible-devtools
# Add upstream remote
git remote add upstream https://github.com/kode3tech/ansible-col-devtools.git
# Install dependencies
make install
# Activate virtual environment
source .venv/bin/activate
# Verify installation
make version# Fetch upstream changes
git fetch upstream
# Merge upstream main into your local main
git checkout main
git merge upstream/main
# Push updates to your fork
git push origin mainWe follow Conventional Commits specification:
Format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Code style changes (formatting, missing semi-colons, etc)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks
Examples:
feat(docker): add support for Ubuntu 24.04
Added support for Ubuntu 24.04 LTS including repository
configuration and package installation.
Closes #123
fix(podman): correct storage driver detection on Debian
The storage driver was incorrectly detected on Debian systems
due to missing overlay module check.
Fixes #456We follow Ansible best practices and use ansible-lint to enforce standards:
Key Guidelines:
-
Use Fully Qualified Collection Names (FQCN):
# Good - ansible.builtin.package: name: docker-ce # Bad - package: name: docker-ce
-
Naming Conventions:
- Use descriptive task names
- Use snake_case for variables
- Use clear, meaningful names
-
YAML Formatting:
- Use 2 spaces for indentation
- Quote strings when necessary
- Keep lines under 160 characters (preferred 120)
-
Tasks:
- Add
changed_whenfor command/shell tasks - Use
failed_wheninstead ofignore_errors - Add tags for role organization
- Add
-
Variables:
- Prefix role variables with role name
- Document all variables in
defaults/main.yml - Use
vars/for constants
Example Task:
- name: Install Docker packages
ansible.builtin.package:
name: "{{ docker_packages }}"
state: present
tags:
- docker
- packagesWe use yamllint with the following configuration:
- Indentation: 2 spaces
- Line length: 160 characters max
- No trailing spaces
- Document start optional
Run linting:
make lint-yamlWe use ansible-lint with production profile:
make lint-ansibleAll changes must include tests and all tests must pass before merging.
# Test all roles
make test
# Run linting
make lint-
Molecule Tests - Located in
roles/*/molecule/default/molecule.yml- Test configurationconverge.yml- Apply the roleverify.yml- Ansible-based verificationtest_default.py- Pytest/testinfra tests
-
Test Structure:
def test_package_installed(host): """Verify package is installed.""" pkg = host.package("docker-ce") assert pkg.is_installed
-
Test Coverage:
- Package installation
- Service status
- Configuration files
- Permissions
- Functionality tests
We test on:
- Ubuntu 22.04 (Jammy)
- Debian 12 (Bookworm)
- Rocky Linux 9
-
Code Comments:
- Complex logic
- Non-obvious decisions
- Platform-specific workarounds
-
README Updates:
- New features
- Changed behavior
- New variables
- Usage examples
-
Role Documentation:
- Update
roles/*/README.md - Document all variables
- Provide usage examples
- List supported platforms
- Update
-
CHANGELOG:
- Add entry for your changes
- Follow Keep a Changelog format
- Group changes by type (Added, Changed, Fixed, etc.)
- Use clear, concise language
- Provide examples
- Use proper Markdown formatting
- Include code blocks with syntax highlighting
Example:
### New Variable
The `docker_custom_registry` variable allows configuring custom registries:
```yaml
docker_custom_registry:
- "registry.example.com"
- "docker.internal.net"
```
Default: `[]` (empty list)-
Automated Checks:
- Linting (ansible-lint, yamllint)
- Tests (Molecule, pytest)
- CI/CD pipeline
-
Code Review:
- At least one maintainer approval required
- Constructive feedback provided
- Response time: typically 2-3 business days
-
Merge:
- Squash and merge preferred
- Conventional commit message required
- Branch deleted after merge
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: suporte@kode3.tech
Contributors will be recognized in:
- README.md acknowledgments section
- Git commit history
- Release notes
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to code3tech.devtools! 🚀
Made with ❤️ by Code3Tech DevOps Team