ci: typecheck runner tests - #145
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 1 hour, 52 minutes, and 53 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (19)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
srctosrc testsRimeTTSProvider'svoiceannotation to match its existingNone->lunafallback behaviorValidation
.github/workflows/ci.ymluv sync --frozen --devuv run ruff format --check .uv run ruff check .uv run mypy --strict src testsuv run pytest -q(582 passed, 1 skipped)Greptile Summary
This PR extends the runner's mypy strict check from
srctosrc tests, then cleans up all typing issues the expanded check surfaced. No behavioral changes are intended except forRimeTTSProvider, which now officially acceptsvoice=Noneand falls back to"luna"in its constructor.uv run mypy --strict src testsnow covers the full test tree, preventing future type regressions in test code.import google.cloud.storage as storagefor mypy strict compatibility;RimeTTSProvider.__init__widensvoicetostr | Nonewith aor "luna"default.type: ignoresuppressions removed across 12+ test files, fixture generators typed asGenerator[None, None, None], fake client assignments replaced withcast(Any, ...), andSecretStr(...)wrappers added toSettingsconstructors.Confidence Score: 5/5
Safe to merge — all changes are typing housekeeping and the only behavioral change is the officially documented None→luna fallback in RimeTTSProvider.
The diff is entirely type annotation cleanup: removing stale ignores, adding SecretStr wrappers, correcting generator return types, and widening the rime voice parameter. The single behavioral change (voice=None → "luna") was already the implicit runtime behavior before this PR. No logic paths were restructured.
runner/src/coval_bench/providers/tts/rime.py has a minor dead-code fragment (the
or "luna"guard in synthesize() is now unreachable after the constructor change).Important Files Changed
srctosrc tests, ensuring tests are now covered by the same strict typing rules.voiceparameter to `strfrom google.cloud import storagetoimport google.cloud.storage as storagefor mypy strict compatibility; functionally identical._gcs_client()function.Settingswith explicitSecretStr(...)wrappers (eliminating thetype: ignore[arg-type]suppressions) and correctsFakeWebSocket.__aiter__return type to `AsyncIterator[strcast(Any, ...)to access private transport internals and inject a_BrokenClient, removing staletype: ignoresuppressions.AsyncConnectionPoolgeneric with the correct connection and row types, removing twotype: ignore[type-arg]suppressions; also refines a null-assertion pattern.json.loadsreturn withcast(list[Any], ...)and wraps numpytobytes()result withbytes()to satisfy mypy, replacing staletype: ignorecomments.type: ignore[arg-type]ondatabase_urland refines an assertion to use explicitis not Nonepattern for mypy strict compatibility.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[RimeTTSProvider.__init__ voice str or None] --> B{voice is None?} B -- Yes --> C[self._voice = luna] B -- No --> D[self._voice = voice] C --> E[synthesize: speaker = self._voice always a str] D --> E E --> F[WebSocket /ws3 request]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[RimeTTSProvider.__init__ voice str or None] --> B{voice is None?} B -- Yes --> C[self._voice = luna] B -- No --> D[self._voice = voice] C --> E[synthesize: speaker = self._voice always a str] D --> E E --> F[WebSocket /ws3 request]Comments Outside Diff (1)
runner/src/coval_bench/providers/tts/rime.py, line 76-77 (link)__init__assignsself._voice = voice or "luna",self._voiceis always a non-emptystr. Theor "luna"guard insynthesize()can never trigger and is dead code left over from before the annotation was widened.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (1): Last reviewed commit: "ci: typecheck runner tests" | Re-trigger Greptile