Skip to content

chore: replace docker-compose with nix process-compose for dev deps#114

Draft
Lakshyyaa wants to merge 3 commits into
mainfrom
chore/nix-process-compose-dev-deps-v2
Draft

chore: replace docker-compose with nix process-compose for dev deps#114
Lakshyyaa wants to merge 3 commits into
mainfrom
chore/nix-process-compose-dev-deps-v2

Conversation

@Lakshyyaa
Copy link
Copy Markdown
Contributor

@Lakshyyaa Lakshyyaa commented Jun 4, 2026

Follows GaloyMoney/es-entity#140. Migrates job's dev loop off Docker/podman onto a Nix-managed process-compose Postgres, with per-worktree port allocation so multiple checkouts run their dev DB in parallel. No Docker required for sqlx-prepare, integration tests, or make start-deps.

Changes

  • flake.nix: add process-compose-flake input; dev-env (CRC32-of-cwd → dynamic PGPORT), pg-start (root setpriv drop + bounded readiness), setup-db-dev, mkPg/nix-deps-base; rewrite nextest-runner (XDG_CONFIG_HOME, _pgdev, bounded readiness wait, synchronous migrations); drop docker-compose/podman/podman-compose, add process-compose; export dev-env/setup-db-dev/nix-deps-base packages+apps; devShell shellHook evals dev-env
  • Makefile: start-deps/clean-deps/setup-db/reset-deps via process-compose + bounded wait; migrations folded into start-deps
  • tests/helpers.rs: read PG_CON from env (dynamic port) instead of hardcoded :5432
  • ci/pipeline.yml: drop privileged: true (no container engine needed in CI)
  • remove docker-compose.yml, nix/podman-runner.nix
  • .gitignore: add .nix-deps/

Notes

  • SQLX_OFFLINE=true stays in commonArgs (crane nix flake check builds offline against .sqlx/). The nextest-runner compiles online against the live migrated PG — mirrors es-entity#140 and adds schema-drift coverage the offline checks can't.
  • Supersedes the stale chore/nix-process-compose-dev-deps branch, which used a static :5432 port (didn't solve multi-worktree).

Verification

  • alejandra -c flake.nix
  • nix run .#dev-env → consistent per-worktree derivation (PGPORT=25200, matching PG_CON) ✅
  • make start-deps → PG up via process-compose on derived port, migrations applied ✅
  • cargo nextest run --workspace58 passed, 0 failed
  • make clean-deps → torn down ✅

🤖 Generated with Claude Code


Note

Medium Risk
Touches CI test bootstrap, dev workflows, and test DB connectivity; behavior change is intentional but broad across local and CI paths.

Overview
Replaces Docker/podman-compose dev Postgres with Nix process-compose and a local pg-start helper under .nix-deps/, so make start-deps, sqlx-prepare, and integration tests no longer need a container engine.

Adds dev-env (CRC32 of checkout path → dynamic PGPORT / PG_CON) so multiple worktrees can run Postgres in parallel, plus setup-db-dev and nix-deps-base with bounded readiness waits; Makefile targets now start/stop deps via nix run and run migrations after Postgres is healthy. nextest-runner and the dev shell follow the same flow (including root setpriv drop to UID 70 in CI). Integration tests read PG_CON from the environment instead of a fixed :5432 host. CI drops privileged: true on the tests job. Removes docker-compose.yml, nix/podman-runner.nix, and ignores .nix-deps/.

Reviewed by Cursor Bugbot for commit 15b5a52. Bugbot is set up for automated code reviews on this repo. Configure here.

Follows es-entity#140. Drops Docker/podman from the dev loop in favor of
a process-compose-managed Postgres, with per-worktree port allocation so
multiple checkouts run their dev DB in parallel.

- flake.nix: add process-compose-flake; dev-env (cwd-hash -> dynamic
  PGPORT), pg-start (root setpriv drop + bounded readiness), setup-db-dev,
  mkPg/nix-deps-base; rewrite nextest-runner (XDG_CONFIG_HOME, _pgdev,
  bounded wait, synchronous migrations); drop docker-compose/podman/
  podman-compose, add process-compose; export dev-env/setup-db-dev/
  nix-deps-base packages+apps; devShell shellHook evals dev-env
- Makefile: start/clean/setup-db/reset-deps via process-compose + bounded
  wait; migrations folded into start-deps
- tests/helpers.rs: read PG_CON from env (dynamic port)
- ci/pipeline.yml: drop privileged: true (no container engine in CI)
- remove docker-compose.yml, nix/podman-runner.nix
- .gitignore: add .nix-deps/

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 15b5a52. Configure here.

Comment thread Makefile Outdated
Lakshyyaa and others added 2 commits June 4, 2026 18:03
Picks up the post-migration fixes from cala that apply to job:

- flake.nix: always derive DATABASE_URL/PG_CON from PGPORT (drop the
  ${DATABASE_URL:-...} guard) so a stale :5432 export can't disagree with
  the hash-derived port (cala 4041bb21)
- Makefile: set -e in start-deps so an orchestrator failure fails fast
  instead of waiting out the 5-minute readiness loop (cala 496fd1b6)
- Makefile: drop dead test-in-ci target — CI runs `nix run .#nextest`;
  the target started no deps in-scope and would panic on PG_CON (cala 0e024611)
- ci/pipeline.yml: drop unused public_docker_registry ytt import (cala e248196e)

cala's doctest PG_CON fix is N/A (job's doctests are all no_run/ignore);
online-sqlx-in-runner is already job's default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pulls in es-entity#137 (direction-aware NULL fallback in cursor
condition), #138 (opt-in nullable column attribute), and #139
(opentelemetry 0.31 -> 0.32). No source, migration, or .sqlx cache
changes: job's cursor sorts on the non-nullable id, so the nullable
sort-column codepath is untouched, and the offline build validates the
query cache against es-entity 0.10.39.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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