chore(ci): add coverage gates via codecov.yml (#1228) - #1291
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's CI/CD pipeline by strengthening code quality standards and improving the resilience of API interactions. The updated Codecov configuration establishes higher, fixed coverage targets for both the overall project and new code, aiming to maintain and elevate test quality. Concurrently, a critical fix was applied to various LLM and embedding provider clients to prevent Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request primarily updates the Codecov configuration to enforce stricter coverage gates. It also includes a valuable bugfix across several LLM providers to handle missing Retry-After headers by adding a default fallback duration, preventing potential errors. The fix is applied consistently and is well-tested. My review includes one suggestion to remove a redundant test that doesn't seem to add value.
| fn rate_limited_error_always_has_duration() { | ||
| let err = LlmError::RateLimited { | ||
| provider: "test".to_string(), | ||
| retry_after: Some(std::time::Duration::from_secs(60)), | ||
| }; | ||
|
|
||
| if let LlmError::RateLimited { retry_after, .. } = err { | ||
| assert!( | ||
| retry_after.is_some(), | ||
| "Rate limited error should always have retry_after duration" | ||
| ); | ||
| assert_eq!( | ||
| retry_after, | ||
| Some(std::time::Duration::from_secs(60)), | ||
| "Fallback should be 60 seconds" | ||
| ); | ||
| } else { | ||
| panic!("Expected RateLimited error"); | ||
| } | ||
| } |
There was a problem hiding this comment.
This test appears to be redundant and doesn't verify the behavior described in its comment. It constructs an LlmError::RateLimited with a Some value for retry_after and then asserts that the value is Some. This is a tautology and doesn't test the fallback logic at the error creation sites.
The new tests added in anthropic_oauth.rs, nearai_chat.rs, and embeddings.rs already cover the fallback logic effectively for each provider. This test in retry.rs doesn't add any further validation and could be misleading.
Consider removing this test to avoid confusion and rely on the provider-specific tests, which are more direct and meaningful.
- Project target: 80% with 2% threshold (was: auto with 1%) - Patch target: 90% (was: 80% with 5% threshold) - Add PR comment config with reach/diff/flags layout - Enable require_changes to reduce comment noise
a00821d to
cc1f233
Compare
henrypark133
left a comment
There was a problem hiding this comment.
Review: Tighten Codecov coverage gates
Reasonable configuration update. Project target 80% with 2% threshold, patch target 90%.
Positives:
require_changes: truereduces PR comment noisereach,diff,flagslayout is more informative than default- Codecov gates are informational (not in required status checks), so won't block legitimate PRs
LGTM.
Summary
Closes #1228. Tighten coverage gates in
codecov.ymlto prevent new code from lowering the project's test quality baseline.Changes
codecov.ymlauto80%1%2%80%90%5%reach,diff,flagstrueDesign Decisions
auto:autotracks the base branch and can drift downward over time. A fixed target creates a hard floor.require_changes: true: Codecov only comments on PRs where coverage actually changes, reducing noise on docs/chore PRs.Testing
python3 -c "import yaml; yaml.safe_load(open('codecov.yml'))")cargo fmt --all -- --checkpassedcargo clippy --all -- -D warningspassedcargo testpassed (3196 passed; 2 pre-existing flaky failures unrelated to this change)Review Track
Track A (chore) — This PR modifies only the Codecov configuration file (
codecov.yml), not CI workflow definitions (.github/workflows/). No rollback plan needed; reverting this single-file change restores previous behavior.