Skip to content

Require explicit conversion to raw URLs - #22620

Merged
zanieb merged 1 commit into
zaniebot/safe-url-remote-source-20261015from
zaniebot/safe-url-explicit-conversions-20261015
Oct 16, 2026
Merged

zanieb merged 1 commit into
zaniebot/safe-url-remote-source-20261015from
zaniebot/safe-url-explicit-conversions-20261015

Conversation

@astral-automations-bot

@astral-automations-bot astral-automations-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Remove the outbound From implementations for SafeUrl and VerbatimUrl. Callers that need an owned raw url::Url can use into_unsafe_url() to make the loss of redacted formatting and serialization policy visible.

Stacked on #22619.

@codspeed

codspeed Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.31%

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 3 regressed benchmarks
✅ 66 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ ⚠️ Simulation discover_workspace_from_all_members 140.6 ms 153.9 ms -8.65%
❌ ⚠️ Simulation discover_workspace_from_all_members_with_excludes 140.4 ms 148.2 ms -5.22%
❌ ⚠️ Simulation run_python_version_synthetic_workspace 546.5 ms 575.4 ms -5.01%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing zaniebot/safe-url-explicit-conversions-20261015 (74c1a12) with zaniebot/safe-url-remote-source-20261015 (58023d4)2

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on zaniebot/safe-url-remote-source-20261015 (3069e86) during the generation of this report, so c460d71 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@zanieb
zanieb added this pull request to stack #22614 October 15, 2026 21:53
@zanieb
zanieb force-pushed the zaniebot/safe-url-explicit-conversions-20261015 branch from 2cdfb47 to 74c1a12 Compare October 16, 2026 13:59
@zanieb
zanieb merged commit 6e35fc8 into main Oct 16, 2026
146 of 150 checks passed
@zanieb
zanieb deleted the zaniebot/safe-url-explicit-conversions-20261015 branch October 16, 2026 15:16
zanieb pushed a commit that referenced this pull request Oct 16, 2026
The `pip uninstall` warning for a URL that is not installed can expose
its password and sensitive query values because it formats the
underlying URL string. Remove `Deref` and `DerefMut` from `SafeUrl` to
prevent implicit access to `url::Url` through borrowing and method
lookup.

Forward URL operations used by the workspace and wrap path and query
mutation guards so they cannot expose the raw URL or its unredacted
`Debug` output. Full URL strings and owned `url::Url` values remain
available through explicit accessors.

Stacked on #22620.

Co-authored-by: Zanie Blue <[email protected]>

This branch was previously deployed

1 inactive deployment
automations — 74c1a12a Deployed Oct 16, 2026 by zanieb via review / security review #51338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants