Skip to content

chore(db): remove dead seed files and rewire consumers#464

Open
BigGillyStyle wants to merge 2 commits into
devfrom
chore/remove-dead-seed-files
Open

chore(db): remove dead seed files and rewire consumers#464
BigGillyStyle wants to merge 2 commits into
devfrom
chore/remove-dead-seed-files

Conversation

@BigGillyStyle

@BigGillyStyle BigGillyStyle commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #368

What

Removes two dead/vestigial seed files and rewires everything that referenced them.

  • Deleted packages/db/src/seed.ts — its seed() only re-synced Postgres id sequences (the rest of the file was commented out), and local-seed.ts (pnpm db:seed:local) has superseded it for real local seeding.
  • Deleted packages/shared/src/common/seed.tsfakeEnum/fakeEnums/fakeArray had zero importers. @faker-js/faker was used only here, so the dependency and its pnpm catalog entry are now removed too.

Rewiring

  • migrate.ts — dropped the seed import and the --seed flag handling.
  • reset-test-db.ts — removed the unreachable "project" seed branch and the seedType param; it now always calls testSeed when seeding (the sole caller already only passed seedType: "test").
  • run-reset-test-db.ts — dropped the now-invalid seedType: "test" argument.
  • Removed the db:seed scripts from the root and packages/db package.json.
  • Updated the command table in docs/LOCAL_DEV_SETUP.md to point at db:seed:local.

Kept (still actively wired)

  • packages/db/src/test-seed.ts — used by pnpm reset-test-db in test/CI.
  • packages/db/src/local-seed.ts — used by pnpm db:seed:local, scripts/local-setup.sh, and docs.

Verification

  • pnpm -F @acme/db typecheck / pnpm -F @acme/shared typecheck — clean
  • pnpm -F @acme/db lint — clean
  • pre-commit hooks (eslint, prettier, typecheck across all 24 packages, commitlint) — pass
  • grep for common/seed / @faker-js/faker / from "./seed" / db:seed — no residual references; faker count in lockfile is 0

🤖 Generated with Claude Code

Delete the vestigial packages/db/src/seed.ts (its seed() only reset id
sequences; local-seed.ts has superseded it) and the unused
packages/shared/src/common/seed.ts (fakeEnum/fakeEnums/fakeArray had zero
importers). Rewire migrate.ts (drop --seed) and reset-test-db.ts (drop the
unreachable "project" branch + seedType param). Remove the db:seed scripts
and the now-orphaned @faker-js/faker dependency/catalog entry. Keep
test-seed.ts and local-seed.ts, both still actively wired.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@BigGillyStyle, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 2 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2520deff-6ccc-440b-993f-ccca416d6d24

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8d985 and a958900.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • docs/LOCAL_DEV_SETUP.md
  • package.json
  • packages/db/package.json
  • packages/db/src/migrate.ts
  • packages/db/src/seed.ts
  • packages/db/src/utils/reset-test-db.ts
  • packages/db/src/utils/run-reset-test-db.ts
  • packages/shared/package.json
  • packages/shared/src/common/seed.ts
  • pnpm-workspace.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-dead-seed-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@BigGillyStyle BigGillyStyle marked this pull request as ready for review June 16, 2026 14:35
@taterhead247

Copy link
Copy Markdown
Contributor

@BigGillyStyle thanks for jumping on this! In layman's terms, are you mainly removing the seeding we've had in there since day 1? because it's not used anymore?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes legacy/dead seed utilities (including a vestigial DB seed entrypoint containing real user data) and rewires the remaining tooling/docs to use the actively supported local/test seed paths.

Changes:

  • Deleted the legacy DB seed entrypoint and removed --seed handling from migrations plus db:seed scripts.
  • Simplified reset-test-db to always use testSeed and removed the unused seedType plumbing.
  • Removed unused shared seed helpers and dropped @faker-js/faker from the workspace/dependency graph; updated local dev docs accordingly.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-workspace.yaml Removes @faker-js/faker from the central pnpm catalog.
pnpm-lock.yaml Removes @faker-js/faker from lockfile catalogs/importers/packages/snapshots.
packages/shared/src/common/seed.ts Deletes unused faker-based seed helper utilities.
packages/shared/package.json Drops the unused @faker-js/faker dependency.
packages/db/src/utils/run-reset-test-db.ts Updates the reset-test-db runner to match the new resetTestDb signature.
packages/db/src/utils/reset-test-db.ts Removes seedType and the legacy project seed path; always uses testSeed.
packages/db/src/seed.ts Deletes the legacy seed script.
packages/db/src/migrate.ts Removes the legacy --seed flag behavior and seed import.
packages/db/package.json Removes the seed script entry.
package.json Removes the root db:seed script and keeps db:seed:local.
docs/LOCAL_DEV_SETUP.md Updates local dev docs to point to pnpm db:seed:local.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment on lines 61 to 71
console.log("Migrating database", databaseName, {
shouldReset,
shouldSeed,
config,
});
await migrator(params?.db ?? getDb(), config);

if (shouldSeed) {
console.log("Seeding database...");
if (params?.seedType === "test") {
await testSeed(params?.db ?? getDb());
} else {
// Import and run project seed
const { seed } = await import("../seed");
await seed();
}
await testSeed(params?.db ?? getDb());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

security(db): legacy seed.ts hardcodes real PII + grants admin@nation, no non-local guard

3 participants