Skip to content

Fix Database Path in DailyRefinementJob#574

Merged
RohanExploit merged 3 commits intomainfrom
fix-daily-refinement-db-path-12076064593165869744
Mar 24, 2026
Merged

Fix Database Path in DailyRefinementJob#574
RohanExploit merged 3 commits intomainfrom
fix-daily-refinement-db-path-12076064593165869744

Conversation

@RohanExploit
Copy link
Copy Markdown
Owner

@RohanExploit RohanExploit commented Mar 22, 2026

Fixes dbPath fallback to point to ../data/issues.db. Adds ts-jest to allow npm test to pass.


PR created automatically by Jules for task 12076064593165869744 started by @RohanExploit


Summary by cubic

Fix the fallback database path in DailyRefinementJob to ../data/issues.db so the job uses the correct DB when DB_PATH isn’t set. Updated test tooling to restore npm test: ts-jest ^29.4.6, @types/jest ^29.5.14, jest-util ^30.3.0.

Written for commit ec31b1a. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Updated Jest-related development dependencies to latest patch versions.
    • Adjusted database configuration path for improved system consistency.

@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings March 22, 2026 18:58
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 22, 2026

Deploy Preview for fixmybharat canceled.

Name Link
🔨 Latest commit ec31b1a
🔍 Latest deploy log https://app.netlify.com/projects/fixmybharat/deploys/69c2c3dfccaf1e0008198736

@github-actions
Copy link
Copy Markdown

🙏 Thank you for your contribution, @RohanExploit!

PR Details:

Quality Checklist:
Please ensure your PR meets the following criteria:

  • Code follows the project's style guidelines
  • Self-review of code completed
  • Code is commented where necessary
  • Documentation updated (if applicable)
  • No new warnings generated
  • Tests added/updated (if applicable)
  • All tests passing locally
  • No breaking changes to existing functionality

Review Process:

  1. Automated checks will run on your code
  2. A maintainer will review your changes
  3. Address any requested changes promptly
  4. Once approved, your PR will be merged! 🎉

Note: The maintainers will monitor code quality and ensure the overall project flow isn't broken.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

📝 Walkthrough

Walkthrough

Jest development dependencies updated to newer versions. Additionally, the SQLite database fallback path in DailyRefinementJob was changed from a backend directory reference to a local data directory path when DB_PATH environment variable is not set.

Changes

Cohort / File(s) Summary
Dependency Updates
package.json
Updated Jest-related dev dependencies: @types/jest to ^29.5.14, jest-util to ^30.3.0, and ts-jest to ^29.4.6.
Database Configuration
scheduler/dailyRefinementJob.ts
Modified SQLite database fallback path from scheduler/../../backend/app.db to scheduler/../data/issues.db when DB_PATH environment variable is not configured.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Hopping through versions with jest so fine,
New paths to data, all in a line,
Dependencies dance, databases shift,
Our testing tools gift, a stable uplift!
Nibble by nibble, we refine the way,
Scheduler's on track for a better day! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description provides sufficient context about the changes (database path fix and test tooling updates) but doesn't follow the provided template structure. Consider using the repository's PR template: explicitly state the Type of Change, confirm Testing Done, and verify the checklist items (code review, style compliance, documentation updates).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing the database path in DailyRefinementJob, which is the primary modification in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-daily-refinement-db-path-12076064593165869744

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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Node-based scheduler job to use the repository’s data/issues.db SQLite database by default and adjusts Jest/TypeScript testing dependencies so npm test runs successfully.

Changes:

  • Fix DailyRefinementJob SQLite fallback path to data/issues.db.
  • Update Jest/TypeScript-related devDependencies (notably @types/jest, ts-jest, jest-util).
  • Regenerate package-lock.json to reflect dependency updates.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.

File Description
scheduler/dailyRefinementJob.ts Points the scheduler’s default SQLite DB to ../data/issues.db (repo data/issues.db).
package.json Bumps Jest typing + ts-jest and updates jest-util version.
package-lock.json Lockfile updates reflecting the dependency changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 34-35: The project mixes Jest major versions: core "jest" is
29.7.0 while "jest-util" and "jest-environment-jsdom" are 30.x; align them by
either upgrading "jest" and "ts-jest" to 30.x or downgrading "jest-util" and
"jest-environment-jsdom" to 29.x to match "jest" 29.7.0; specifically update the
package.json entries for "jest", "jest-util", "jest-environment-jsdom", and
"ts-jest" so all share the same major version, then reinstall dependencies and
run the test suite to verify compatibility.

In `@scheduler/dailyRefinementJob.ts`:
- Line 11: The code computes the DB path using process.env.DB_PATH ||
path.join(__dirname, "../data/issues.db") but may attempt to open the SQLite
file before its parent directory exists; before calling new
sqlite3.Database(...) ensure the directory for that computed dbPath exists (use
path.dirname(dbPath) and create it with recursive mkdir), then proceed to open
the database so new sqlite3.Database(...) won't fail on fresh environments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc06957d-facd-4a90-9242-e0f66f5961d9

📥 Commits

Reviewing files that changed from the base of the PR and between c73144f and 4737b22.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • scheduler/dailyRefinementJob.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #579, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #580, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #581, to work on those changes. Once the pull request is ready, I'll request review from you.

@github-actions
Copy link
Copy Markdown

🔍 Quality Reminder

Thanks for the updates! Please ensure:
- Your changes don't break existing functionality
- All tests still pass
- Code quality standards are maintained

*The maintainers will verify that the overall project flow remains intact.*

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #582, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #583, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #584, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #585, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@RohanExploit I've opened a new pull request, #586, to work on those changes. Once the pull request is ready, I'll request review from you.

@RohanExploit RohanExploit merged commit 514c33f into main Mar 24, 2026
13 checks passed
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scheduler/dailyRefinementJob.ts">

<violation number="1" location="scheduler/dailyRefinementJob.ts:9">
P3: The new comment is inconsistent with the actual fallback logic (`../data/issues.db`), which can mislead maintainers about which database is used when `DB_PATH` is unset.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@@ -8,7 +8,7 @@ import { Issue } from "../services/types";

// Load environmental or fallback to test.db or production db
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 24, 2026

Choose a reason for hiding this comment

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

P3: The new comment is inconsistent with the actual fallback logic (../data/issues.db), which can mislead maintainers about which database is used when DB_PATH is unset.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scheduler/dailyRefinementJob.ts, line 9:

<comment>The new comment is inconsistent with the actual fallback logic (`../data/issues.db`), which can mislead maintainers about which database is used when `DB_PATH` is unset.</comment>

<file context>
@@ -6,7 +6,7 @@ import { AdaptiveWeights } from "../services/adaptiveWeights";
 import { Issue } from "../services/types";
 
-// Use DB_PATH env var if set, otherwise fall back to ../data/issues.db
+// Load environmental or fallback to test.db or production db
 const dbPath =
   process.env.DB_PATH || path.join(__dirname, "../data/issues.db");
</file context>
Suggested change
// Load environmental or fallback to test.db or production db
// Use DB_PATH env var if set, otherwise fall back to ../data/issues.db
Fix with Cubic

Copilot AI added a commit that referenced this pull request Mar 24, 2026
The vague comment 'Load environmental or fallback to test.db or production db'
is replaced with the precise description: 'Use DB_PATH env var if set,
otherwise fall back to ../data/issues.db'.

Also clarifies context for PR #574: ts-jest was already a dev dependency;
the change in that PR was a version bump to ^29.4.6, not a new addition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants