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

未關閉
#273 13 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
powershell, xml
領域
api, backend

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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?)
主要語言
PowerShell
星號
289
分支
83
平均合併
1 分鐘
30 天內合併 PR
1

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PowerShell/PowerShellGallery 的其他 Issue

查看 PowerShell/PowerShellGallery 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。