Commit Graph

109 Commits

Author SHA1 Message Date
e146b0460a fix: keep a path's bytes, so a filename that is not utf-8 survives 2026-09-09 15:40:39 +02:00
b4b6d5918f fix: report what happened instead of losing it 2026-09-09 15:40:33 +02:00
75f293ce36 docs: bring the readme up to date with the commands that exist 2026-09-08 17:44:52 +02:00
b224519952 merge: qol improvements 2026-09-08 17:35:32 +02:00
d7a54c70f9 feat!: report findings with exit code 4, not the code for failure 2026-09-08 17:35:27 +02:00
23b7fde0ea fix: separate the paths of a -z entry with a NUL, not an arrow 2026-09-08 17:35:27 +02:00
b372472de6 feat!: drop django test, which only ever ran one of the runners 2026-09-08 17:35:26 +02:00
99010cb641 fix: end quietly when a reader leaves the pipe early 2026-09-08 17:35:25 +02:00
1ecf7f1ee4 feat: show what ahab makes of this project 2026-09-08 17:35:25 +02:00
79ef5cca2d feat: list what the store holds for this repository 2026-09-08 17:35:24 +02:00
6389f3f1f5 feat: open psql in the database container 2026-09-08 17:35:23 +02:00
61f35f5ae4 feat: silence progress with --quiet 2026-09-08 17:35:22 +02:00
cabbbde438 fix: import into a cluster that has no such database yet 2026-09-08 17:35:19 +02:00
5239e000d7 merge: code reorg 2026-09-08 15:43:51 +02:00
bb0a2cca44 refactor: name the modules after what they hold 2026-09-08 15:43:45 +02:00
a3c08f6eaa refactor: put every filesystem write behind one module 2026-09-08 15:43:44 +02:00
bbbca755be refactor: run git through the same layer as everything else 2026-09-08 15:43:43 +02:00
d7626d9f5e refactor: give every command we run a type of its own 2026-09-08 15:43:42 +02:00
3d06f7dcb0 refactor: pass invocation options down instead of reading a global 2026-09-08 15:43:41 +02:00
056da8b9b2 refactor: build one binary instead of a library and a binary 2026-09-08 15:43:37 +02:00
27c6b261a6 merge: bug fixes 2026-09-08 13:18:24 +02:00
afa0b65c13 fix: stop --dry-run from writing to the working tree 2026-09-08 13:18:17 +02:00
e1817a6824 fix: fail a dump when its first pipeline stage dies 2026-09-08 13:18:11 +02:00
432fa12c53 fix: prune the store the caller asked for 2026-09-08 13:17:58 +02:00
01b0b5c2dd merge: cli modernization 2026-09-08 12:01:34 +02:00
876e239769 chore: declare lints in the manifest 2026-09-08 12:00:58 +02:00
061b77f619 feat: colour the help, and check the command definition 2026-09-08 12:00:55 +02:00
4b1e9d68b0 feat: take the store root as an option 2026-09-08 12:00:52 +02:00
11ecd0ac89 refactor: return an exit code from main 2026-09-08 12:00:49 +02:00
aec7afb274 feat: hand back the command's exit code 2026-09-08 12:00:45 +02:00
3fa4739451 chore: update metadata 2026-09-08 11:46:21 +02:00
7bd2de6783 merge: link restore 2026-09-08 11:34:33 +02:00
260ef24174 feat: add link restore 2026-09-08 11:34:22 +02:00
ef3ad1a410 merge: general cli improvements 2026-09-08 11:27:40 +02:00
43d55b1003 style: normalise command help 2026-09-08 11:27:32 +02:00
15bcaafa85 feat: add exit-code to link check 2026-09-08 11:27:30 +02:00
b2a0c08256 feat: add verbose and dry run 2026-09-08 11:27:26 +02:00
ab93e7ef4f fix: give the readiness wait a timeout 2026-09-08 11:27:22 +02:00
a489d77b0a fix: write the dump to a temporary file first 2026-09-08 11:27:18 +02:00
1bb205bb79 feat: build commands from arguments instead of strings 2026-09-08 11:27:14 +02:00
25f7b7df9d feat: fail when a command fails 2026-09-08 11:27:09 +02:00
0aeecdcb54 feat: remove stop_all 2026-09-08 11:27:03 +02:00
9caf9599b3 merge: postgres dump formats 2026-09-08 11:13:36 +02:00
ad269308cc feat: dump in every format import understands 2026-09-08 11:13:22 +02:00
77703485b9 feat: support custom format, plain sql and cluster dumps 2026-09-08 11:12:49 +02:00
0f16949190 merge: compose subcommand deprecation 2026-09-07 15:14:41 +02:00
6e44527a9a feat: deprecate compose subcommand 2026-09-07 13:11:36 +00:00
d11b0c68cd feat: drop dotenvy 2026-09-07 13:11:36 +00:00
9d63233d9a feat: detect the django and postgres services
ahab guessed that the django service is called django and the postgres one db,
falling back on AHAB_DJANGO_CONTAINER and AHAB_POSTGRES_CONTAINER. The standard
project layout happens to agree, but nothing enforces it, and a stack naming
them web and database could not use ahab without setting both variables.

One `docker compose config --format json` call, roughly 120ms, resolves the
stack even while it is down, and the services are identified from what they
are rather than what they are called:

- postgres is the service whose image is a postgres flavour, matching postg,
  timescale, pgvector or citus. Nothing else counts.
- django is the service that both builds an image and has
  DJANGO_SETTINGS_MODULE in its environment. A celery worker sharing the same
  build and env_file matches too, so published ports break the tie: the service
  answering requests wins.

Neither guess is allowed to be wrong quietly. No match, or two candidates that
cannot be told apart, is an error naming the services it looked at. There is no
variable to fall back on: both container variables are gone, along with the
guessed defaults they backed up, so an ambiguous stack is fixed in the compose
file rather than worked around per developer.

Every service lookup goes through these rules, so `compose exec` and the whole
django group agree on which container they mean.

POSTGRES_USER and POSTGRES_DB come off the detected service, so dropdb,
createdb, pg_restore and pg_dump stop assuming the role and database are both
literally `db`, falling back to that only when the service declares neither.

Note that env_file entries are merged into a service's environment, so
POSTGRES_* is not safe for identifying the database service: one such line in a
project's .env would make the django service match as well. That is why
identification uses the image and only credentials use the environment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 13:11:35 +00:00
836bbaac08 feat: let docker compose find its own file 2026-09-07 15:06:17 +02:00