New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget v2 using lowerCaseId which 404s #2145

Open
jdkang opened this Issue Feb 16, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@jdkang

jdkang commented Feb 16, 2017

Description

It seems like paket is trying to always use the <lowerCaseId> when resolving Nuget v2 packages.

Repro steps

This is using Artifactory's implementation of NuGet

  1. GET https://artifact.foo.com/artifactory/api/nuget/nuget/FindPackagesById()?id='pester'
  2. Which returns:
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom" xml:base="https://artifact.foo.com/artifactory/api/nuget/nuget/">
  <title type="text"></title>
  <id>http://schemas.datacontract.org/2004/07/</id>
  <updated>2017-02-16T22:45:20Z</updated>
  <link rel="self" title="FindPackagesById" href="FindPackagesById"/>
  <entry>
    <id>https://artifact.foo.com/artifactory/api/nuget/nuget/Packages(Id='Pester',Version='3.4.0')</id>
    <title type="text">Pester</title>
    <summary type="text">Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of powershell code being tested. Pester tests can execute any command or script that is accesible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.</summary>
    <updated>2016-11-27T17:32:42Z</updated>
    <author>
      <name>Pester Team</name>
    </author>
    <link rel="edit" title="V2FeedPackage" href="Packages(Id='Pester',Version='3.4.0')"/>
    <link rel="self" title="V2FeedPackage" href="Packages(Id='Pester',Version='3.4.0')"/>
    <category term="NuGetGallery.OData.V2FeedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
    <content type="application/zip" src="https://artifact.foo.com/artifactory/api/nuget/nuget/Download/Pester/3.4.0"/>
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:lastUpdated>2016-11-27T17:32:42</d:lastUpdated>
      <d:Version>3.4.0</d:Version>
      <d:Created m:type="Edm.DateTime">2016-08-15T11:53:32</d:Created>
      <d:Dependencies></d:Dependencies>
      <d:Description>Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of powershell code being tested. Pester tests can execute any command or script that is accesible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.</d:Description>
      <d:DownloadCount m:type="Edm.Int32">0</d:DownloadCount>
      <d:IconUrl>http://pesterbdd.com/images/Pester.png</d:IconUrl>
      <d:IsLatestVersion m:type="Edm.Boolean">true</d:IsLatestVersion>
      <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">true</d:IsAbsoluteLatestVersion>
      <d:IsPrerelease m:type="Edm.Boolean">false</d:IsPrerelease>
      <d:Language m:null="true"/>
      <d:Published m:type="Edm.DateTime">2016-08-15T11:53:32</d:Published>
      <d:LicenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</d:LicenseUrl>
      <d:PackageHash>RrGZm7eITJ/8AKwEs0O+uAc2McSz16b4Lkw/X8/rPtoptUmMmJCLevjwRTqKtyJowieE+04Sh5ArKHJVHZegbg==</d:PackageHash>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageSize m:type="Edm.Int64">121686</d:PackageSize>
      <d:ProjectUrl>https://github.com/Pester/Pester</d:ProjectUrl>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
      <d:Tags>powershell unit testing bdd tdd mocking admin</d:Tags>
      <d:Title>Pester</d:Title>
      <d:VersionDownloadCount m:type="Edm.Int32">0</d:VersionDownloadCount>
      <d:Authors>Pester Team</d:Authors>
      <d:MinClientVersion m:null="true"/>
      <d:Summary>A BDD style testing tool for Powershell</d:Summary>
    </m:properties>
  </entry>
</feed>
  1. which should lead to https://artifact.foo.com/artifactory/api/nuget/nuget/Packages(Id='Pester',Version='3.4.0')
    3b) however paket tries to use https://artifact.foo.com/artifactory/api/nuget/nuget/Packages(Id='pester',Version='3.4.0')

