fix: update Rugby Borough Council scraper#2148
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRugbyBoroughCouncil.py now fetches bin collection data from a JSON API using ChangesAPI-based data retrieval
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@uk_bin_collection/uk_bin_collection/councils/RugbyBoroughCouncil.py`:
- Around line 18-22: In RugbyBoroughCouncil.py, the
`requests.get(api_url).json()` call should not parse blindly because it can hang
or accept bad responses. Update the fetch in the Rugby Borough Council
collection logic to pass a timeout to `requests.get`, then check the response
status with a failure path before calling `.json()`. If the response is not OK,
raise or otherwise fail explicitly in the same method so unexpected
endpoint/UPRN issues are surfaced early instead of being treated as empty bin
data.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: d879da6c-a8d2-4cbf-a76f-d21cf89b2c19
📒 Files selected for processing (1)
uk_bin_collection/uk_bin_collection/councils/RugbyBoroughCouncil.py
Summary
Updates the Rugby Borough Council module to use the Cloud9 waste collections API now used by the live Rugby Borough Council bin day page.
Rugby no longer exposes the old Liferay
CollectionDayFinderPortletform that the previous Selenium scraper depended on. The live page now embeds a Cloud9 web component:That component calls:
This PR replaces the broken Selenium selector flow with the same API endpoint used by the live page.
Fixes
Fixes #2147
Testing
Tested locally with a public Rugby UPRN example:
Output:
{ "bins": [ { "type": "Blue-lid recycling bin", "collectionDate": "10/07/2026" }, { "type": "Food caddy", "collectionDate": "15/07/2026" }, { "type": "Black refuse bin", "collectionDate": "17/07/2026" } ] }Also ran:
Summary by CodeRabbit
New Features
Bug Fixes