Refactor URL sanitization: shared helper, space-only encoding, robust test - #401
Merged
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
bpulluta
self-requested a review
March 21, 2026 04:38
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
bpulluta
marked this pull request as ready for review
March 21, 2026 05:19
ppinchuk
added a commit
that referenced
this pull request
May 21, 2026
* Add geothermal extraction integration artifacts * Add COMPASS workflow skills * Added one-shot skills * update one-shot SKILL.md structure and trigger contracts * Initial plan (#398) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * Fix skills documentation: correct paths, caching behavior, and tab formatting (#399) * Initial plan * Fix all review comments in skills documentation Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> * renamed skills and fixed minor comments * fix URL space encoding and anchor text scoring in website crawl retrieval - percent-encode raw spaces in crawl4ai PDF source URLs before downstream use - populate link text field from anchor text so ELMLinkScorer can score link labels - add two regression tests covering both fixes * remove testing skills * fixed schema * Refactor URL sanitization: shared helper, space-only encoding, robust test (#401) * Initial plan * Extract shared _sanitize_url to url_utils.py, simplify to space-only 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 * fix failing test * ruff error fix --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> * Bump release-drafter/release-drafter from 7.0.0 to 7.1.1 (#402) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 7.0.0 to 7.1.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](release-drafter/release-drafter@3a7fb5c...139054a) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-version: 7.1.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add One-Shot Skills Reliability and Guardrails (#397) * Add COMPASS workflow skills * Added one-shot skills * update one-shot SKILL.md structure and trigger contracts * Initial plan (#398) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * Fix skills documentation: correct paths, caching behavior, and tab formatting (#399) * Initial plan * Fix all review comments in skills documentation Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> * renamed skills and fixed minor comments * udpated skills Paul review march 26 --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> * updated schema, added cli overwrite option, and added optional post process rules * fix ruff error in components.py * ruff check on components.py * fix ruff errors in process.py * ruff check on updated files * Bump codecov/codecov-action from 5 to 6 (#403) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5...v6) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update tox file * Update tox file * resolved pending comments in PR400. Cleaned up logic. * fix: Wrapped long docstring lines for ruff * updated YAML --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ppinchuk <pinchukpaul@gmail.com>
rajeee
pushed a commit
that referenced
this pull request
May 27, 2026
* Add geothermal extraction integration artifacts * Add COMPASS workflow skills * Added one-shot skills * update one-shot SKILL.md structure and trigger contracts * Initial plan (#398) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * Fix skills documentation: correct paths, caching behavior, and tab formatting (#399) * Initial plan * Fix all review comments in skills documentation Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> * renamed skills and fixed minor comments * fix URL space encoding and anchor text scoring in website crawl retrieval - percent-encode raw spaces in crawl4ai PDF source URLs before downstream use - populate link text field from anchor text so ELMLinkScorer can score link labels - add two regression tests covering both fixes * remove testing skills * fixed schema * Refactor URL sanitization: shared helper, space-only encoding, robust test (#401) * Initial plan * Extract shared _sanitize_url to url_utils.py, simplify to space-only 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 * fix failing test * ruff error fix --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> * Bump release-drafter/release-drafter from 7.0.0 to 7.1.1 (#402) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 7.0.0 to 7.1.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](release-drafter/release-drafter@3a7fb5c...139054a) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-version: 7.1.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add One-Shot Skills Reliability and Guardrails (#397) * Add COMPASS workflow skills * Added one-shot skills * update one-shot SKILL.md structure and trigger contracts * Initial plan (#398) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * Fix skills documentation: correct paths, caching behavior, and tab formatting (#399) * Initial plan * Fix all review comments in skills documentation Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com> * renamed skills and fixed minor comments * udpated skills Paul review march 26 --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> * updated schema, added cli overwrite option, and added optional post process rules * fix ruff error in components.py * ruff check on components.py * fix ruff errors in process.py * ruff check on updated files * Bump codecov/codecov-action from 5 to 6 (#403) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5...v6) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update tox file * Update tox file * resolved pending comments in PR400. Cleaned up logic. * fix: Wrapped long docstring lines for ruff * updated YAML --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ppinchuk <pinchukpaul@gmail.com>
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.