graphile / migrate

Opinionated SQL-powered productive roll-forward migration tool for PostgreSQL.
MIT License
751 stars 58 forks source link

Show stderr/stdout instead of stacktrace in `watch` (and `commit`?) #167

Closed tsnobip closed 1 year ago

tsnobip commented 2 years ago

Feature description

graphile-migrate watch allows to run commands after running current migration, but when this command exits with a non-0 code, it just shows the stacktrace instead of stdout/stderr you're usually interested in.

Desired behavior:

Capture d’écran 2022-10-20 à 12 04 03

Current behavior:

Capture d’écran 2022-10-20 à 11 21 47

Same thing can somehow be said for graphile-migrate commit, right now it first shows the stacktrace before showing details, including stdout as an escaped string. it would likely be more readable to show stdout/stderr without processing.

Capture d’écran 2022-10-20 à 12 05 17

Motivating example

The most obvious example is when you want to run tests after current / migrations, you want the exit code to be taken in consideration for CI for example, but at the same time you want a readable output to understand which test failed.

The escape hatch I use for now is to ignore exit code when using watch but not in commit.

Supporting development

I [tick all that apply]:

zimme commented 2 years ago

Probably related to #152.

benjie commented 1 year ago

Fix is out in 1.4.1

zimme commented 1 year ago

1.4.1 works for me 👍