feat: add local git hooks and web bootstrap fixes#8
Merged
Conversation
| // Re-export schema for convenience | ||
| export * from '../../src/db/schema' | ||
|
|
||
| function seedDefaultCriteria(database: Database.Database) { |
There was a problem hiding this comment.
Issue: In web/lib/db.ts, the seedDefaultCriteria function types its parameter as Database.Database, but the default import from 'better-sqlite3' does not expose a nested Database type, causing a TypeScript error (namespace 'Database' has no exported member 'Database').
Suggested fix: Change the parameter type to the actual Database type from better-sqlite3, for example: function seedDefaultCriteria(database: Database) { ... } or use an explicit imported type alias for the Database instance.
🔧 Tag @ glean-for-engineering to fix or click here to fix in Glean
💬 Help us improve! Was this comment helpful? React with 👍 or 👎
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR creates the new
hooksbranch frommainand keeps the scope focused on local quality gates plus the small runtime/build fixes needed to verify the app works locally.What Changed
Git hooks
Added local Git hooks under
.githooks/and wired them throughpackage.jsonwithprepareso contributors use the repo hook path after install.pre-commit: runs Git whitespace checks, staged Biome checks, TypeScript typecheck, and unit tests.pre-push: runs rootbun run check; when pushed changes includeweb/, it also runscd web && bun install && bun run build.commit-msg: enforces Conventional Commit style while allowing merge, revert, fixup, and squash commits.post-merge: runsbun installwhen root or web dependency files changed.Fresh clone and DevLocal database bootstrap
The web app opened the shared SQLite DB directly. On a fresh clone or empty local DB, that could produce missing table errors such as
no such table: eval_sets.Added
src/db/bootstrap.tsas shared DB startup logic used by both CLI and web.It now:
data/directory exists,token_usageif missing,src/criteria/defaults.ts.This does not add dummy data. It does not create fake eval sets, cases, runs, results, or scores. The only seeded rows are the repo built-in eval criteria definitions.
Web build/runtime fixes
The web build exposed a few issues that were unrelated to hooks but blocked verification:
bun:sqliteDB code.getConfig()at request time instead of importing a missing/stale config binding.evalSetModeinto web run scoring so guidance and golden modes calculate scores correctly.webpackblock fromweb/next.config.js.web/tsconfig.jsonDrizzle path mapping because removing it causes duplicate Drizzle type identities and failsnext build.What This PR Does Not Do
Final Review
Final review found no blocking issues. The DB bootstrap is intentionally shared in the DB layer instead of hand-written inside
web/lib/db.ts, and migration errors are only ignored for expected idempotent cases such as existing tables or columns.Validation
git diff --check origin/main...HEAD.githooks/pre-pushbun run checkcd web && bun run buildhttp://localhost:3000Note: Biome reports existing
noExplicitAnywarnings in CLI/generator code, but the configured check exits successfully and the warnings are not introduced by this PR.