From 27546540aeeb69f9035b25f181f62ae15f4a136a Mon Sep 17 00:00:00 2001 From: beasty Date: Thu, 12 Nov 2026 09:50:30 +0100 Subject: [PATCH 1/2] chore: add T3 Code project actions Install dependencies runs on worktree creation. Dev runs pnpm dev and stops on settle; previewUrl is fixed because portless with an explicit name does not add a worktree prefix. Verify runs scripts/verify.sh against a throwaway Postgres on an ephemeral loopback port, because CANVAS_TEST_DATABASE_URL is not stored in Infisical. Powered by human calories and mass GPU cycles. --- t3.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 t3.json diff --git a/t3.json b/t3.json new file mode 100644 index 0000000..02389ec --- /dev/null +++ b/t3.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://t3.codes/schema/t3.json", + "defaultThreadEnvMode": "worktree", + "scripts": [ + { + "name": "Install dependencies", + "command": "pnpm install --frozen-lockfile", + "icon": "configure", + "runOnWorktreeCreate": true, + "async": false + }, + { + "name": "Dev", + "command": "pnpm dev", + "icon": "play", + "stopOnSettle": true, + "previewUrl": "https://moddrop.localhost:1355" + }, + { + "name": "Verify", + "command": "bash -c 'set -euo pipefail; c=$(docker run -d --rm -e POSTGRES_DB=canvas_test -e POSTGRES_USER=canvas_test -e POSTGRES_HOST_AUTH_METHOD=trust -p 127.0.0.1::5432 postgres:18.4-bookworm); trap \"docker rm -f $c >/dev/null\" EXIT; until docker exec \"$c\" pg_isready -q -h 127.0.0.1 -U canvas_test; do sleep 1; done; CANVAS_TEST_DATABASE_URL=postgresql://canvas_test@$(docker port \"$c\" 5432/tcp | head -1)/canvas_test bash scripts/verify.sh'", + "icon": "test" + } + ] +} From d6a74f26bd11c5838d7bbf779621bd20045ceda3 Mon Sep 17 00:00:00 2001 From: beasty Date: Thu, 12 Nov 2026 09:59:37 +0100 Subject: [PATCH 2/2] fix: fail Verify when its throwaway Postgres never becomes ready The readiness loop retried forever if the container exited during startup; it now gives up after 60 tries and the EXIT trap cleans up. Powered by human calories and mass GPU cycles. --- t3.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t3.json b/t3.json index 02389ec..e9b3e05 100644 --- a/t3.json +++ b/t3.json @@ -18,7 +18,7 @@ }, { "name": "Verify", - "command": "bash -c 'set -euo pipefail; c=$(docker run -d --rm -e POSTGRES_DB=canvas_test -e POSTGRES_USER=canvas_test -e POSTGRES_HOST_AUTH_METHOD=trust -p 127.0.0.1::5432 postgres:18.4-bookworm); trap \"docker rm -f $c >/dev/null\" EXIT; until docker exec \"$c\" pg_isready -q -h 127.0.0.1 -U canvas_test; do sleep 1; done; CANVAS_TEST_DATABASE_URL=postgresql://canvas_test@$(docker port \"$c\" 5432/tcp | head -1)/canvas_test bash scripts/verify.sh'", + "command": "bash -c 'set -euo pipefail; c=$(docker run -d --rm -e POSTGRES_DB=canvas_test -e POSTGRES_USER=canvas_test -e POSTGRES_HOST_AUTH_METHOD=trust -p 127.0.0.1::5432 postgres:18.4-bookworm); trap \"docker rm -f $c >/dev/null\" EXIT; n=0; until docker exec \"$c\" pg_isready -q -h 127.0.0.1 -U canvas_test; do n=$((n+1)); [ $n -lt 60 ] || { echo \"PostgreSQL did not become ready\" >&2; exit 1; }; sleep 1; done; CANVAS_TEST_DATABASE_URL=postgresql://canvas_test@$(docker port \"$c\" 5432/tcp | head -1)/canvas_test bash scripts/verify.sh'", "icon": "test" } ]