Export resolveDbPath and make DailyRefinementJob DB path injectable with tests#586
Draft
Copilot wants to merge 2 commits intofix-daily-refinement-db-path-12076064593165869744from
Conversation
…jectable with tests Co-authored-by: RohanExploit <178623867+RohanExploit@users.noreply.github.com> Agent-Logs-Url: https://github.com/RohanExploit/VishwaGuru/sessions/60263ff1-ce6f-4d02-bab7-eeab19d0e8f4
Copilot
AI
changed the title
[WIP] [WIP] Address feedback on database path fix in DailyRefinementJob PR
Export resolveDbPath and make DailyRefinementJob DB path injectable with tests
Mar 24, 2026
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.
Description
The
DailyRefinementJobDB path was derived from a non-exported module-level constant, making it impossible to assert the default value in tests. This refactors the path derivation into an exported, injectable function and adds focused tests to enforce thedata/issues.dbdefault.scheduler/dailyRefinementJob.tsconst dbPathwith exportedresolveDbPath(env?)— accepts an env object so tests can pass controlled environments without touchingprocess.envDailyRefinementJobconstructor now accepts optionaldbPathparam (default:resolveDbPath())tests/dailyRefinement.test.tsdescribe("resolveDbPath")with two tests: default path ends withdata/issues.dbwhen env is empty; custom path is returned whenDB_PATHis setType of Change
Related Issue
Testing Done
Screenshots (if applicable)
Checklist
Co-Authors
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.
Summary by cubic
Fixes how
DailyRefinementJobfinds the database by centralizing path resolution and allowing injection. Prevents failures when the working directory differs (local, CI, or cron).resolveDbPath; constructor now accepts an optionaldbPath.DB_PATHenv override with a../data/issues.dbfallback for consistency across environments.DB_PATHoverride.Written for commit cd1aec7. Summary will update on new commits.