Skip to content

Comments

Add collector for Harborough District Council#171

Merged
BadgerHobbs merged 3 commits intomainfrom
collector/HarboroughDistrictCouncil-issue-133-1771756458
Feb 22, 2026
Merged

Add collector for Harborough District Council#171
BadgerHobbs merged 3 commits intomainfrom
collector/HarboroughDistrictCouncil-issue-133-1771756458

Conversation

@moley-bot
Copy link

@moley-bot moley-bot bot commented Feb 22, 2026

Summary

This PR adds a new bin collection data collector for Harborough District Council.

  • Implements ICollector interface
  • Adds integration tests
  • Successfully tested with example postcode from issue

Closes #133

Test Summary

 ==================== Test Summary ====================
 
 --------------------- Collector ----------------------
 
 Harborough District Council
 
 ------------------- Addresses (48) -------------------
 
 - 1, Gables Court, Main Street, LE17 5EG, LE17 5EG, 200003746518;MAIN STREET, LUTTERWORTH, LEICESTERSHIRE, LE17 5EG
 - 2, Gables Court, Main Street, LE17 5EG, LE17 5EG, 200003746516;MAIN STREET, LUTTERWORTH, LEICESTERSHIRE, LE17 5EG
 - 3, Gables Court, Main Street, LE17 5EG, LE17 5EG, 200003746517;MAIN STREET, LUTTERWORTH, LEICESTERSHIRE, LE17 5EG
 - 4, Gables Court, Main Street, LE17 5EG, LE17 5EG, 200003744739;MAIN STREET, LUTTERWORTH, LEICESTERSHIRE, LE17 5EG
 - 47, Main Street, LE17 5EG, LE17 5EG, 200002770837;47, MAIN STREET, LUTTERWORTH, LEICESTERSHIRE, LE17 5EG
 - ...
 
 --------------------- Bin Types ----------------------
 
 - Garden Waste (Green)
 - General Waste (Black)
 - Mixed Recycling (Blue)
 
 -------------------- Bin Days (3) --------------------
 
 - 24/02/2026 (1 bins):
   - Mixed Recycling (Blue)
 
 - 03/03/2026 (1 bins):
   - General Waste (Black)
 
 - 10/03/2026 (1 bins):
   - Garden Waste (Green)
 
 ======================================================

Bin Collections Page Screenshot

HarboroughDistrictCouncil Bin Collections


Generated automatically by Moley-Bot using Codex CLI

Closes #133

Generated with Codex CLI by Moley-Bot
@moley-bot moley-bot bot added the new collector Request for a new collector to be supported label Feb 22, 2026
@moley-bot moley-bot bot mentioned this pull request Feb 22, 2026
  Formatted by Moley-Bot
@BadgerHobbs
Copy link
Owner

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request adds a new collector for Harborough District Council. During the security audit, two medium-severity vulnerabilities were identified: a JSON injection vulnerability due to manual construction of a JSON payload using string interpolation, and an insecure transmission vulnerability due to the use of the HTTP protocol for the base URL. Both issues should be addressed to ensure the security and integrity of user data. Additionally, minor style guide violations regarding collection expression formatting and dictionary initialization were found, which should be corrected for consistency with the rest of the repository.

@BadgerHobbs
Copy link
Owner

@claude Please fix all unresolved PR comments, making sure to test after each change made. Please include the test output in your final comment update.

@moley-bot
Copy link
Author

moley-bot bot commented Feb 22, 2026

Claude finished @BadgerHobbs's task in 3m 28s —— View job


Fixing PR Review Comments

All unresolved PR review comments have been addressed and the integration test passes.

  • Read the collector file to understand current state
  • Fix: _baseUrl uses http instead of https (security) + add docstring
  • Fix: JSON injection via string interpolation for postcode (security) - replaced with JsonSerializer.Serialize
  • Fix: Collection expression formatting (bracket on own line)
  • Fix: Dictionary initialization - use target-typed new()
  • Fix: Private fields missing summary docstrings
  • Run build - succeeded (0 warnings, 0 errors)
  • Run tests - passed
  • Commit and push changes

Changes Made

In HarboroughDistrictCouncil.cs:

  1. _baseUrl protocol (security) — changed http://https://harborough.fccenvironment.co.uk/
  2. JSON injection (security) — replaced raw string interpolation with JsonSerializer.Serialize(new { Postcode = postcode })
  3. Collection expression formatting — moved opening [ to its own line for _binTypes
  4. Dictionary init — replaced new Dictionary<string, string> with target-typed new()
  5. Docstrings — added /// <summary> to both _baseUrl and _forwardedProtoHeaderValue private const fields

Test Output

Passed BinDays.Api.IntegrationTests.Collectors.Councils.HarboroughDistrictCouncilTests.GetBinDaysTest(postcode: "LE17 5EG") [4 s]

Test Run Successful.
Total tests: 1
     Passed: 1

|

- Fix _baseUrl from http to https (security)
- Replace JSON string interpolation with JsonSerializer.Serialize to prevent injection
- Fix collection expression bracket formatting
- Use target-typed new() for Dictionary initialization
- Add summary docstrings to private const fields

Co-authored-by: Andrew Riggs <BadgerHobbs@users.noreply.github.com>
@BadgerHobbs BadgerHobbs added the ready for deployment Implementation ready for deployment label Feb 22, 2026
@BadgerHobbs BadgerHobbs merged commit 90cbe2c into main Feb 22, 2026
3 checks passed
@BadgerHobbs BadgerHobbs deleted the collector/HarboroughDistrictCouncil-issue-133-1771756458 branch February 22, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new collector Request for a new collector to be supported ready for deployment Implementation ready for deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harborough District Council

1 participant