Skip to content
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

Impossible to retrieve package versions list with DotNetSearchPackage #4454

Open
2 tasks done
spirit11 opened this issue Jan 23, 2025 · 1 comment
Open
2 tasks done

Comments

@spirit11
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

5.0.0

Operating system

Windows

Operating system architecture

x64

CI Server

No response

What are you seeing?

Following code in a cake frosting task produces null values output:

var dotNetPackageSearchItems = context.DotNetSearchPackage("Refit.Newtonsoft.Json",
    new DotNetPackageSearchSettings {
        ExactMatch = true
    }
);
foreach (var dotNetPackageSearchItem in dotNetPackageSearchItems) {
    context.Information(dotNetPackageSearchItem.Version);
}

What is expected?

Available package versions list should be retrieved.

Steps to Reproduce

  • Create a cake frost project
  • Add a task including given code snippet
  • Run task

Output log

No response

@spirit11
Copy link
Author

A probable source of error is that package listing and versions listing by underlying dotnet package call produces different output structures:

  • Package search
    dotnet package search Refit.Newtonsoft.Json --format json
{
  "id": "Refit.Newtonsoft.Json",
  "latestVersion": "8.0.0",
  "totalDownloads": 20270410,
  "owners": "glennawatson, reactiveui"
},
  • Version search
    dotnet package search Refit.Newtonsoft.Json --format json --exact-match
{
  "id": "Refit.Newtonsoft.Json",
  "version": "6.0.1"
},

But in both cases Cake.Common.Tools.DotNet.Package.Search.DotNetPackageSearcher.Package is used for json deserialization.

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

No branches or pull requests

1 participant