Harden weather provider outbound egress#2610
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request routes OpenWeather API requests through the central synchronous HTTP helper (fetch) with a single-attempt retry policy, replacing the raw httpx.Client usage. It also updates the exception handling to include central egress policy and network errors, and refactors the unit tests to mock the new fetch helper. Feedback is provided regarding the newly added markdown task file, suggesting it be renamed to remove spaces from its filename to prevent potential issues in CI/CD pipelines and shell scripts.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @@ -0,0 +1,54 @@ | |||
| --- | |||
There was a problem hiding this comment.
The filename contains spaces (task-12139 - Harden-audit-Integrations-weather-provider-egress-policy.md). It is best practice to avoid spaces in filenames within a git repository, as they can cause issues with shell scripts, command-line utilities, and CI/CD pipelines. Consider renaming the file to use hyphens instead, such as task-12139-harden-audit-integrations-weather-provider-egress-policy.md.
There was a problem hiding this comment.
Checked. No filename change here: this repository's Backlog.md convention uses task-id - title.md filenames, and the task was created through the Backlog workflow. The branch has been rebased onto latest dev and the task now records the refreshed validation evidence in d6768a7.
7f5d606 to
4aa0b9e
Compare
4aa0b9e to
38b264c
Compare
Change summary
Human-written Change summary required before this draft PR is merge-ready under
Docs/superpowers/AI_GENERATED_PR_CHANGE_SUMMARY_POLICY_2026_04_17.md.What changed
Routes weather-provider HTTP requests through central HTTP policy and adds coverage for sanitized policy-denial behavior.
Backlog tracking:
TASK-12139.Latest dev refresh
devat6b727b221e55646eba663a03571e38302f7fafc2.codex/audit-weather-egress-2026-07-04at38b264ca01c7609d621b8f5df0c0698585f20db4.6b727b221e55646eba663a03571e38302f7fafc2.Validation
python -m pytest tldw_Server_API/tests/Chat_NEW/unit/test_weather_providers.py tldw_Server_API/tests/Chat_NEW/unit/test_command_router.py -q-> 36 passed, 80 warnings.python -m bandit -r tldw_Server_API/app/core/Integrations/weather_providers.py -f json -o /tmp/bandit_weather_egress_origin_dev_6b727b.json-> 0 findings over 257 LOC.git diff --check HEAD~1..HEAD-> clean.