Development Guide
This document provides guidelines for contributing to the Fawkes Internal Developer Platform (IDP). It includes instructions for setting up a local development environment, coding standards, and best practices for contributing to the project.
Table of Contents
- Setting Up Your Development Environment
- Coding Standards
- Branching and Workflow
- Testing
- Azure Development Best Practices
- Submitting Contributions
Setting Up Your Development Environment
Prerequisites
Ensure you have the following tools installed:
- Git: Version control system
- Docker: For containerized development
- Terraform: For infrastructure provisioning
- kubectl: For managing Kubernetes clusters
- Helm: For managing Kubernetes applications
- Azure CLI (if working with Azure):
Install using:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Steps to Set Up
- Clone the Repository:
git clone https://github.com/paruff/fawkes.git
cd fawkes
- Set Up Environment Variables:
Copy the
.env.examplefile to.envand update the values:
cp .env.example .env
- Provision Infrastructure:
Use the scripts in the
infra/directory to provision the required infrastructure:
cd infra
./scripts/ignite.sh --provider aws dev
- Deploy Platform Services:
Navigate to the
platform/directory and deploy services:
cd platform
./deploy-services.sh
- Run Tests:
Execute the test suite to validate your setup:
cd qa ./run-tests.sh
Coding Standards
Fawkes enforces comprehensive code quality standards for all languages. All code must pass automated linting before merge.
Quick Start
# Install pre-commit hooks (one-time setup)
make pre-commit-setup
# Run all linters on your changes
make lint
# Run specific linter
pre-commit run shellcheck --all-files
Language-Specific Linters
- Bash: ShellCheck - Shell script linting
- Python: Black (formatter) + Flake8 (linter)
- Go: golangci-lint - Comprehensive Go linting
- YAML: yamllint - YAML syntax and style
- JSON: check-json - JSON validation
- Markdown: markdownlint - Documentation linting
- Terraform: terraform fmt, TFLint, tfsec - IaC linting and security
IDE Integration
Configure your IDE for automatic linting:
VS Code: Install recommended extensions
make setup-vscode
Other IDEs: See Code Quality Standards
Detailed Documentation
For comprehensive coding standards, linting rules, and troubleshooting:
This includes:
- Language-specific style guides
- Security scanning requirements
- IDE integration guides
- Common issues and solutions
Branching and Workflow
Fawkes uses a fork → feature branch → PR against main model.
Step-by-Step Git Workflow
-
Fork the repository on GitHub (click "Fork" on the fawkes repo):
-
Clone your fork and add the upstream remote:
git clone https://github.com/<your-username>/fawkes.git
cd fawkes
git remote add upstream https://github.com/paruff/fawkes.git
- Create a Feature Branch from the latest
main:
git fetch upstream
git checkout -b feature/<feature-name> upstream/main
- Make changes and commit using Conventional Commits:
git commit -m "feat(scope): short description of the change"
Commit prefixes: feat, fix, docs, test, chore.
- Push your branch to your fork:
git push origin feature/<feature-name>
- Open a Pull Request against
mainon the upstream repository: - Fill in the PR template fully.
- Reference the issue with
Closes #NNN. -
Keep the PR small (< 400 lines); CI enforces this limit.
-
Address review feedback by pushing additional commits to the same branch.
-
Merge — a maintainer merges once all status checks pass and approval is given.
Never push directly to
main. Branch protection requires all changes to go through a pull request with at least one maintainer approval (two approvals for changes ininfra/) and passing CI checks.
Testing
Fawkes includes multiple layers of testing:
- Static Analysis: Run tools like SonarQube or Trivy to check for vulnerabilities.
- Unit Tests: Located in the
qa/unit/directory. - Integration Tests: Located in the
qa/integration/directory. - Acceptance Tests: Located in the
qa/acceptance/directory. - Performance Tests: Located in the
qa/performance/directory.
Run all tests before submitting a PR:
cd qa
./run-all-tests.sh
Azure Development Best Practices
If you are working with Azure, follow these best practices:
- Use Azure CLI for Authentication:
az login
- Set the Active Subscription:
az account set --subscription <subscription-id>
-
Follow Azure Resource Naming Conventions: Use consistent and descriptive names for resources.
-
Use Infrastructure as Code (IaC): Use Terraform or Bicep for provisioning Azure resources.
-
Enable Logging and Monitoring: Configure Azure Monitor and Log Analytics for all deployed resources.
-
Secure Secrets: Store secrets in Azure Key Vault and reference them in your deployments.
Submitting Contributions
-
Fork the Repository: Create a fork of the repository on GitHub and clone it locally.
-
Branch from
main: Always create a feature branch from the latestmain(see Branching and Workflow above). -
Make Changes: Work on your feature branch and ensure all tests pass.
-
Run Linters:
make lint -
Submit a Pull Request against
main: Open a PR on the upstream repository with a detailed description of your changes andCloses #NNNreferencing the issue. -
Address Feedback: Respond to reviewer comments and make necessary updates.
Need Help?
If you encounter any issues, refer to the troubleshooting guide or open an issue on GitHub.