Skip to content

Limit to lenient parsing of non-standard URLs only where needed #13812

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:url-parse-leniency
Aug 23, 2025
Merged

Limit to lenient parsing of non-standard URLs only where needed #13812
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:url-parse-leniency

Conversation

@Ericson2314
Copy link
Copy Markdown
Member

Motivation

This allows us to put parseURL in more spots without furthering technical debt.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@Ericson2314 Ericson2314 requested a review from edolstra as a code owner August 22, 2025 16:28
@github-actions github-actions bot added the new-cli Relating to the "nix" command label Aug 22, 2025
This allows us to put `parseURL` in more spots without furthering
technical debt.
Copy link
Copy Markdown
Contributor

@xokdvium xokdvium left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

if (element.source) {
result = getNameFromURL(parseURL(element.source->to_string()));
// Seems to be for Flake URLs
result = getNameFromURL(parseURL(element.source->to_string(), /*lenient=*/true));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, nix profile does some weird stuff with URLs which I don't quite understand. getNameFromURL is particularly bad.

@Ericson2314 Ericson2314 merged commit 2fa2c0b into NixOS:master Aug 23, 2025
14 checks passed
@Ericson2314 Ericson2314 deleted the url-parse-leniency branch August 23, 2025 14:55
@Ericson2314 Ericson2314 added the backport 2.31-maintenance Automatically creates a PR against the branch label Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.31-maintenance Automatically creates a PR against the branch new-cli Relating to the "nix" command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants