Thank you for your interest in contributing to AegisNet! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing
- Documentation
- Pull Request Process
We expect all contributors to:
- Be respectful and inclusive
- Focus on constructive feedback
- Collaborate openly
- Prioritize security and privacy
Before contributing, ensure you have:
- Git
- Docker and Docker Compose
- Your preferred code editor
- (Optional) Terraform, kubectl for infrastructure work
-
Fork the repository
# Fork on GitHub, then clone your fork git clone https://github.com/YOUR_USERNAME/AegisNet.git cd AegisNet
-
Add upstream remote
git remote add upstream https://github.com/cywf/AegisNet.git
-
Set up local environment
./scripts/setup-local.sh # Or make dev -
Install pre-commit hooks (optional but recommended)
pip install pre-commit pre-commit install
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-number-descriptionBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or modifications
- Write clean, maintainable code
- Follow existing code style
- Add comments for complex logic
- Update documentation as needed
# Run validation
make validate
# Test locally
make start
make logs
# Run security scans
make security-scanUse clear, descriptive commit messages:
git add .
git commit -m "feat: add new deployment configuration for AWS"Commit message format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting)refactor:- Code refactoringtest:- Test additions or updateschore:- Maintenance tasks
git fetch upstream
git rebase upstream/main- Use consistent formatting:
terraform fmt - Validate before committing:
terraform validate - Use variables for configurable values
- Add comments for complex logic
- Document modules with README files
Example:
# Good
variable "environment" {
description = "Environment name (dev, staging, prod)"
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Environment must be dev, staging, or prod."
}
}
# Bad
variable "env" {
type = string
}- Use multi-stage builds
- Minimize layer count
- Don't run as root in production
- Add health checks
- Use specific version tags
Example:
# Good
FROM ubuntu:22.04 AS base
RUN apt-get update && apt-get install -y \
package1 \
package2 \
&& rm -rf /var/lib/apt/lists/*
# Bad
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y package1
RUN apt-get install -y package2- Use namespaces for isolation
- Define resource limits
- Add health probes
- Use ConfigMaps and Secrets appropriately
- Include labels for organization
- Use
#!/bin/bashshebang - Enable error handling:
set -e - Add comments for complex operations
- Make scripts executable:
chmod +x - Test with shellcheck
# Start services locally
make start
# Check logs
make logs
# Test specific service
docker-compose logs -f service-name# Validate Terraform
make tf-validate
# Test Kubernetes manifests
kubectl apply --dry-run=client -f infra/kubernetes/# Run security scans
make security-scan
# Check for secrets
git secrets --scanUpdate documentation when you:
- Add new features
- Change existing functionality
- Add new configuration options
- Fix bugs that affect usage
- Improve deployment processes
- Use clear, concise language
- Include code examples
- Add screenshots for UI changes
- Update relevant README files
- Check for broken links
README.md- Project overview and quick startdocs/DEPLOYMENT.md- Deployment instructionsdocs/ARCHITECTURE.md- Architecture documentationinfra/terraform/README.md- Terraform usageinfra/kubernetes/README.md- Kubernetes deployment
- ✅ Ensure all tests pass
- ✅ Update documentation
- ✅ Run linters and formatters
- ✅ Verify security scans pass
- ✅ Rebase on latest main branch
- ✅ Write clear commit messages
-
Push your branch
git push origin feature/your-feature-name
-
Create PR on GitHub
- Go to the repository on GitHub
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
-
PR Title Format
[Type] Brief description Examples: [Feature] Add AWS ECS deployment support [Fix] Resolve Terraform state locking issue [Docs] Update deployment guide for Azure -
PR Description Template
## Description Brief description of changes ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Testing - [ ] Tested locally - [ ] Tests pass - [ ] Documentation updated ## Related Issues Fixes #123
-
Automated Checks: GitHub Actions will run
- Terraform validation
- Docker builds
- Security scans
-
Code Review: Maintainers will review
- Code quality
- Documentation
- Test coverage
- Security implications
-
Address Feedback: Make requested changes
# Make changes git add . git commit -m "Address review feedback" git push origin feature/your-feature-name
-
Approval and Merge: Once approved, maintainers will merge
- Never commit secrets (API keys, passwords, credentials)
- Use
.env.examplefor configuration templates - Report security vulnerabilities privately to maintainers
- Run security scans before submitting PRs
- Consider resource efficiency
- Optimize Docker images
- Use appropriate resource limits in Kubernetes
- Test at scale when possible
- Avoid breaking changes when possible
- Document breaking changes clearly
- Provide migration guides
- Use deprecation warnings
- Questions: Open a GitHub Discussion
- Bugs: Open an Issue
- Security: Contact maintainers directly
Contributors will be recognized in:
- GitHub contributors list
- Release notes
- Project acknowledgments
Thank you for contributing to AegisNet! 🚀