Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
cf115f0
feat(edge-fn): add diff-schedule Edge Function with unit tests
chiptus May 9, 2026
36c220a
feat(edge-fn): add commit-schedule Edge Function and RPC migration
chiptus May 9, 2026
b3be2d3
feat(frontend): add schedule import wizard UI
chiptus May 9, 2026
ac833d2
refactor(frontend): split ScheduleImportWizard into focused components
chiptus May 9, 2026
360bc9e
fix(test): exclude Deno and Playwright files from Vitest
chiptus May 9, 2026
483a8d7
refactor: remove old client-side CSV import
chiptus May 9, 2026
a5c3582
fix(rpc): scope set_artists writes to verified update and use ROW_COUNT
claude May 9, 2026
a437e3d
fix(rpc): add ON CONFLICT DO NOTHING to create-set artist insert
claude May 9, 2026
3e555b6
fix(import): invalidate queries via key factories
claude May 9, 2026
1a84d7c
chore(import): remove orphaned CSV import code and import CsvRow type
claude May 9, 2026
577b40c
refactor(import): extract MismatchRow and use useId for stable HTML ids
claude May 9, 2026
a50bcec
test(commit-schedule): clean up created sets and select id for delete
claude May 9, 2026
09f231d
refactor(import): drive async actions through useMutation
claude May 9, 2026
620a5d8
refactor(import): split CsvUploadStep into TimezonePicker and CsvDrop…
claude May 9, 2026
83f9be6
refactor(import): extract OrphanedItem row component
claude May 9, 2026
fa0c911
refactor(import): co-locate FestivalScheduleImport in its route file
claude May 9, 2026
f80956c
refactor(import): load edition via route loader instead of useQuery
claude May 9, 2026
6996e78
refactor(diff): split computeDiff into per-row helpers
claude May 9, 2026
dfdd9e3
feat(commit-schedule): validate request body with zod
claude May 9, 2026
4c0e6f5
refactor(rpc): extract commit_schedule helpers for stage lookup, slug…
claude May 9, 2026
bb92aa3
fix(test): exclude supabase tests in vitest config and stub supabase env
claude May 10, 2026
fab3f5e
fix(lint): convert arrow function and drop unused destructured data
chiptus May 11, 2026
0afb82a
fix(rpc): make commit_schedule migration idempotent and dedup stages
chiptus May 11, 2026
7bd65ec
fix(routes): regenerate routeTree to drop stale /admin/festivals/import
chiptus May 12, 2026
34ef887
fix(rpc): suffix new set slugs to keep (edition, slug) unique
chiptus May 12, 2026
3ee45a5
fix(rpc): raise when stageName resolves to no stage
chiptus May 12, 2026
7a2e43d
fix(diff): compare candidate set dates in row timezone
chiptus May 12, 2026
3bdb8ca
fix(rpc): align commit_schedule__slugify with shared slug logic
chiptus May 12, 2026
783943a
fix(edge-fn): narrow caught error before reading .message
chiptus May 12, 2026
6d82ec3
refactor(migrations): split slug/stage uniques into own migration files
chiptus May 12, 2026
a8dbb50
fix(rpc): unarchive artists when slugs collide on upsert
chiptus May 12, 2026
99c0b1f
fix(rpc): unarchive stages on upsert and skip archived in resolver
chiptus May 12, 2026
bb6916d
feat(diff-schedule): validate request body with zod
chiptus May 12, 2026
3666d69
fix(migrations): remove old 20260509142020 (renamed to 20260509142023)
chiptus May 12, 2026
f46918d
fix(migrations): remove old 20260509142021 (renamed to 20260509142024)
chiptus May 12, 2026
204d2d2
fix(migrations): renumber slug/stage uniques to 20260509142023/24
chiptus May 12, 2026
980a8f2
fix(import): use a button for the CSV drop zone
chiptus May 12, 2026
4faf681
fix(rpc): drop wrapping RAISE so original SQLSTATE/DETAIL propagate
chiptus May 13, 2026
90093fb
fix(edge-fn): reject empty artist arrays/names at the schema boundary
chiptus May 13, 2026
b39e787
fix(rpc): raise in sync_set_artists when slugs don't resolve
chiptus May 13, 2026
75eef8b
fix(diff-schedule): validate timezone and date/time formats up front
chiptus May 13, 2026
c627cb2
fix(diff): never match the same DB set to two CSV rows
chiptus May 15, 2026
09caca6
fix(auth): surface admin_roles query errors as 500 instead of 403
chiptus May 15, 2026
1ca6fdb
fix(import): render orphaned set times in the festival timezone
chiptus May 15, 2026
19f9b70
ci: run Deno tests for Edge Functions in unit-tests workflow
chiptus May 15, 2026
718f23c
fix(ci): drop deno.lock (drifts against esm.sh)
chiptus May 15, 2026
a93c67f
ci: run deno test with --no-lock and gitignore deno.lock
chiptus May 15, 2026
85f6bc1
fix(ci): restore lockfile workflow and skip deno typecheck
chiptus May 15, 2026
fb8062d
feat(edge-fn): add per-function deno.json files
chiptus May 16, 2026
f1f4fdf
chore(deno): generate per-function lockfiles
chiptus May 16, 2026
9d431fd
ci: run deno tests per function so each picks up its own config
chiptus May 16, 2026
e54ded7
feat(import): searchable timezone picker with full IANA catalogue
chiptus May 16, 2026
7ff2314
feat(import): country search in timezone picker
claude May 16, 2026
847e305
test upgrade supabase cli
chiptus May 16, 2026
80448b6
test upgrade supabase cli
chiptus May 16, 2026
1919cc1
ci: deploy edge functions via management API
claude May 16, 2026
f86923e
fix(commit-schedule): set added_by on artist inserts
claude May 16, 2026
00540ed
review: address PR comments on schedule import UI
claude May 19, 2026
c49e276
refactor(import): use PapaParse for CSV parsing
claude May 19, 2026
22f16c9
refactor(import): split TimezonePicker into picker, item, and catalog
claude May 19, 2026
42fdd9a
refactor(diff-schedule): split diff.ts into helpers and resolvers
claude May 19, 2026
532a206
refactor(edge-fn): share generated Supabase types with diff-schedule
claude May 19, 2026
6f0e5d0
sql: squash commit_schedule migrations and extract upsert helpers
claude May 19, 2026
7d20c67
chore(edge-fn): add deno.json to remaining functions
claude May 19, 2026
92072e1
test(import): cover parseScheduleCsv and buildCommitPayload happy paths
claude May 19, 2026
2fc7772
refactor(import): split wizard into per-stage components
claude May 19, 2026
486eb05
add deno lock
chiptus May 19, 2026
e3edcee
fix: handle duplicate artist slugs when syncing prod data
claude May 20, 2026
8efa4a2
fix(rpc): set slug when commit_schedule creates stages
claude May 20, 2026
d7ed270
ci: type-check Deno edge function tests
claude May 20, 2026
be76b8b
refactor(diff-schedule): address PR review feedback
claude May 20, 2026
4c239d6
fix(schedule-import): address PR review feedback
claude May 20, 2026
545cb40
refactor(diff-schedule): split files and address review feedback
claude May 20, 2026
989a8da
refactor(schedule-import): split service file and address review feed…
claude May 20, 2026
debc1e6
fix(rpc): restrict commit_schedule EXECUTE to service_role
claude May 20, 2026
1c54950
fix(schedule-import): de-duplicate artists within a CSV row
claude May 20, 2026
1fe1fc9
revert(scripts): restore sync-from-prod.sh to main
claude May 20, 2026
db8c8a0
fix(rpc): treat same-slug stages as the same stage on import
claude May 20, 2026
aeacbbf
refactor(rpc): simplify commit_schedule__upsert_stages to ON CONFLICT…
claude May 20, 2026
01208c2
refactor(rpc): extract update_sets/create_sets/archive_sets helpers
claude May 20, 2026
f9a47bf
order sets query for deterministic findMatchingSet fallback
claude May 21, 2026
17051e9
harden parse_ts, types:generate pipefail, and stale csv rows
claude May 21, 2026
89788a0
extract type generation into scripts/gen-types.sh
claude May 21, 2026
09f45b7
guard commit_schedule helpers against NULL jsonb arrays
claude May 21, 2026
0dd62dd
prefer active rows in dedupe migrations, harden csvRowSchema
claude May 21, 2026
0446da0
surface edge function error details, reset csv file input
claude May 21, 2026
4779a7a
preserve set metadata on omit, reject empty rosters
claude May 22, 2026
afe7447
move computeDiff helpers below the main function
claude May 22, 2026
94ff242
tighten stage matching, reject empty slugs, cap diff rows
claude May 22, 2026
fdf414c
renumber schedule-ingestion migrations after main's latest
claude May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"Bash(npx oxlint:*)",
"WebSearch",
"WebFetch(domain:tanstack.com)",
"Bash(node:*)"
"Bash(node:*)",
"Bash(deno test *)",
"Bash(git commit -m ' *)",
"Bash(pnpm vitest *)"
],
"deny": []
}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/_db_migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ jobs:

