|
| 1 | +# Contributing to Agentrax |
| 2 | + |
| 3 | +Thank you for your interest in contributing to **Agentrax**! We welcome contributions from developers, DevOps engineers, and AI infrastructure enthusiasts. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Code of Conduct |
| 8 | + |
| 9 | +Please be respectful and collaborative in all communications, issue threads, and pull requests. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Development Prerequisites |
| 14 | + |
| 15 | +Ensure you have the following installed on your development machine: |
| 16 | + |
| 17 | +- **Go**: `1.23` or later |
| 18 | +- **Docker**: `20.10+` with BuildKit enabled |
| 19 | +- **Kind**: `v0.22+` (for local E2E cluster testing) |
| 20 | +- **Kubectl**: `v1.30+` |
| 21 | +- **Helm**: `v3.14+` |
| 22 | +- **Kustomize & Controller-Gen**: Automatically managed via `make kustomize` and `make controller-gen` (installed to `./bin`) |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Getting Started |
| 27 | + |
| 28 | +1. **Fork and Clone**: |
| 29 | + ```bash |
| 30 | + git clone https://github.com/<your-username>/agentrax.git |
| 31 | + cd agentrax |
| 32 | + ``` |
| 33 | + |
| 34 | +2. **Install Local Git Quality Hooks**: |
| 35 | + ```bash |
| 36 | + make setup-git-hooks |
| 37 | + ``` |
| 38 | + *Installs pre-commit hooks (`go fmt`, `go vet`, `golangci-lint`) and pre-push hooks (`codegen-drift`, `make test`, `helm lint`).* |
| 39 | + |
| 40 | +3. **Run Unit & EnvTest Integration Tests**: |
| 41 | + ```bash |
| 42 | + make test |
| 43 | + ``` |
| 44 | + |
| 45 | +4. **Run Linter**: |
| 46 | + ```bash |
| 47 | + make lint |
| 48 | + ``` |
| 49 | + |
| 50 | +5. **Generate Code & CRD Manifests**: |
| 51 | + If you modify types in `api/v1alpha1/`, regenerate DeepCopy methods, CRD schemas, and RBAC roles: |
| 52 | + ```bash |
| 53 | + make manifests generate |
| 54 | + ``` |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## Running Local E2E Tests (Kind) |
| 59 | + |
| 60 | +To test changes against a live Kind cluster: |
| 61 | + |
| 62 | +```bash |
| 63 | +# 1. Create Kind cluster |
| 64 | +kind create cluster --name agentrax-e2e |
| 65 | + |
| 66 | +# 2. Deploy external dependencies (cert-manager, Prometheus CRDs, Gateway API CRDs) |
| 67 | +make deploy-deps |
| 68 | + |
| 69 | +# 3. Run the automated live E2E suite |
| 70 | +go test ./test/e2e/... -v -count=1 --timeout 15m |
| 71 | +``` |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Code Guidelines & Standards |
| 76 | + |
| 77 | +- **Error Wrapping**: Wrap errors with context (e.g. `fmt.Errorf("reconciling deployment: %w", err)`). |
| 78 | +- **GoDoc Comments**: Every exported package, type, constant, and function must have a GoDoc comment starting with the symbol name. |
| 79 | +- **CRD Comments**: Comments on fields in `api/v1alpha1/` double as OpenAPI schema descriptions—keep them clear and precise. |
| 80 | +- **Status Updates**: Always update status last in reconcile loops using `apimeta.SetStatusCondition`. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Submitting Pull Requests |
| 85 | + |
| 86 | +1. Create a feature branch: `git checkout -b feature/my-feature-name`. |
| 87 | +2. Commit your changes with clear, descriptive commit messages. |
| 88 | +3. Ensure all tests pass: `make lint && make test`. |
| 89 | +4. Open a Pull Request against the `main` branch with a description of the problem solved and testing performed. |
0 commit comments