supabase / postgres

Unmodified Postgres with some useful plugins

Home Page:https://supabase.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create a solution for pre-commit hook to update versions

samrose opened this issue · comments

Chore

Describe the chore

We currently have tooling that will update our extensions versions against our ansible vars https://github.com/supabase/postgres/blob/develop/nix/tools/sync-exts-versions.sh.in

However, we're in a bit of a paradox that the nix expressions live in the same repo

So, it would be optimal of we had a pre-commit hook that will run this updater.

Another small issue is that updating versions numbers must be accompanied by updating various sha256 hashes that are computed by nix at evaluation time. This means that wherever the sync runs, nix needs to be installed. And, it means that it should happen prior to a PR commit being saved and opened.

One idea is that there may be a way to create a simple http service that can do this as part of the pre-commit hook + pre-commit hook could then have local scripting to modify the code in place prior to saving the commit (then a user doesn't need nix on their machine for this step, and possibly for future steps)

Alternatively we can choose a point where start asking people to install nix on their machines, but we would need to solve #936 first for that to happen