Skip to content

fix(ci): ensure QMD database directory exists on first run#28

Merged
ashu17706 merged 1 commit intomainfrom
perf/v0.3.1-ci-caching
Feb 25, 2026
Merged

fix(ci): ensure QMD database directory exists on first run#28
ashu17706 merged 1 commit intomainfrom
perf/v0.3.1-ci-caching

Conversation

@ashu17706
Copy link
Contributor

Summary

Fixes the "unable to open database file" error that was causing CI test failures on all platforms (Ubuntu, macOS, Windows).

Root Cause

When smriti status runs for the first time in a fresh CI environment, it tries to open the QMD SQLite database at ~/.cache/qmd/index.sqlite. The parent directory ~/.cache/qmd/ didn't exist, causing the database open to fail.

Changes

  • src/db.ts: Ensure parent directory exists before opening database with mkdirSync(recursive: true)
  • .github/workflows/install-test.yml: Add Bun binary caching (safe, read-only) and remove problematic QMD database caching (state corruption risk)

Testing

  • ✅ All 551 tests pass
  • ✅ Ready for CI validation on all platforms

Fixes install test failures across all runners.

🤖 Generated with Claude Code

When smriti status (or any command using the database) runs for the first
time in a fresh environment (like CI), the parent directory ~/.cache/qmd/
did not exist, causing SQLite to fail with "unable to open database file".

Fixed by creating parent directory with mkdirSync(recursive: true) before
opening the database connection.

Also adds Bun binary caching to install-test.yml workflow for faster CI
runs (Bun is read-only, safe to cache unlike the SQLite database).

Fixes #28 (install test failures on all platforms)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ashu17706 ashu17706 merged commit c0034e6 into main Feb 25, 2026
4 of 5 checks passed
@ashu17706 ashu17706 deleted the perf/v0.3.1-ci-caching branch February 25, 2026 15:12
ashu17706 added a commit that referenced this pull request Mar 14, 2026
When smriti status (or any command using the database) runs for the first
time in a fresh environment (like CI), the parent directory ~/.cache/qmd/
did not exist, causing SQLite to fail with "unable to open database file".

Fixed by creating parent directory with mkdirSync(recursive: true) before
opening the database connection.

Also adds Bun binary caching to install-test.yml workflow for faster CI
runs (Bun is read-only, safe to cache unlike the SQLite database).

Fixes #28 (install test failures on all platforms)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
ashu17706 added a commit that referenced this pull request Mar 14, 2026
fix(ci): ensure QMD database directory exists on first run
@github-actions github-actions bot mentioned this pull request Mar 14, 2026
4 tasks
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