Keep changes focused, deterministic, and easy to review.
- Go 1.25+
- ClickHouse available for integration tests
golangci-lintinstalled if you plan to runmake lint
Run from the repo root:
make build
make test
make lintNotes:
make testrunsgo test -v -race ./...- Some tests exercise ClickHouse paths; use a local or reachable ClickHouse instance for integration coverage
- Use conventional commits:
feat:,fix:,docs:,test:,refactor:,chore: - Add or update tests for every code change
- Keep test coverage at least as strong as the touched area; do not merge untested behavior
- Describe the user-visible change, risk, and verification in the PR
- Keep PRs small enough to review in one pass
internal/collector: reads ClickHouse metadata and query-log data, handles retries and batchinginternal/analyzer: turns collected data into table usage, service mappings, and relationship edgesinternal/scorer: assigns cleanup safety scores and recommendationsinternal/reporter: renders JSON, HTML, text, SARIF, and SpectreHub outputsinternal/k8s: resolves client IPs to Kubernetes services with caching and rate limitingpkg/config: owns CLI/config-file parsing, defaults, exclude rules, and duration handling
- Prefer root-cause fixes over local patches
- Preserve read-only and safety guarantees around ClickHouse and Kubernetes access
- Do not broaden scope beyond the task you are changing