chore: remediate audit-ci dependency findings - #351
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. |
📝 WalkthroughWalkthroughhono dependency bumped from 4.12.6 to 4.12.10 with extended transitive dependency pinning (flatted, picomatch, micromatch). separately, test assertion precision tolerance lowered from 6 to 5 decimal places for health score comparisons in account manager tests. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes notes for review:
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
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 157-170: Add a Vitest case to test/accounts.test.ts that verifies
glob matching and stored-state handling with Windows (win32) backslash
separators to catch the mixed picomatch-major-version override shown in
package.json (global "picomatch": "4.0.4" and nested "picomatch": "2.3.2" under
"micromatch"); specifically, replicate the existing stored-state scenario that
uses posix paths (e.g., "/repo-a/storage.json", "/repo-b/storage.json") but use
equivalent win32 paths ("\\repo-a\\storage.json", "\\repo-b\\storage.json") and
assert that the code paths which read/manage stored state and apply globs still
include those entries (exercise the same helpers invoked by the accounts tests
that load/resolve stored state and run glob filters) so any regression in
cross-version picomatch behavior is caught.
In `@test/accounts.test.ts`:
- Around line 3031-3034: The assertions that lowered precision to 5 hide timing
race flakiness from time-based recovery (healthTracker.getScore /
lib/rotation.ts:71); instead, make the tests deterministic by freezing time in
both tests that call healthTracker.getScore(trackerKey, "codex:gpt-5.1") (the
assertions around the changed lines) using Vitest fake timers
(vi.useFakeTimers() and vi.setSystemTime(fixedTimestamp) at test start, and
vi.useRealTimers() after), and restore the assertion precision to 6
(toBeCloseTo(..., 6)); apply the same freeze-time + precision-6 change to the
second occurrence of the assertion mentioned in the comment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 36ee3986-b9b5-4a85-b8b7-502c1c6dc97e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.jsontest/accounts.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (1)
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/accounts.test.ts
|
Superseded by merged rebuild #355 and the follow-up release work now on |
Summary
What Changed
honoto4.12.10and added theflattedandpicomatchoverride pins inpackage.jsonandpackage-lock.json.test/accounts.test.tsby one decimal place so the refreshed install stays green under the updated dependency graph.Validation
npm run lintnpm run typechecknpm testnpm test -- test/documentation.test.tsnpm run buildDocs and Governance Checklist
Risk and Rollback
117d16bAdditional 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 remediates audit-ci dependency findings: bumps
honoto4.12.10and pinsflatted@3.4.2andpicomatch@4.0.4viapackage.jsonoverrides (with a nestedmicromatchscope preservingpicomatch@2.3.2for micromatch compatibility). the test changes swap wall-clock-sensitive health tracker assertions forvi.useFakeTimers()+vi.setSystemTime()pins, and add a new windows-style path capture test forsaveToDiskDebounced. note: the pr description says "relaxed by one decimal place" but thetoBeCloseToprecision stays at6; the actual stabilisation is the fake-timer epoch pinning, which is the stronger fix.Confidence Score: 5/5
safe to merge — dependency bump and test stabilisation, no logic changes
all three files are low-risk: hono patch bump + override pins address audit findings, lockfile is mechanically regenerated, and test changes strengthen timing determinism rather than weaken assertions. no p0/p1 findings.
no files require special attention
Important Files Changed
Sequence Diagram
sequenceDiagram participant C as Caller participant AM as AccountManager participant T as Timer participant TX as withAccountStorageTransaction C->>AM: new AccountManager(storagePath=repoA) Note over AM: captures storagePath=repoA at construction C->>AM: setStoragePathState(repoB) C->>AM: saveToDiskDebounced(50ms) AM->>T: schedule save after 50ms T-->>AM: fire AM->>TX: run transaction (uses captured repoA path) TX-->>AM: persist(storage) AM-->>C: save complete with repoA pathReviews (2): Last reviewed commit: "test: cover windows delayed-save paths" | Re-trigger Greptile