Refactor URL sanitization: shared helper, space-only encoding, robust test#401
Merged
bpulluta merged 4 commits intofeature/geothermal-extraction-prfrom Mar 21, 2026
Merged
Conversation
…encoding, fix test robustness Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> Agent-Logs-Url: https://github.com/NatLabRockies/COMPASS/sessions/ceb782b4-c312-41d1-b4eb-eccbbef67097
Copilot
AI
changed the title
[WIP] Add geothermal electricity extraction support
Refactor URL sanitization: shared helper, space-only encoding, robust test
Mar 21, 2026
bpulluta
approved these changes
Mar 21, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/geothermal-extraction-pr #401 +/- ##
====================================================================
+ Coverage 55.44% 55.53% +0.09%
====================================================================
Files 61 62 +1
Lines 5699 5695 -4
Branches 534 534
====================================================================
+ Hits 3160 3163 +3
+ Misses 2491 2485 -6
+ Partials 48 47 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bpulluta
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three reviewer feedback items from the geothermal extraction PR addressed:
Shared
_sanitize_url— extracted tocompass/web/url_utils.py; bothcompass/scripts/download.pyandcompass/web/website_crawl.pyimport from there, eliminating duplicated logic that could drift.Simplified encoding — replaced
quote(unquote(path), safe="/")+ query re-encoding with a targetedpath.replace(" ", "%20"). The original approach could corrupt presigned/SAS URLs or alter semantically significant query parameters. Query string and existing percent-encoding are now left untouched.assert len(links) == 1beforenext(iter(links))intest_extract_links_from_html_sets_text_from_anchorto avoid silent false-passes if_extract_links_from_htmlreturns an unexpected number of results.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.