ReviewOS

also looking at this

reviewos/reviewos.org

fix(tests): a fresh database has no user 1 and no hook secret

#4
Merged glennmichael123 wants to merge fix/repo-delete-test-seeds into main
2 files +24 -3

Two e2e failure clusters that only exist on a checkout the author has never used — which is every checkout but one.

repo-delete (3 failures): seedRepository() inserted reactions and notification_subscriptions rows with a hardcoded user_id: 1. Both columns are real foreign keys (Reaction declares its belongsTo, and the generated schema is correct — none of the four historical generator bugs from the roadmap's migration-workflow section are in play). On a freshly migrated database there is no user 1, so the first insert dies with FK violation 23503 and all three seeding tests fail before sweepPolymorphic is ever exercised. The file now creates its own uniquely-handled user the way every other e2e file does, and deletes it in afterAll.

git-http push-pipeline (1 failure): the test needs GIT_HOOK_SECRET, and a fresh .env copied from .env.example leaves it blank — which disables the post-receive endpoint on purpose (hookSecret() returns null under 16 chars; a default shared secret is a published one). The hook logs "the forge answered 404", exits 0, the push lands on disk, and pushed_at stays null. tests/setup.ts now sets a random run-local secret when the environment has none. Verified both ways: with .env's secret blanked the test passes via the fallback, and the deliberate empty-means-disabled behavior in hookSecret() is untouched.

With this and #3, a fresh checkout with a migrated database runs the suite at 100% minus only the LFS tests (which need the private ts-git-lfs package flagged in #2).

🤖 Generated with Claude Code

2 changed files on the files tab, with 0 review threads.