Skip to content

feat(store): Phase 2A — Postgres store with migrations and CRUD - #1

Merged
smallchungus merged 8 commits into
mainfrom
phase-2a-postgres-store
Apr 18, 2026
Merged

feat(store): Phase 2A — Postgres store with migrations and CRUD#1
smallchungus merged 8 commits into
mainfrom
phase-2a-postgres-store

Conversation

@smallchungus

Copy link
Copy Markdown
Owner

Summary

Phase 2A of the queue: durable state layer.

  • Initial migration creates pipeline_jobs and job_status_history tables (Phase 3 will ALTER TABLE for Gmail-specific columns).
  • Store type wrapping *pgxpool.Pool with the queue's CRUD primitives:
    • EnqueueJob, GetJob, ClaimJob (atomic queued→running), MarkDone, MarkFailed (with retry/dead branching at attempts >= max_attempts).
  • Migrate(ctx, dsn) applies embedded SQL migrations via golang-migrate + iofs source.
  • 9 integration tests against real Postgres via testcontainers-go (no mocks).

Test plan

  • make lint (0 issues)
  • make test-unit
  • make test-integration (9 store tests + 2 testutil smoke tests)
  • make k8s-validate (8 resources, all valid)
  • CI green

@smallchungus
smallchungus merged commit 0713d65 into main Apr 18, 2026
3 checks passed
@smallchungus
smallchungus deleted the phase-2a-postgres-store branch April 18, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant