fsprojects / fsprojects/Paket

Incorrect NuGet version detection (V2 vs V3)

Open
#3,842 20 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

We are using a private NuGet source repo (feedz.io) which does not include /v3 in the URL for the source. When using Paket, it detects it as a V2 repo even though it should be V3.

This appears to be due to the logic here: https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Versioning/PackageSources.fs#L148-L151

Note that the code only assumes v3 if the URL has /v3 or is GitHub and ends in index.json. In this case, Feedz.io uses the index.json (which that URL includes the version info) file, but does not use /v3 in their API end points.

This also appears to be the same issue hit by other Paket users, whom have attempted to address (see https://github.com/fsprojects/Paket/pull/3806 and https://github.com/fsprojects/Paket/issues/3575).

Repro steps

Repository at https://github.com/ReedCopsey/paket_bug demonstrates this. Using dotnet paket install gives many errors.

Expected behavior

Paket would resolve this as V3 (somehow) and function properly.

Actual behavior

Significant errors.

Known workarounds

None.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Paket.Core/Versioning/PackageSources.fs at lines 148-151 and reproduce the failure using dotnet paket install against the paket_bug repository. Review the referenced pull request 3806 and issue 3575 for prior approaches. Done means the feedz.io source is detected as V3 and the reproduction resolves without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.