- uses: actions/checkout@v4

- uses: supabase/setup-cli@v1
with:
version: 2.58.5
- uses: supabase/setup-cli@v2
Comment thread
chiptus marked this conversation as resolved.
Comment thread
chiptus marked this conversation as resolved.
Comment thread
chiptus marked this conversation as resolved.

- name: Push migrations
env:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/_deploy_edge_functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ jobs:

- uses: actions/checkout@v4

- uses: supabase/setup-cli@v1
with:
version: 2.58.5
- uses: supabase/setup-cli@v2
Comment thread
chiptus marked this conversation as resolved.
Comment thread
chiptus marked this conversation as resolved.
Comment thread
chiptus marked this conversation as resolved.

- name: Deploy functions
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
PROJECT_REF: ${{ inputs.target == 'prod' && vars.PROD_PROJECT_REF || vars.STAGING_PROJECT_REF }}
run: |
supabase functions deploy --project-ref "$PROJECT_REF"
supabase functions deploy --use-api --project-ref "$PROJECT_REF"
Comment thread
chiptus marked this conversation as resolved.
Comment thread
chiptus marked this conversation as resolved.
23 changes: 23 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,26 @@ jobs:
name: coverage-report
path: coverage/
retention-days: 7

deno-test:
name: Run Edge Function Tests
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
with:
deno-version: v2.x

- name: Run Deno tests for Edge Functions
run: |
set -e
for fn in supabase/functions/*/; do
if compgen -G "$fn"*.test.ts > /dev/null; then
echo "::group::deno test $fn"
(cd "$fn" && deno test --allow-env --allow-net --allow-read)
echo "::endgroup::"
fi
done
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ dev-dist
dump.sql

# Sync script credentials (DB connection strings — never commit)
scripts/.env.sync
scripts/.env.sync
198 changes: 0 additions & 198 deletions deno.lock

This file was deleted.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"test:e2e:report": "playwright show-report",
"test:setup": "bash scripts/setup-test-env.sh",
"test:setup:full": "bash scripts/setup-local-supabase.sh",
"types:generate": "supabase gen types typescript --project-id qssmazlqrmxiudxckxvi > src/integrations/supabase/types.ts",
"types:generate:local": "supabase gen types typescript --local > src/integrations/supabase/types.ts",
"types:generate": "bash scripts/gen-types.sh",
"db:sync:staging": "bash scripts/sync-from-prod.sh staging",
"db:sync:local": "bash scripts/sync-from-prod.sh local",
"db:recreate:staging": "bash scripts/recreate-staging.sh",
Expand Down Expand Up @@ -61,7 +60,7 @@
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.4",
"@supabase/supabase-js": "^2.81.1",
"@supabase/supabase-js": "^2.105.0",
"@tailwindcss/line-clamp": "^0.4.4",
"@tanstack/query-async-storage-persister": "^5.86.0",
"@tanstack/react-query": "^5.56.2",
Expand All @@ -84,6 +83,7 @@
"lucide-react": "^0.462.0",
"marked": "^16.3.0",
"next-themes": "^0.3.0",
"papaparse": "^5.5.3",
"posthog-js": "^1.277.0",
"react": "^18.3.1",
"react-day-picker": "^9.8.0",
Expand All @@ -102,15 +102,15 @@
"zod": "^3.23.8"
},
"devDependencies": {
"vite-plugin-pwa": "^1.2.0",
"@playwright/test": "^1.54.1",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/router-devtools": "^1.136.18",
"@tanstack/router-plugin": "^1.136.18",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@tanstack/router-devtools": "^1.136.18",
"@tanstack/router-plugin": "^1.136.18",
"@types/node": "^22.5.5",
"@types/papaparse": "^5.5.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^4.2.2",
Expand All @@ -130,6 +130,7 @@
"tsx": "^4.20.3",
"typescript": "^5.5.3",
"vite": "^7.2.7",
"vite-plugin-pwa": "^1.2.0",
"vitest": "^4.0.15"
},
"lint-staged": {
Expand Down
98 changes: 54 additions & 44 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions scripts/gen-types.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Generate Supabase TypeScript types for both the app and the Edge Functions.
# Pass --local to generate from the local database instead of the remote project.

set -euo pipefail

PROJECT_ID="qssmazlqrmxiudxckxvi"
APP_TYPES="src/integrations/supabase/types.ts"
EDGE_TYPES="supabase/functions/_shared/database.types.ts"

if [[ "${1:-}" == "--local" ]]; then
supabase gen types typescript --local | tee "$APP_TYPES" > "$EDGE_TYPES"
else
supabase gen types typescript --project-id "$PROJECT_ID" | tee "$APP_TYPES" > "$EDGE_TYPES"
fi
Loading
Loading