mysociety / fixmystreet

This is mySociety's popular map-based reporting platform: easy to install in new countries and regions
http://fixmystreet.org/
Other
511 stars 236 forks source link

[Bexley] Surface only one waste service if multiple share a name. #5053

Closed neprune closed 3 months ago

neprune commented 3 months ago

[skip changelog]

closes https://github.com/mysociety/societyworks/issues/4346

This also includes a small change that removes the word 'rotation' before 'schedule'.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.84%. Comparing base (ce80472) to head (31f3032). Report is 13 commits behind head on master.

Files Patch % Lines
perllib/FixMyStreet/Cobrand/Bexley/Waste.pm 75.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5053 +/- ## ========================================== + Coverage 82.65% 82.84% +0.18% ========================================== Files 396 396 Lines 30828 32060 +1232 Branches 4890 4895 +5 ========================================== + Hits 25482 26559 +1077 - Misses 3900 4054 +154 - Partials 1446 1447 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

nephila-nacrea commented 3 months ago

Hi @neprune @chrismytton , Have pushed what I think is a simpler fix 🤞 though we may need to revisit this or put it on hold until we get clarification on the question I asked here

neprune commented 3 months ago

Hi @neprune @chrismytton , Have pushed what I think is a simpler fix 🤞 though we may need to revisit this or put it on hold until we get clarification on the question I asked here

Nice, I thought doing the filtering after the original iteration would be more readable but your fixup reads nicely to me, and is obviously more performant.

Not sure if it matters, but if we wanted to be consistent in which service we choose when two clash, we could order the iteration by service code alphabetically, or similar.

nephila-nacrea commented 3 months ago

Not sure if it matters, but if we wanted to be consistent in which service we choose when two clash, we could order the iteration by service code alphabetically, or similar.

Yeah, I have wondered if we ought to be sorting services before we do any filtering - I'll see what Bexley come back with because some services are 'identical' containers but actually have different collection dates :-/

nephila-nacrea commented 3 months ago

The rotation schedule text change has been done in #5014, so that doesn't need to be done in this PR, but the rest looks good to me!

Bluh, I will remove!