feat: scaffold project with config, store, health endpoint, CI, and Dockerfile
Phase 1 of foreman: initialize the Go module, project layout, and core infrastructure. Includes env-based configuration (FOREMAN_* namespace), SQLite-backed durable job queue with WAL mode via modernc.org/sqlite, stdlib HTTP server with /healthz and optional bearer-token auth middleware, subcommand dispatch (serve + stubs), Gitea CI workflow, multi-stage distroless Dockerfile, and comprehensive tests for all packages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
# foreman — progress
|
||||
|
||||
## Phase 1: Scaffold — 2026-05-23
|
||||
|
||||
- Go module initialized (`gitea.stevedudenhoeffer.com/steve/foreman`)
|
||||
- Project layout: `cmd/foreman/`, `internal/config/`, `internal/store/`, `internal/server/`
|
||||
- `internal/config`: loads all `FOREMAN_*` env vars with defaults and validation
|
||||
- `internal/store`: SQLite-backed durable queue (WAL mode, `modernc.org/sqlite`)
|
||||
- `jobs` table: ULID PK, model, payload, state machine, retry tracking, timestamps
|
||||
- `artifacts` table: named typed blobs per job, unique on (job_id, name)
|
||||
- Full CRUD: CreateJob, GetJob, UpdateJobState, ListJobs, CreateArtifact, GetArtifact, GetArtifactsByJob
|
||||
- `internal/server`: stdlib `net/http` server
|
||||
- `GET /healthz` returning `{"status":"ok","degraded":false}`
|
||||
- Optional bearer-token auth middleware (skips /healthz)
|
||||
- `cmd/foreman/main.go`: subcommand dispatch (serve + stubs for submit, jobs, ps)
|
||||
- CI: `.gitea/workflows/ci.yaml` (build, vet, test -race, tidy check)
|
||||
- Dockerfile: multi-stage distroless build
|
||||
- Config files: `.env.example`, `.gitignore`
|
||||
- Tests: config validation, store CRUD + edge cases, server health + auth middleware
|
||||
Reference in New Issue
Block a user