kaaveland / eugene

Careful With that Lock, Eugene
MIT License
32 stars 1 forks source link

Add `eugene ci` command #35

Closed kaaveland closed 5 months ago

kaaveland commented 6 months ago

High level behaviour: eugene traces all new migration scripts, then posts migration reports to the pull request / merge request.

There is quite a bit to unpack here, and lots of problems to solve. How can we minimize the amount of setup and configuration necessary, so developers will want to use the tool?

Here's a non-exhaustive list of problems to solve and some ideas:

I am slightly worried about the prospects of doing this without teaching eugene lots of information about how flyway and liquibase work -- those are the two tools I meet at work the most often, and where I could most easily find users.

kaaveland commented 6 months ago

Just realized that #18 actually means there are migrations that can be run only once and can't be rolled back, which means we probably must apply them with eugene to generate the reports in CI, instead of using a migration command. Copying databases doesn't help us either, since stuff like create role is global to the server. 😭

If we want to get really dirty, we can use pg_basebackup to work around this, but that seems very involved.

kaaveland commented 5 months ago

With the new --git-diff flag, I feel like CI is a solved problem and what we need to do here is to set up some examples (one for github actions and one for gitlab ci, for now).

kaaveland commented 5 months ago

I feel like this is done now, going to tackle setting up some examples in https://github.com/kaaveland/eugene/issues/26 after I've released.