Contributing to ProbatioVault Infrastructure¶
Thank you for your interest in contributing to the ProbatioVault infrastructure project! This document provides guidelines and instructions for contributing.
Table of Contents¶
- Code of Conduct
- Getting Started
- Development Workflow
- Contribution Guidelines
- Testing
- Documentation
- Commit Messages
- Pull Request Process
Code of Conduct¶
Our Pledge¶
We are committed to providing a welcoming and inclusive environment for all contributors, regardless of experience level, background, or identity.
Our Standards¶
- Be respectful and considerate in all interactions
- Be collaborative and open to constructive feedback
- Be professional and focus on technical merits
- Be patient with new contributors learning the codebase
Unacceptable Behavior¶
- Harassment, discrimination, or offensive comments
- Personal attacks or trolling
- Publishing private information without consent
- Any conduct that would be inappropriate in a professional setting
Getting Started¶
Prerequisites¶
Before contributing, ensure you have:
- Development tools installed:
# Terraform
brew install terraform # macOS
# Ansible
brew install ansible # macOS
# Git
brew install git
- Access to development environment:
- SSH access to a test VPS (not production)
- GitLab account with access to the repository
-
Basic understanding of Infrastructure as Code principles
-
Read the documentation:
- README.md - Project overview
- Architecture - Architecture details
- Deployment Quickstart - Setup guide
Setting Up Your Development Environment¶
- Fork and clone the repository:
- Create a feature branch:
- Verify Terraform configuration:
- Verify Ansible syntax:
Development Workflow¶
Branch Naming Convention¶
Use descriptive branch names:
feature/add-monitoring- New featuresfix/postgresql-backup- Bug fixesdocs/update-quickstart- Documentation updatesrefactor/ansible-roles- Code refactoringtest/gitlab-runner- Testing improvements
Making Changes¶
- Terraform changes:
- Update
.tffiles interraform/ - Run
terraform fmtto format code - Run
terraform validateto check syntax -
Update relevant
.tfvarsexamples -
Ansible changes:
- Update roles in
ansible/roles/ - Use YAML best practices (2-space indentation)
- Run
ansible-lintif available -
Test on a non-production VPS
-
Documentation changes:
- Update relevant
.mdfiles - Ensure markdown is properly formatted
- Include examples where appropriate
Code Style Guidelines¶
Terraform¶
# Use consistent naming
variable "vps_name" {
description = "Clear description of the variable"
type = string
default = "sensible-default"
}
# Group related resources
resource "null_resource" "vps_reference" {
# Use comments to explain non-obvious logic
triggers = {
vps_name = var.vps_name
}
}
Ansible¶
---
# Use descriptive task names
- name: Install PostgreSQL server
apt:
name: postgresql
state: present
update_cache: yes
# Use variables for flexibility
- name: Configure PostgreSQL
template:
src: postgresql.conf.j2
dest: "/etc/postgresql/{{ postgresql_version }}/main/postgresql.conf"
notify: restart postgresql
Documentation¶
- Use clear, concise language
- Include code examples
- Add command outputs where helpful
- Use proper markdown formatting
- Keep line length reasonable (80-120 chars)
Contribution Guidelines¶
What to Contribute¶
We welcome contributions in these areas:
- Bug fixes - Fix issues in existing code
- New features - Add new Ansible roles, Terraform modules
- Documentation - Improve or add documentation
- Testing - Add tests, improve CI/CD
- Performance - Optimize existing code
- Security - Enhance security measures
What NOT to Contribute (Without Discussion)¶
- Major architectural changes
- Breaking changes to existing APIs
- Removal of existing features
- Changes to core security policies
For major changes, please open an issue first to discuss the proposal.
Testing¶
Testing Terraform Changes¶
cd terraform
# Initialize
terraform init
# Validate syntax
terraform validate
# Format code
terraform fmt -recursive
# Plan (dry-run)
terraform plan -var-file="environments/dev.tfvars"
# Apply on test environment ONLY
terraform apply -var-file="environments/test.tfvars"
Testing Ansible Changes¶
cd ansible
# Syntax check
ansible-playbook playbook.yml --syntax-check
# Dry run (check mode)
ansible-playbook -i inventory/dev/hosts.ini playbook.yml --check
# Run on test VPS
ansible-playbook -i inventory/test/hosts.ini playbook.yml
# Run specific role
ansible-playbook -i inventory/test/hosts.ini playbook.yml --tags postgresql
Testing Checklist¶
Before submitting a PR, verify:
- Terraform code is formatted (
terraform fmt) - Terraform validation passes (
terraform validate) - Ansible syntax is valid (
--syntax-check) - Changes tested on non-production environment
- Documentation updated if needed
- No secrets or sensitive data in code
- Commit messages follow conventions
Documentation¶
When to Update Documentation¶
Update documentation when you:
- Add a new feature or role
- Change existing behavior
- Fix a bug that affects usage
- Improve processes or workflows
Documentation Standards¶
- Markdown formatting:
- Use
#headers hierarchically - Use code blocks with language tags
-
Include examples for complex concepts
-
Structure:
- Start with overview/purpose
- Include prerequisites
- Provide step-by-step instructions
-
Add troubleshooting section if relevant
-
Examples:
- Include working code examples
- Show both input and expected output
- Explain non-obvious parts
Commit Messages¶
Format¶
Use conventional commit format:
Types¶
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples¶
# Good commit messages
git commit -m "feat(ansible): add monitoring role with Prometheus"
git commit -m "fix(terraform): correct PostgreSQL variable interpolation"
git commit -m "docs(readme): update installation instructions"
# Bad commit messages (avoid these)
git commit -m "fix stuff"
git commit -m "WIP"
git commit -m "changes"
Commit Message Guidelines¶
- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- Keep subject line under 50 characters
- Separate subject from body with blank line
- Wrap body at 72 characters
- Reference issues/PRs in footer if applicable
Pull Request Process¶
1. Before Creating a PR¶
- Ensure your branch is up to date with
main - All tests pass
- Code follows style guidelines
- Documentation is updated
- Commits are clean and descriptive
2. Creating a PR¶
- Push your branch:
- Create PR on GitLab:
- Go to the repository on GitLab
- Click "Create merge request"
-
Fill in the template (see below)
-
PR Title Format:
[Type] Brief description (max 50 chars)
Examples:
[Feature] Add Redis caching support
[Fix] Correct PostgreSQL backup script
[Docs] Update quick start guide
3. PR Description Template¶
## Description
Brief description of what this PR does.
## Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change (fix or feature that causes existing functionality to change)
- [ ] Documentation update
## Changes Made
- Bullet list of specific changes
- Include files/modules affected
## Testing
- [ ] Tested on dev environment
- [ ] Tested on test environment
- [ ] Terraform plan succeeded
- [ ] Ansible playbook ran successfully
## Documentation
- [ ] Updated relevant documentation
- [ ] Added inline code comments where necessary
## Related Issues
Closes #123, Related to #456
## Screenshots (if applicable)
Include screenshots for UI changes or visual documentation updates.
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] No sensitive data committed
- [ ] Documentation updated
4. PR Review Process¶
- Automated checks: CI/CD pipeline will run
- Code review: At least one maintainer will review
- Feedback: Address review comments
- Approval: Maintainer approves the PR
- Merge: Maintainer merges the PR
5. After PR is Merged¶
- Delete your feature branch
- Update your local repository
- Close related issues if applicable
Code Review Guidelines¶
For Contributors¶
When your PR is under review:
- Be responsive to feedback
- Be open to suggestions and improvements
- Ask questions if feedback is unclear
- Be patient - reviews take time
For Reviewers¶
When reviewing PRs:
- Be constructive and respectful
- Explain why when requesting changes
- Acknowledge good work and improvements
- Test the changes if possible
- Provide specific feedback with examples
Security Issues¶
Reporting Security Vulnerabilities¶
DO NOT open public issues for security vulnerabilities.
Instead:
- Email security concerns to: security@probatiovault.com
- Include detailed description and steps to reproduce
- Allow reasonable time for fix before public disclosure
Security Best Practices¶
When contributing:
- Never commit secrets, passwords, or API keys
- Use
.gitignoreto exclude sensitive files - Use GitLab CI/CD variables for secrets
- Review changes before pushing
- Enable 2FA on your GitLab account
Getting Help¶
Resources¶
- Documentation: Check
docs/folder and main.mdfiles - Issues: Search existing issues on GitLab
- Discussions: Use GitLab discussions for questions
- Chat: [If applicable] Join our Slack/Discord channel
Asking Questions¶
When asking for help:
- Search existing issues/docs first
- Provide context and relevant details
- Include error messages and logs
- Mention what you've already tried
- Use code blocks for code/logs
Recognition¶
Contributors will be recognized in:
- Project README.md (Contributors section)
- Release notes for significant contributions
- GitLab contributors page
License¶
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).
Questions?¶
If you have questions about contributing, feel free to:
- Open an issue labeled
question - Reach out to maintainers
- Check existing documentation
Thank you for contributing to ProbatioVault Infrastructure! 🚀