Contributing
Thank you for your interest in contributing to arillso projects! This guide provides standards, guidelines, and best practices for all arillso repositories.
General Guidelines
Code of Conduct
All arillso projects adhere to a Code of Conduct. By participating, you are expected to uphold this code. Be respectful, constructive, and inclusive in all interactions.
Prerequisites
For Ansible Collections:
Ansible >= 2.15
Python >= 3.9
Git
GitHub account
For Go Projects:
Go >= 1.25
Git
GitHub account
For Container Projects:
Docker with BuildKit
Make (optional)
Types of Contributions
We welcome various types of contributions:
Bug Reports - Found a bug? Let us know!
Feature Requests - Have an idea for improvement?
Documentation - Improvements to docs are always appreciated
Code Contributions - Bug fixes, new features, or improvements
Testing - Platform testing and validation
Ansible Collection Standards
File Organization
Each role must follow the standard structure defined in Repository Standards.
Required structure:
roles/ROLE_NAME/
├── defaults/
│ └── main.yml # User-configurable variables
├── handlers/
│ └── main.yml # Service restart handlers
├── meta/
│ ├── main.yml # Role metadata
│ └── argument_specs.yml # REQUIRED: Variable specs
├── tasks/
│ ├── main.yml # Main entry point
│ ├── install.yml # Installation tasks
│ ├── configure.yml # Configuration tasks
│ └── service.yml # Service management
├── templates/
│ └── ... # Jinja2 templates
├── vars/
│ ├── main.yml # Internal variables
│ ├── Debian.yml # Debian-specific vars
│ └── RedHat.yml # RedHat-specific vars
└── README.md # Role documentation
Code Style
Good Example:
- name: Install Grafana Alloy package
ansible.builtin.package:
name: "{{ alloy_package_name }}"
state: "{{ alloy_package_state }}"
register: alloy_install_result
when: alloy_enabled | bool
Bad Example:
- name: install pkg
package: name={{pkg}} state=present
when: enabled
Best Practices
Use FQCN (Fully Qualified Collection Names):
# Good - name: Create directory ansible.builtin.file: path: /etc/app state: directory # Bad - name: Create directory file: path: /etc/app state: directory
Proper YAML Indentation:
Use 4 spaces for indentation (not tabs)
Be consistent throughout the file
Meaningful Variable Names:
Prefix with role name:
alloy_*,docker_*,k3s_*Use descriptive names:
alloy_prometheus_enablednotalloy_promBooleans: Use
*_enabled,*_required, etc.Lists: Use plural names
alloy_custom_exportersDicts: Use singular names
alloy_node_exporter_config
Task Organization:
Separate tasks by function (install, configure, service)
Use
include_tasksfor modularityKeep main.yml as entry point only
Variable Documentation
All variables MUST be documented in three places:
1. defaults/main.yml - With inline comments:
# Enable Prometheus metrics collection
alloy_prometheus_enabled: false
# Prometheus remote write endpoint
alloy_prometheus_remote_write_url: ""
2. meta/argument_specs.yml - With full specifications (REQUIRED):
argument_specs:
main:
short_description: Grafana Alloy configuration
options:
alloy_prometheus_enabled:
type: bool
required: false
default: false
description: Enable Prometheus metrics collection
3. README.md - With usage examples:
### Prometheus Configuration
```yaml
alloy_prometheus_enabled: true
alloy_prometheus_remote_write_url: "https://prometheus.example.com/api/v1/write"
```
Warning
Roles without argument_specs.yml will be rejected!
Testing Requirements
Before Submitting:
Lint your code:
ansible-lint roles/ROLE_NAME/ yamllint roles/ROLE_NAME/
Test on supported platforms:
Minimum: Test on one major platform
Ideal: Test on Ubuntu, Debian, and RHEL
Verify collection builds:
ansible-galaxy collection build --force ansible-galaxy collection install arillso-COLLECTION-*.tar.gz --force
Test with minimal playbook:
--- - name: Test role hosts: localhost become: true roles: - role: arillso.COLLECTION.ROLE_NAME
Verify idempotency:
Running twice should not change anything
Check
changedstatus
Release Process
Important
ALWAYS update CHANGELOG.md before releasing!
Release Checklist:
Update CHANGELOG.md (REQUIRED)
Move items from
[Unreleased]to new version sectionFollow Keep a Changelog format (see Repository Standards)
Categories: Added, Changed, Fixed, Deprecated, Removed, Security
Update galaxy.yml version
version: "1.0.1"
Create and push git tag
Use version without ‘v’ prefix per Repository Standards (e.g.,
1.0.1notv1.0.1)
git tag 1.0.1 git push origin 1.0.1
Automated workflows trigger
publish.ymlpublishes to Ansible Galaxy (see CI/CD & Linting for workflow details)Creates GitHub Release with CHANGELOG notes
Go Project Standards
Code Style
Follow standard Go conventions (
gofmt,golangci-lint)Use
context.Contextfor operationsError handling with
github.com/pkg/errorsfor wrapped errorsStruct-based configuration with defaults
Testing
# Run all tests
go test -v ./...
# With coverage
go test -cover ./...
# Specific test
go test -run TestPlaybook_Exec ./...
Documentation
All public functions must have doc comments
Include usage examples in package docs
Keep README.md up-to-date
Docker/Container Standards
Dockerfile Best Practices
Multi-stage builds for smaller images
Non-root user for security
Version ranges for Alpine packages:
# Good - allows security patches RUN apk add --no-cache \ python3>=3.11.0 \ python3<4.0.0
Multi-platform support (amd64, arm64)
Testing
make ansible-build # Build container
make test-quick # Quick validation
make comprehensive-test # Full test suite
make release-check # Pre-release validation
GitHub Actions Standards
Action Development
Use semantic inputs - Clear, descriptive parameter names
Provide examples - Include usage examples in README
Handle errors gracefully - Validate inputs and provide clear errors
Security first - Use GitHub Secrets for sensitive data
Action.yml Structure
name: 'Action Name'
description: 'Clear description'
inputs:
input_name:
description: 'Detailed description'
required: false
default: 'value'
runs:
using: 'docker'
image: 'Dockerfile'
Commit Guidelines
Commit Message Format
Add feature description
- Detailed point 1
- Detailed point 2
- Detailed point 3
Fixes #123
Format:
First line: Brief summary (50 chars or less)
Blank line
Detailed description with bullet points
Reference related issues
Examples:
feat: add Faro configuration to Alloy role
- Add alloy_enable_faro variable
- Add Faro receiver template
- Update README with examples
Fixes #123
fix: correct SSH key normalization
- Handle missing trailing newlines
- Support all PEM formats
- Add validation tests
Closes #456
Pull Request Process
1. Prepare Your Changes
# Update from upstream
git fetch upstream
git rebase upstream/main
# Run tests
ansible-lint roles/ROLE_NAME/ # For Ansible
go test ./... # For Go
2. Create Pull Request
Fill out all sections of PR template
Link related issues
Mark as draft if work in progress
Provide test results
3. PR Review Process
Maintainer review
Address feedback
Ensure CI checks pass
Require maintainer approval
Maintainer merges when ready
4. After Merge
# Delete feature branch
git branch -d feature/your-feature
# Update fork
git checkout main
git pull upstream main
git push origin main
Documentation Standards
README Structure
Every project README should contain:
Title and badges
Description - What it does
Features - Key capabilities
Installation - How to install
Quick Start - Minimal example
Configuration - Available options
Examples - Real-world usage
License - MIT with copyright
Contributing - Link to guide
Inline Documentation
Ansible: Comment complex logic and non-obvious decisions
Go: Doc comments on all exported functions
Docker: Comment multi-stage builds and custom logic
Version Compatibility
See Version Compatibility for complete version requirements, platform support, and upgrade guides.
CI/CD Workflows
All repositories must have standardized CI/CD workflows.
See CI/CD & Linting for complete workflow implementations, linter configurations, and automation standards.
Security Guidelines
Secrets Management
Never commit secrets to repositories
Use GitHub Secrets for CI/CD
Use Vault or secret managers in production
Rotate credentials regularly
Dependency Management
Keep dependencies up-to-date
Use Renovate for automated updates
Review security advisories
Pin major versions, allow patches
Code Security
Validate all inputs
Sanitize user data
Use parameterized queries
Avoid command injection
Follow OWASP guidelines
Getting Help
If you have questions:
Check existing documentation
Search closed issues
Open a discussion on GitHub
Tag maintainers if needed
Community
Be respectful and constructive
Provide context in issues and PRs
Be patient - maintainers are volunteers
Celebrate contributions - recognize others’ work
Questions?
Open a discussion on GitHub or check project-specific CONTRIBUTING.md files:
See also
Repository Standards - Repository standards and conventions
CI/CD & Linting - CI/CD workflows and automation
Version Compatibility - Version compatibility and requirements
Collection Index - Ansible Collections
Container Index - Container Images
Libraries Index - Go Libraries
—
Thank you for contributing to arillso!
Your contributions help make these projects better for everyone.