chore(toolchain): pin bun 1.4.0, and the coverage hole a pin bump alone would have opened - #534
Conversation
…ne would have opened
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Pull request overview
Pins Bun 1.4.0 consistently while adapting SQLite coverage and documenting its dbstat behavior.
Changes:
- Updates Bun pins across package, Docker, CI, release, and publishing paths.
- Adds deterministic SQLite driver failure injection and real
node:sqlitetesting. - Updates SQLite size documentation and runtime notes, though platform-specific claims need correction.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Pins Bun 1.4.0. |
Dockerfile |
Updates the dependency-stage Bun image. |
bin/studio.js |
Documents Node shebang requirements. |
src/lib/db/providers/sql/sqlite-driver.ts |
Adds an injectable driver loader. |
src/lib/db/types.ts |
Updates table-size field documentation. |
tests/unit/db/sqlite-driver.test.ts |
Adds real-module and deterministic failure tests. |
docs/providers/sqlite.md |
Records updated dbstat measurements. |
.github/ISSUE_TEMPLATE/bug_report.md |
Updates the example Bun version. |
.github/workflows/agent-eval.yml |
Updates the Bun workflow pin. |
.github/workflows/ci.yml |
Updates all CI Bun installations. |
.github/workflows/distribution-check.yml |
Updates the distribution-check pin. |
.github/workflows/docker-build-push.yml |
Updates Docker workflow pins. |
.github/workflows/flatpak-smoke.yml |
Updates the Flatpak smoke-test pin. |
.github/workflows/integration-check.yml |
Updates the integration-check pin. |
.github/workflows/npm-publish.yml |
Updates npm publishing pins. |
.github/workflows/release-artifacts.yml |
Updates release workflow pins. |
.github/workflows/security-scan.yml |
Updates the security workflow pin. |
Suppressed comments (1)
docs/providers/sqlite.md:401
- This historical framing is followed immediately by text that still presents driver divergence as current: lines 403-420 say changing
LIBREDB_SQLITE_DRIVERchanges the answer and showbun:sqliteomitting sizes. That contradicts the new Bun 1.4.0 result above. Reframe the old output as the behavior of a build withoutdbstat, while describing both current measured adapters as populated.
The bytes differ from the 2026-08-24 row above because the seed is not the same file, not
because the drivers disagree — that comparison is a separate measurement, kept as the
record of what Bun 1.3.14 did. The 1.3.14 row is not history: an install pinned to an
older image still behaves that way, which is why the absent-field arm below stays.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| **The divergence closed on Bun 1.4.0.** That Bun bundles SQLite 3.53.2 with | ||
| `SQLITE_ENABLE_DBSTAT_VTAB` compiled in, so `bun:sqlite` answers where 1.3.14 raised | ||
| `no such table: dbstat`, and the pinned runtime moved to it on 2026-08-31. Re-measured |
| * `dbstat` virtual table, which is a compile-time option the build behind the driver | ||
| * decides - present on node:sqlite, absent on bun:sqlite through Bun 1.3.14 ("no such | ||
| * table: dbstat", measured 2026-08-24 on SQLite 3.53.0) and present again from Bun | ||
| * 1.4.0 / SQLite 3.53.2 (re-measured 2026-08-31, where both drivers return identical | ||
| * bytes). So the omission is a property of the build, not of the driver's name, and |
| * The loader is injectable for the same reason `loadNodeSQLiteDriver`'s importer is: | ||
| * the failure arm is otherwise reachable only on a runtime that lacks the module, so a | ||
| * test asserting it is really asserting a property of the installed Bun. It was written | ||
| * that way once and went quietly unexercised the day Bun 1.4.0 shipped `node:sqlite`. |
Bun 1.4.0 bundles SQLite 3.53.2 with SQLITE_ENABLE_DBSTAT_VTAB only on its Linux and Windows builds. On macOS bun:sqlite dlopens Apple's /usr/lib/libsqlite3.dylib instead (oven-sh/bun#16717, open, reproduced by upstream triage), so sqlite_version() still reads 3.43.2 there and what dbstat does is Apple's build's answer, unmeasured here. The measurement now records its OS and architecture, and the section that presented driver divergence in the present tense is reframed around the build. Also drops the stale claim, in three comment sites, that Bun cannot import node:sqlite - 1.4.0 can, and the injectable seams exist for deterministic test isolation instead.
|
All four Copilot points verified against upstream rather than adopted on their face, and all four held — fixed in 43b7b15. The macOS claim (two comments, plus the platform framing). Confirmed, and the citation understates it: oven-sh/bun#16717 is open, and on the duplicate #31247 Bun's own triage bot reproduced it — macOS The stale The suppressed comment about lines 403-420. Also correct, and the sharpest of the four: the block below the new paragraph presented driver divergence in the present tense and printed Two sites the review could not see carried the same defect outside the diff — Comments and prose only; no executable line moves. |
|



Moves the pinned toolchain from Bun 1.3.14 to 1.4.0 —
package.json'spackageManager, theDockerfile's build base and the twenty
bun-versionlines across the workflows.It is not only a pin. Two things travel with it, and one of them changes what a user sees.
The Storage tab starts reporting SQLite table sizes
Bun 1.4.0 bundles SQLite 3.53.2 with
SQLITE_ENABLE_DBSTAT_VTABcompiled in — on the Linux andWindows builds; macOS is excluded below. On 1.3.14 it was
not, so
bun:sqliteansweredno such table: dbstatand the provider omittedtableSize/tableSizeBytes— the Storage tab drew "N/A" for the Tables and Indexes cards and "-" for eachtable's share. From this pin it reads real page bytes.
Re-measured on 2026-08-31 on Linux x86_64, seeding 200 rows of a 4096-character payload into
bigwith an indexon
payloadand 200 short rows intosmall. Under the same Bun 1.4.0 the two drivers returnedbyte-identical
getTableStats()output:So the driver divergence
docs/providers/sqlite.md§7.2 documents closes on this pin. The 1.3.14row stays in that table rather than being rewritten: an install pinned to an older image still
behaves that way, and the absent-field arm it justifies is still live for any build without
dbstat. The comment onTableStats.tableSizeis corrected the same way — the omission is aproperty of the SQLite build behind the driver, never of the driver's name.
macOS does not get this, and the docs now say so. There
bun:sqlitedlopens Apple's/usr/lib/libsqlite3.dylibrather than Bun's amalgamation — oven-sh/bun#16717,open since 2025-01, reproduced by Bun's own triage bot, which is why
sqlite_version()reads3.43.2there on 1.4.0. So the absent-dbstatarm stays live for reasons beyond an old pin, andevery claim in this change is scoped to the build rather than to the driver's name. The same
correction was applied to three comment sites outside the original diff that still asserted
"present on node:sqlite, absent on bun:sqlite" as a property of the driver.
A test that passed while covering nothing
tests/unit/db/sqlite-driver.test.tsasserted the driver-load failure path by relying on theruntime not implementing
node:sqlite, and skipped itself when the import resolved:Bun 1.4.0 implements
node:sqlite. So on the new pin that test passes while the wholecatchinloadSQLiteDrivergoes unexercised — a green suite and eight uncovered lines(
sqlite-driver.ts169, 176-185) against a 100% gate. A pin bump alone would have turned therequired coverage check red for a reason nothing in the diff named.
loadSQLiteDrivernow takes an injectable loader, the wayloadNodeSQLiteDriveralready takes aninjectable importer and for the same stated reason. The failure arm is a property of the test
rather than of whichever Bun is installed.
The upgrade also makes something newly testable: with
node:sqlitepresent, the adapter can bedriven against the real
DatabaseSyncfor the first time instead of a stand-in, so the threebridges it promises are now asserted against the real module —
get()mapping a miss tonull,run()narrowingbigintchanges tonumber, andall()returning plain rows.What was checked and found not to apply
Measured rather than assumed, against the 1.4.0 release notes:
setSystemTime()non-deterministically breaksDate.now()in other filestests/unit/lib/api/rate-limit.test.ts, restores it inafterEach. Not reachable hereBun.serveno longer serves sourcemaps for HTML routes in productionscripts/build-azure-package.mjs, which is not a production pathesbuild,oracledb,ssh2— and all three come from the registrybun.lockformatlockfileVersion: 1before and after,bun installreports "no changes", and the file's checksum does not movebetter-sqlite3crashes under Buntests/integration/db/sqlite-node-harness.ts,tests/integration/storage/sqlite-credential-encryption-node-harness.ts), so Bun was never its runtimeVerification
bun run coverage:checkat 100%docker buildon the newoven/bun:1.4.0base succeeds, and the image servesGET /api/db/health→200 {"status":"healthy"}andGET /login→200. Worth noting forreviewers: the runtime stage of that image runs Node, not Bun (
node --version→ v26.7.0inside the container,
bunabsent), so for Docker this pin is a build-time change onlybun installunder 1.4.0, which a local install against anexisting
node_modulescould not have provenDeliberately not here
Bun 1.4.0's
bun test --isolateclears the ESM and CJS module registries per file and cleans uphandles a file leaks — which is what
tests/run-core.shcurrently buys with one OS process pertest file.
--paralleland--shardare adjacent. Adopting them would rework the coverage-mergemachinery behind a required gate, so it belongs in its own change rather than riding on a pin.