Skip to content

Commit 9aed63a

Browse files
committed
Add verbose logging in suprabase migration step for action workflow
1 parent de6e1f9 commit 9aed63a

7 files changed

Lines changed: 1747 additions & 119 deletions

File tree

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ jobs:
184184
run: |
185185
set -euo pipefail
186186
187+
echo "::group::Supabase directory layout"
188+
ls -al suprabase || true
189+
find suprabase -maxdepth 2 -type f -print | sort || true
190+
echo "::endgroup::"
191+
187192
echo "::group::Supabase migrations"
188193
npm run containers:supabase:db-push
189194
echo "::endgroup::"
@@ -192,6 +197,10 @@ jobs:
192197
FORCE_COLOR=1 npx supabase migration list --local --workdir suprabase
193198
echo "::endgroup::"
194199
200+
echo "::group::Supabase migration status (JSON)"
201+
FORCE_COLOR=1 npx supabase migration list --local --workdir suprabase --output json || true
202+
echo "::endgroup::"
203+
195204
echo "::group::Supabase schema snapshot"
196205
schema_dir="artifacts/supabase"
197206
schema_path="${schema_dir}/schema.sql"
@@ -202,6 +211,31 @@ jobs:
202211
echo "(full schema saved to ${schema_path})"
203212
echo "::endgroup::"
204213
214+
echo "::group::Supabase table inventory"
215+
bash <<'BASH'
216+
set -euo pipefail
217+
218+
find_db_container() {
219+
docker ps --format '{{.ID}} {{.Names}} {{.Image}}' | awk '$3 ~ /^supabase\/postgres(:|$)/ {print $1" "$2; exit}'
220+
}
221+
222+
db_container_line=$(find_db_container)
223+
if [ -z "${db_container_line}" ]; then
224+
db_container_line=$(docker ps --format '{{.ID}} {{.Names}} {{.Image}}' | awk '$2 ~ /_db_/ {print $1" "$2; exit}')
225+
fi
226+
227+
if [ -z "${db_container_line}" ]; then
228+
echo "Supabase database container not found; skipping inventory" >&2
229+
exit 0
230+
fi
231+
232+
container_id=$(echo "${db_container_line}" | awk '{print $1}')
233+
echo "Listing public schema tables via container ${container_id}"
234+
docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -c '\dt public.*' || true
235+
docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -At -c "select table_schema || '.' || table_name from information_schema.tables where table_schema='public' order by 1;" || true
236+
BASH
237+
echo "::endgroup::"
238+
205239
echo "::group::Supabase schema guard"
206240
bash <<'BASH'
207241
set -euo pipefail

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"containers:supabase:stop": "FORCE_COLOR=1 npx supabase stop --workdir suprabase",
5353
"containers:supabase:status": "FORCE_COLOR=1 npx supabase status --workdir suprabase",
5454
"containers:supabase:logs": "FORCE_COLOR=1 bash test/containers/supabase/logs.sh",
55-
"containers:supabase:db-push": "FORCE_COLOR=1 dotenv -e test/containers/.env -- bash -c 'npx supabase db push --local --workdir suprabase --yes'",
55+
"containers:supabase:db-push": "FORCE_COLOR=1 dotenv -e test/containers/.env -- bash -c 'npx supabase db push --local --workdir suprabase --yes --debug'",
5656
"supabase:db:push": "FORCE_COLOR=1 npx supabase db push --workdir suprabase",
5757
"test": "npm run test:unit && npm run test:e2e",
5858
"test:coverage": "FORCE_COLOR=1 npx vitest run --coverage",

0 commit comments

Comments
 (0)