9cdf4b2472
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>
1.1 KiB
1.1 KiB
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 allFOREMAN_*env vars with defaults and validationinternal/store: SQLite-backed durable queue (WAL mode,modernc.org/sqlite)jobstable: ULID PK, model, payload, state machine, retry tracking, timestampsartifactstable: named typed blobs per job, unique on (job_id, name)- Full CRUD: CreateJob, GetJob, UpdateJobState, ListJobs, CreateArtifact, GetArtifact, GetArtifactsByJob
internal/server: stdlibnet/httpserverGET /healthzreturning{"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