feat: log weather provider usage - #19
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19 +/- ##
==========================================
+ Coverage 99.33% 99.35% +0.02%
==========================================
Files 34 34
Lines 4368 4525 +157
Branches 255 258 +3
==========================================
+ Hits 4339 4496 +157
Misses 18 18
Partials 11 11 ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Pull request overview
This PR improves operational visibility into weather data sourcing by adding structured, non-sensitive logging around weather provider selection, per-provider attempts, failures, and fallbacks—so operators can diagnose why QWeather fell back to Open-Meteo without exposing coordinates, endpoints, or response bodies.
Changes:
- Added a
LoggedWeatherContextProviderdecorator that logs each logical weather API attempt with duration and safe failure details. - Enriched provider failure errors (QWeather/Open-Meteo) with a safe “operation stage” plus HTTP status / exception type to make fallback causes visible.
- Added/updated tests and documentation to validate and describe the new INFO/WARNING logging behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| weather_briefing/weather_context.py | Adds provider-call logging wrapper, safe error summarization, and more informative (but non-sensitive) provider failure messages. |
| weather_briefing/cli.py | Wraps configured providers with the logging decorator and logs the effective provider order per location. |
| tests/test_weather_context.py | Adds coverage asserting fallback + per-provider logging and that optional air-quality failures are logged without failing the weather snapshot. |
| tests/test_cli.py | Verifies the CLI logs the provider order for a configured location. |
| README.md | Documents that INFO logs now include provider order and per-attempt weather API history for fallback diagnosis. |
| docs/requirements.md | Updates requirements to mandate provider-order and per-attempt logging at INFO, including optional air-quality failures, without sensitive data. |
| docs/design.md | Updates design notes to reflect provider logging being applied at the composition boundary and how fallback visibility is achieved. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
|
@coderabbitai review |
✅ Action performedReview finished.
|
4159f47 to
788a367
Compare
788a367 to
31095ff
Compare
31095ff to
a9db860
Compare
Summary
Root cause
QWeather failures were caught by the fallback provider without any diagnostic record. Hourly briefings could continue through Open-Meteo while operators saw no evidence that QWeather had failed or why fallback occurred.
Validation