Looking at the correct metadata, perhaps paket is walking the <lowerCaseId>?

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="https://artifact.foo.com/artifactory/api/nuget/nuget-local/">
  <id>https://artifact.foo.com/artifactory/api/nuget/nuget-local/Packages(Id='Pester',Version='3.4.0')</id>
  <lowerCaseId>https://artifact.foo.com/artifactory/api/nuget/nuget-local/packages(id='pester',version='3.4.0')</lowerCaseId>
  <title type="text">Pester</title>
  <summary type="text">Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of powershell code being tested. Pester tests can execute any command or script that is accesible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.</summary>
  <updated>2016-11-27T17:32:42Z</updated>
  <author>
    <name>Pester Team</name>
  </author>
  <link rel="edit" title="V2FeedPackage" href="Packages(Id='Pester',Version='3.4.0')"/>
  <link rel="self" title="V2FeedPackage" href="Packages(Id='Pester',Version='3.4.0')"/>
  <category term="NuGetGallery.OData.V2FeedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
  <content type="application/zip" src="https://artifact.foo.com/artifactory/api/nuget/nuget/Download/Pester/3.4.0"/>
  <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
    <d:lastUpdated>2016-11-27T17:32:42</d:lastUpdated>
    <d:Version>3.4.0</d:Version>
    <d:Created m:type="Edm.DateTime">2016-08-15T11:53:32</d:Created>
    <d:Dependencies></d:Dependencies>
    <d:Description>Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of powershell code being tested. Pester tests can execute any command or script that is accesible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.</d:Description>
    <d:DownloadCount m:type="Edm.Int32">0</d:DownloadCount>
    <d:IconUrl>http://pesterbdd.com/images/Pester.png</d:IconUrl>
    <d:IsLatestVersion m:type="Edm.Boolean">true</d:IsLatestVersion>
    <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">true</d:IsAbsoluteLatestVersion>
    <d:IsPrerelease m:type="Edm.Boolean">false</d:IsPrerelease>
    <d:Language m:null="true"/>
    <d:Published m:type="Edm.DateTime">2016-08-15T11:53:32</d:Published>
    <d:LicenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</d:LicenseUrl>
    <d:PackageHash>RrGZm7eITJ/8AKwEs0O+uAc2McSz16b4Lkw/X8/rPtoptUmMmJCLevjwRTqKtyJowieE+04Sh5ArKHJVHZegbg==</d:PackageHash>
    <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
    <d:PackageSize m:type="Edm.Int64">121686</d:PackageSize>
    <d:ProjectUrl>https://github.com/Pester/Pester</d:ProjectUrl>
    <d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
    <d:Tags>powershell unit testing bdd tdd mocking admin</d:Tags>
    <d:Title>Pester</d:Title>
    <d:VersionDownloadCount m:type="Edm.Int32">0</d:VersionDownloadCount>
    <d:Authors>Pester Team</d:Authors>
    <d:MinClientVersion m:null="true"/>
    <d:Summary>A BDD style testing tool for Powershell</d:Summary>
  </m:properties>
</entry>

Expected behavior

Behave like nuget.exe when parsing v2 metadata

Actual behavior

Package not available.
      Message: Couldn't get package details for package pester 3.4.0 on https:
//artifact.foo.com/artifactory/api/nuget/nuget.

Known workarounds

none

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Feb 17, 2017

Member

are you using latest artifactory version?

Member

forki commented Feb 17, 2017

are you using latest artifactory version?

forki added a commit that referenced this issue Feb 17, 2017

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Feb 17, 2017

Member

can you please try latest version with workaround?

Member

forki commented Feb 17, 2017

can you please try latest version with workaround?

@jdkang

This comment has been minimized.

Show comment
Hide comment
@jdkang

jdkang Feb 20, 2017

I will try the workaround when I'm back at work (with Artifactory).

I should note that it worked "as expected" when I capitalized the first character in the paket.depdendencies entry (Pester vs pester) -- even though the metadata returned indicates a capitalized string

jdkang commented Feb 20, 2017

I will try the workaround when I'm back at work (with Artifactory).

I should note that it worked "as expected" when I capitalized the first character in the paket.depdendencies entry (Pester vs pester) -- even though the metadata returned indicates a capitalized string

@enricosada enricosada added the bug label Jan 24, 2018

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