refactor: extract storage file path helpers#172
refactor: extract storage file path helpers#172ndycode wants to merge 2 commits intorefactor/pr3-storage-identity-helpersfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
21aaa89 to
8fc0531
Compare
Summary
lib/storage.tsinto a dedicated helper moduleWhat Changed
lib/storage/file-paths.tswith the backup-path, wal-path, reset-marker, and flagged-storage path helperslib/storage.tsto import the extracted helpers and keep the publicgetFlaggedAccountsPath()surface intactValidation
npm run test -- test/storage.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
21aaa89to restore the inline storage file-path helper implementationAdditional Notes
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this pr extracts the storage file-path helper functions (
getAccountsBackupPath,getAccountsWalPath,getIntentionalResetMarkerPath,getAccountsBackupRecoveryCandidates,getFlaggedAccountsPath) and the three suffix constants (ACCOUNTS_BACKUP_SUFFIX,ACCOUNTS_WAL_SUFFIX,RESET_MARKER_SUFFIX) out oflib/storage.tsinto the newlib/storage/file-paths.tsmodule, continuing the incremental storage split. the previously flagged duplicate-constants risk is resolved —storage.tsnow imports fromfile-paths.tsand the local copies are deleted, makingfile-paths.tsthe single source of truth.lib/storage/file-paths.ts: new dedicated helper module; all path and suffix constants exported from here;ACCOUNTS_BACKUP_HISTORY_DEPTHcorrectly kept privatelib/storage.ts: local constant and function definitions removed; publicgetFlaggedAccountsPath()surface preserved via a thin wrapper that delegates to the extracted helpertest/storage-file-paths.test.ts: new vitest suite covering posix paths, backup candidate ordering, and flagged-path construction; windows-path test is tautological on linux ci (both implementation and assertion use the samenode:pathcall) — consider usingpath.win32for a meaningful cross-platform checkConfidence Score: 5/5
file-paths.tsis the sole source of truth for suffixes and path helpers;storage.tspublic api is intact; the only remaining item is a non-blocking p2 on a tautological windows-path test that doesn't affect runtime correctnessImportant Files Changed
getFlaggedAccountsPathwrapper is slightly redundant but harmless.getFlaggedAccountsPath) is preserved; all usages ofACCOUNTS_BACKUP_SUFFIX,ACCOUNTS_WAL_SUFFIX, andRESET_MARKER_SUFFIXnow draw from the single source infile-paths.ts.join(dirname(...), fileName)with the samenode:pathmodule, so it passes vacuously without verifying actual windows sibling-path resolution.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["lib/storage.ts\n(public API)"] B["lib/storage/file-paths.ts\n(new helper module)"] C["ACCOUNTS_BACKUP_SUFFIX\nACCOUNTS_WAL_SUFFIX\nRESET_MARKER_SUFFIX\n(single source of truth)"] D["getAccountsBackupPath()\ngetAccountsWalPath()\ngetIntentionalResetMarkerPath()\ngetAccountsBackupRecoveryCandidates()\ngetFlaggedAccountsPath()"] E["storage.ts callers:\ngetAccountsBackupRecoveryCandidatesWithDiscovery()\nisRotatingBackupTempArtifact()\ngetFlaggedAccountsPath()\ngetLegacyFlaggedAccountsPath()"] A -->|"imports (named re-export)"| B B --> C B --> D A --> E E -->|"uses imported helpers + constants"| BPrompt To Fix All With AI
Reviews (3): Last reviewed commit: "test: cover storage file path helpers" | Re-trigger Greptile