feat(api): Go scaffold, CI with ci-gate, ADR 0001 #70

Merged
amiryahaya merged 5 commits from feat/api-scaffold into main 2026-10-22 18:59:35 +02:00
Owner

Summary

  • Go API scaffold: single kws binary (api/worker/migrate modes; api implemented), /healthz, /readyz
  • Config loader, app wiring with graceful shutdown; tests written first, 95.9% coverage (80% gate)
  • Distroless Docker image (~8 MB), dev Postgres compose, golangci-lint config, Makefile
  • CI: single workflow with tested change detection and an always-running ci-gate (docs-only changes skip Go jobs)
  • ADR 0001: standard OIDC so the IdP (Zitadel) stays replaceable; CLAUDE.md with TDD/SOLID/coverage rules

Test plan

  • go vet, golangci-lint (0 issues), go test -race locally
  • scripts/check-coverage.sh -> 95.9%
  • scripts/detect-changes_test.sh -> 10/10
  • Docker image builds; /healthz and /readyz return 200 from the container
  • CI runs green on Forgejo (first run: verify runner label and Docker availability, see #4)

Refs #4

🤖 Generated with Claude Code

## Summary - Go API scaffold: single `kws` binary (api/worker/migrate modes; api implemented), `/healthz`, `/readyz` - Config loader, app wiring with graceful shutdown; tests written first, 95.9% coverage (80% gate) - Distroless Docker image (~8 MB), dev Postgres compose, golangci-lint config, Makefile - CI: single workflow with tested change detection and an always-running `ci-gate` (docs-only changes skip Go jobs) - ADR 0001: standard OIDC so the IdP (Zitadel) stays replaceable; `CLAUDE.md` with TDD/SOLID/coverage rules ## Test plan - [x] `go vet`, `golangci-lint` (0 issues), `go test -race` locally - [x] `scripts/check-coverage.sh` -> 95.9% - [x] `scripts/detect-changes_test.sh` -> 10/10 - [x] Docker image builds; `/healthz` and `/readyz` return 200 from the container - [ ] CI runs green on Forgejo (first run: verify runner label and Docker availability, see #4) Refs #4 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- single kws binary with api/worker/migrate modes (api implemented)
- /healthz and /readyz (names failing checks, never leaks error text)
- tests first; 95.9% coverage, 80% gate in CI via scripts/check-coverage.sh
- distroless image (~8 MB), dev Postgres compose, golangci-lint config
- ADR 0001: standard OIDC so the IdP (Zitadel) stays replaceable

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ci: add always-running ci-gate with tested change detection
Some checks failed
ci / changes (pull_request) Successful in 10s
ci / api (pull_request) Failing after 1m19s
ci / ci-gate (pull_request) Failing after 3s
87056fdd17
- scripts/detect-changes.sh (+ tests): fails safe to api=true on unknown base
- workflow always triggers; api job runs only when api/scripts/Makefile/workflows change
- ci-gate passes when needed jobs succeeded or were skipped; require only this check

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ci: add security workflow (gitleaks, govulncheck, trivy) and pin patched Go
Some checks failed
ci / changes (pull_request) Successful in 9s
ci / ci-gate (pull_request) Has been cancelled
ci / api (pull_request) Has been cancelled
c67dfdec15
- security.yml runs on push to main, weekly, and manually; not part of ci-gate
- go.mod pinned to 1.26.10: govulncheck reported 22 stdlib vulns fixed in <= 1.26.10 on the local 1.26.0
- verified locally: gitleaks (full history) clean, govulncheck clean, trivy fs + image 0 HIGH/CRITICAL

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ci: pin golangci-lint v2.10.1 (built with Go 1.26, v2.1 cannot lint a 1.26 module)
All checks were successful
ci / changes (pull_request) Successful in 10s
ci / api (pull_request) Successful in 23m16s
ci / ci-gate (pull_request) Successful in 4s
fc233f1231
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
primatekuntech/kws!70
No description provided.