filter `IsLatestVersion` returns invalid response for package `Microsoft.PowerShell.PSResourceGet`

Ouverte
#273 13 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
powershell, xml
Domaine
api, backend

Piste de recherche

Start by tracing the NuGet v2 API handling for FindPackagesById() and the IsLatestVersion filter, comparing the reported request with and without a leading space. Reproduce the response for Microsoft.PowerShell.PSResourceGet and inspect the code and tests that build the feed XML. Done means the API returns one package entry for the filtered package ID, with valid feed structure.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce
  • Call FindPackagesById() for package JiraPS via the PSGallery NuGet v2 API - example API call: https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27JiraPS%27&$filter=IsLatestVersion
  • Repeat the same API call for package Microsoft.PowerShell.PSResourceGet - example call: https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27Microsoft.PowerShell.PSResourceGet%27&$filter=IsLatestVersion
  • Repeat the same API call for package Microsoft.PowerShell.PSResourceGet, but this time add a space to the front of the filter string: https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27Microsoft.PowerShell.PSResourceGet%27&$filter=%20IsLatestVersion
Expected behavior
All 3 API calls return one and only one package (with the latest version) for their respective package IDs
Actual behavior
API call #2 returns invalid NuGet XML response, but calls 1 and 3 work as expected
Error details
N/A
Environment data
N/A
Version

N/A

Visuals

XML response from API call number 2 is:

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="https://www.powershellgallery.com/api/v2"
      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"
      xmlns:georss="http://www.georss.org/georss"
      xmlns:gml="http://www.opengis.net/gml">
	<m:count>1</m:count>
	<id>http://schemas.datacontract.org/2004/07/</id>
	<title/>
	<updated>2024-05-15T01:39:20Z</updated>
	<link rel="self"
	      href="https://www.powershellgallery.com/api/v2/Packages"/>
	<author>
		<name/>
	</author>
</feed>

Of particular interest is:

  • <m:count>1</m:count> suggests one <entry> should be present, but there are none.
  • <author> should be under an <entry>, not the <feed>. (It's also null for some reason?)
Langage dominant
PowerShell
Étoiles
289
Forks
83
Merge moyen
1 min
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PowerShell/PowerShellGallery

Toutes les issues de PowerShell/PowerShellGallery

Issues similaires

Plus d'issues Backend & API Design

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.