FIX: Replication of nonnormalized NuGet versions from ProGet 2023 may fail
Created:
9/16/2024 9:44:11 AM by Dean H
Status:
Awaiting Release on 9/18/2024 9:01:11 PM
Last pulled:
9/20/2024 10:23:06 PM
Description:
In ProGet 2024, we should either not normalize the NuGet Version during replication or do a dual-fetch (x.y.0 then x.y.0.0)
ProGet 2023:
```
Fetching NuuuuuuGet.MyPackage:5.7.0.0-SITECONFIGS-5-7-X-d06d58e6 from target...
HTTP Response: 206
Chunked response; 0-10485759 (total: 17792002)
First chunk received; current offset = 10485760
Requesting additional chunk (bytes=10485760-17792001)
Package received; installing...
Package installed.
NuuuuuuGet.MyPackage:5.7.0.0-SITECONFIGS-5-7-X-d06d58e6 fetched.
Execution #1141902 finished successfully at 9/15/2024 12:25:50 PM after 00:00:16.4062168.
```
ProGet 2024:
```
Fetching NuuuuuuGet.MyPackage:5.7.0-SITECONFIGS-5-7-X-d06d58e6 from target...
HTTP Response: 404
Unchunked response; length=36
Package received; installing...
Error pulling remote item NuuuuuuGet.MyPackage:5.7.0-SITECONFIGS-5-7-X-d06d58e6: System.IO.InvalidDataException: End of Central Directory record could not be found.
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
at Inedo.ProGet.Feeds.NuGet.ParsedNuGetPackage.Read(Stream stream)
at Inedo.ProGet.Feeds.NuGet.NuGetFeed.ReadPackageMetadata(Stream packageStream, PackageInstallContext context)
at Inedo.ProGet.Feeds.StandardPackageFeed3.AddPackageAsync(Stream stream, InstallPackageOptions options, PackageInstallContext context, Nullable1 publishDate, Boolean listed, CancellationToken cancellationToken)
at Inedo.ProGet.Feeds.StandardPackageFeed3.AddPackageAsync(Stream stream, InstallPackageOptions options, PackageInstallContext context, Nullable1 publishDate, Boolean listed, CancellationToken cancellationToken)
at Inedo.ProGet.Service.Replication.FeedReplicator.HandlePossiblyChunkedDownloadAsync(Func1 createRequest, Func5 installAsync, CancellationToken cancellationToken)
at Inedo.ProGet.Service.Replication.PackageFeedReplicator.PullRemotePackageAsync(TinyPackageId packageId, CancellationToken cancellationToken)
at Inedo.ProGet.Service.Replication.PackageFeedReplicator.ReplicateAsync(CancellationToken cancellationToken)
Execution #1141894 finished successfully at 9/15/2024 12:05:41 PM after 00:00:00.2739317.
```
Notice the difference in the package version ProGet wants to replicate:
```
2024-> Fetching NuuuuuuGet.MyPackage:5.7.0-SITECONFIGS-5-7-X-d06d58e6 from target...
2023-> Fetching NuuuuuuGet.MyPackage:5.7.0.0-SITECONFIGS-5-7-X-d06d58e6 from target...
````