Skip to content

Adding parsing logic for protocolVersion on source - #3844

Merged
forki merged 24 commits into
fsprojects:bugfixfrom
tebeco:explicit-protocol-version-on-source
Jun 14, 2020
Merged

forki merged 24 commits into
fsprojects:bugfixfrom
tebeco:explicit-protocol-version-on-source

Conversation

@tebeco

@tebeco tebeco commented May 6, 2020 •

Copy link
Copy Markdown
Contributor

Disclamer

Near to zero FSharp knowledge / experience
Near to zero Paket code background
Though, used paket for few years now on several C# solution (aside with Fake build and custom Fake targets)

Descritpion

(it's suppose to address: #3842)
This PR intend to stop guessing the protocolVersion of a nuget source based on various string.Contains

  • If nothing is specified paket will assume Nuget protocolVersion 3, no fallback to protocolVersion 2
  • If a protocolVersion is specified, it will stick to it
  • it should then persist that protocolVersion for that source in the lockfile to be able to also work during paket restore

Target

The initial plan was to release it for v6.x but after discussing with @baronfel it's possible to also target v5.x
The PR has been rebased to bugfix branch
In order to make it to v6 few code of code will probably need to be change or deleted :

Current state of the PR (will be edited to avoid scrolling if needed)

  • parsing paket.dependencies
  • Persists feed version in paket.lock
  • parsing paket.lock
  • still use "smart guess" on URL if no protocolVersion specified (=> does not default to v3)
  • NugetConvert
    • [!] NugetConvert parsing proper handling : in fact nuget.config could already have a protocolVersion="3") <=== not this PR I think
  • Tests
    • paket.dependencies
      • Should read protocolVersion
      • Should fail if no version specified after the token protocolVersion:
      • Should fail if unsupported version specified after the token protocolVersion:
    • paket.lock
      • Should read back paket.lock
      • Should add test specific to protocolVersion: 3

@tebeco
tebeco marked this pull request as ready for review May 6, 2020 17:17
@tebeco
tebeco changed the base branch from master to bugfix May 7, 2020 16:06
@tebeco

tebeco commented May 17, 2020 •

Copy link
Copy Markdown
Contributor Author

hello @forki
I'm not sure if the error in the CI is intended or not or even if it's linked to this PR
Do you have any idea on this one ?

@tebeco tebeco mentioned this pull request May 17, 2020
@forki

forki commented May 25, 2020

Copy link
Copy Markdown
Member

yeah don't worry. I'll fix that one

@tebeco

tebeco commented May 25, 2020 •

Copy link
Copy Markdown
Contributor Author

Just rebased the PR but with a conflict on that:
image

For now I have ignored the already merged fix and this should probably be in the method that @baronfel introduced here:
https://github.com/tebeco/Paket/commit/daadce5332f675d8d2b0ec0ee522ec1cec62be13
(not sure how yet)

image

@forki

forki commented May 26, 2020

Copy link
Copy Markdown
Member

can you please pull bugfix branch again?

tebeco and others added 22 commits May 26, 2020 13:50
…e could "materialize" back the protocolVersion
…e to get it back later to be able to emit it before listing packages
…used how does InstallOption(Command...) works
…rce respect the explicit the specified protocolVersion (this will probably raise error during install/restore but it will be "logic")
@tebeco

tebeco commented May 26, 2020 •

Copy link
Copy Markdown
Contributor Author

Done but I would really love a feedback or a review, as said my Fsharp is not rusty because i'm not sure "how to fsharp properly" :D

Also, I kinda discarded the logic during previous rebase, as a similar logic was introduced in /src/Paket.Core/Versioning/PackageSources.fs, but the logic is not quite the same
I might have introduced a regression.
Previous check was just tested for the presence of /v3/ anywhere in URI or stricly ending with index.json

This is very odd, and now that it has been merged, discarding it would be a breaking change I suppose ?
I suppose I have to port it because within the /src/Paket.Core/Versioning/PackageSources.fs logic ?

All that logic and known will just be removed in v6 I suppose as the default will be v3, and for v2, it will just require explicit version to avoid any kind of smart guess over Uri Path / segment

@tebeco

tebeco commented May 31, 2020

Copy link
Copy Markdown
Contributor Author

@forki
Just to be sure, do I need to port back the weird if( string contains or string endwith ) from previous PR ?
I might have forgotten other stuff in that PR.

If there's anything missing here please don't hesitate to list them all as it might seem obvious but jumps from multiple project I might have forgot few obvious part here

@forki

forki commented Jun 14, 2020

Copy link
Copy Markdown
Member

Amazing work!

@forki
forki merged commit 4339743 into fsprojects:bugfix Jun 14, 2020
@forki

forki commented Jun 14, 2020

Copy link
Copy Markdown
Member

@tebeco in order to get it to master. Can you please prepare a PR which merges bugfix into master and applies the change of the defaults on top? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants