Skip to content

[repo-assist] Fix unquoted local NuGet source paths containing spaces - #4354

Merged
dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3129-source-path-spaces-3e91ef512cadc23d
Aug 26, 2026
Merged

dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3129-source-path-spaces-3e91ef512cadc23d

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created automatically by Repo Assist, an AI assistant, as part of routine repository maintenance.

Closes #3129

Root cause

PackageSource.Parse in src/Paket.Core/Versioning/PackageSources.fs extracted an unquoted source path via line.Split(' ').[1]. This truncates the path at the first space, so an unquoted local source such as:

source C:\Program Files\dotnet\sdk\NuGetFallbackFolder

was parsed as just C:\Program, silently producing a bogus/nonexistent source path (the quoted form, source "C:\Program Files\...", already worked correctly via the existing regex path).

Fix

When the line isn't quoted, take everything after the source keyword as the path instead of splitting on the first space, while still stopping before any trailing username:/password:/authtype: attributes on the same line (these remain supported, matching existing credential-parsing tests).

Trade-offs

  • Minimal, surgical change confined to the unquoted-path fallback branch; the quoted-path (regex) branch and credential parsing are untouched.
  • Users who want extra safety/clarity can still quote paths containing spaces; this fix simply makes the previously-documented unquoted form work as expected too.

Test Status

  • Added 3 new unit tests in tests/Paket.Tests/Versioning/PackageSourceSpecs.fs covering: unquoted path with spaces, unquoted path with spaces + trailing slash, and unquoted path with spaces plus trailing username:/password: attributes.
  • Build: dotnet build tests/Paket.Tests/Paket.Tests.fsproj -f net9 --no-restore -p:PaketDisableGlobalRestore=true — 0 errors (only pre-existing, unrelated FS0044 deprecation warnings).
  • Tests: dotnet test ... --filter "FullyQualifiedName~PackageSourceSpecs" — 14/14 passed.
  • Regression check: dotnet test ... --filter "FullyQualifiedName~ParserSpecs|FullyQualifiedName~SaveSpecs" — 172/172 passed, no regressions in dependencies-file/source parsing or save round-tripping.

(Note: full paket install/dotnet paket restore for the Build dependency group is blocked in this sandbox by network restrictions unrelated to this change — the Main group used by these tests restores and builds fine.)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • appveyorcidata.blob.core.windows.net

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "appveyorcidata.blob.core.windows.net"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

@dsyme
dsyme marked this pull request as ready for review August 26, 2026 16:45
@dsyme
dsyme merged commit b6acf49 into master Aug 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Referencing local NuGet Sources with a space in path

1 participant