Skip to content

chore: remove leftover Supabase code path (FER-11415)#33

Draft
pgragg wants to merge 2 commits into
fer-11415-agent-score-supabase-to-rdsfrom
remove-supabase-agent-score
Draft

chore: remove leftover Supabase code path (FER-11415)#33
pgragg wants to merge 2 commits into
fer-11415-agent-score-supabase-to-rdsfrom
remove-supabase-agent-score

Conversation

@pgragg

@pgragg pgragg commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Cleanup pass after the agent-score Supabase→RDS cutover (FER-11415). The migration repointed the data layer at RDS Postgres (agent_score namespace) and moved OG images to S3, but left the Supabase scaffolding in place. This removes all of it. Code only — no infra/data/AWS/Vercel/Supabase changes, no migration scripts run.

Removals & repoints

  • lib/supabase.ts deleted. It was a misnamed RDS+S3 shim. Its real functions (ScoreRow, rowToCompany, upsertScore, getScoreBySlug, getAllScores, deleteScoresByFilter) are merged into lib/scores.ts, which now reads/writes RDS directly via lib/db.ts. The dynamic await import('./supabase') self-imports in getCompanyWithFallback/getLeaderboard are gone.
  • App routes repointedapp/api/score/route.ts and app/api/score/[jobId]/route.ts import from @/lib/scores; OG uploads import @/lib/og-storage (S3) directly. Log/comment wording updated off "Supabase".
  • Scripts repointedscripts/score-single.ts and scripts/rerun-all.ts now import from lib/scores / lib/og-storage.
  • Obsolete scripts deletedcheck-supabase.ts, dedup-supabase.ts, migrate-to-supabase.ts, rescore-to-supabase.ts (the last two migrated data to Supabase; migrate-to-supabase.ts also imported a getLeaderboardSync that no longer exists).
  • Docs/strings cleaned.env.example, components/ScoreChecker.tsx, and a script spinner label no longer describe Supabase as the live store.

Intentionally preserved

  • scripts/supabase-to-rds-migration/ toolkit + RUNBOOK.md (operational history / cutover tooling).
  • lib/categorize.ts keeps supabase as a brand token in its cloud-infra detection regex.
  • data/scores.json / data/companies.json keep Supabase as a scored company.
  • Short "migrated off Supabase/PostgREST (FER-11415)" breadcrumb comments in the RDS-backed scripts and lib/db.ts.

Dependency note

No @supabase/* entry remained in package.json or package-lock.json — the migration commit already removed it, so there was nothing to uninstall and the lockfile is unchanged.

Checks

  • tsc --noEmit — clean
  • vitest run — 25/25 pass
  • ⚠️ next lint — ESLint was never configured in this repo (interactive setup prompt); pre-existing, not introduced here.
  • next build not run (nice-to-have; typecheck + tests cover the changed modules).

⚠️ Stacked on the FER-11415 migration branch (not yet merged/PR'd). Merge the migration first, then this. This removes the Supabase code path entirely — confirm RDS cutover is verified in prod before merging.

The agent-score data layer was cut over from Supabase/PostgREST to RDS
Postgres (agent_score namespace) and OG images moved from Supabase Storage
to S3. This removes the now-dead Supabase scaffolding left behind by that
maintenance-window cutover.

- Merge the misnamed lib/supabase.ts RDS+S3 shim into lib/scores.ts; drop
  the dynamic ./supabase self-imports. getScoreBySlug/getAllScores/
  upsertScore/deleteScoresByFilter now live alongside the leaderboard
  helpers and read/write RDS via lib/db.ts.
- Repoint app/api/score/route.ts and app/api/score/[jobId]/route.ts at
  @/lib/scores; OG uploads now import @/lib/og-storage (S3) directly.
- Repoint scripts/score-single.ts and scripts/rerun-all.ts at lib/scores.
- Delete obsolete one-off Supabase scripts: check-supabase.ts,
  dedup-supabase.ts, migrate-to-supabase.ts, rescore-to-supabase.ts.
- Drop Supabase-as-live-store wording from .env.example and UI/script
  strings. Preserve scripts/supabase-to-rds-migration/ + RUNBOOK.md.

No @supabase/* dependency remained in package.json/lockfile (the migration
commit already removed it). lib/categorize.ts keeps "supabase" as a brand
token in its cloud-infra regex, and data/*.json keep Supabase as a scored
company — both intentional.
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fern-agent-score Ready Ready Preview Jun 25, 2026 2:46pm

Request Review

External review of #33 caught that scripts/check-supabase.ts and
scripts/dedup-supabase.ts were not obsolete Supabase scripts — they already
talk to RDS via lib/db (health-check + dup-cleanup against public.scores) and
were only misleadingly named. Restore them and rename to check-scores.ts /
dedup-scores.ts (scrubbing the stale Supabase wording) instead of deleting, so
the operational tooling is preserved. Genuinely Supabase-writing scripts
(migrate-to-supabase.ts, rescore-to-supabase.ts) stay deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant