Alpha and beta releases sort above the final release
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
排序邏輯位於 src/Repository/ReleasesCollection.php 中的 comparisonVersionString(),它會把 -beta.1 這類後綴改寫為數字部分,接著 version_compare() 會錯誤地排序。請先從 ReleasesCollectionTest::sortByVersionPutsPreReleasesBelowFinalRelease 中移除 #[Skip],然後執行 vendor/bin/testo --filter=sortByVersionPutsPreReleasesBelowFinalRelease。當該測試通過,且正式版本排在 rc、beta 和 alpha 之上(包括大寫的 -RC)時即完成。請先查看 #49,因為替換版本查找方式可能會刪除這段程式碼。
由索引模型根據 Issue 內容生成。
描述
Description
ReleasesCollection::sortByVersion() ranks alpha and beta pre-releases above the final release of the same version. Sorting v2024.1.0-alpha.1, v2024.1.0, v2024.1.0-beta.1, v2024.1.0-rc.1 gives:
v2024.1.0-beta.1
v2024.1.0-alpha.1
v2024.1.0
v2024.1.0-rc.1
Expected: v2024.1.0, v2024.1.0-rc.1, v2024.1.0-beta.1, v2024.1.0-alpha.1.
get-binary and download-protoc-binary install the first release of the sorted list that passes the stability filter. With --stability=beta (or lower) they pick the beta over the final release that is already out.
comparisonVersionString() replaces -<stability> with .<weight>.. v2024.1.0-beta.1 therefore compares as v2024.1.0.2..1, and version_compare() ranks it above v2024.1.0 because it has more numeric parts. Lower-case -rc tags are left untouched (the stability is RC), so they happen to sort correctly. Upper-case -RC tags have the same problem as beta and alpha. #2 was about the order among pre-releases.
Steps to reproduce
- Remove
#[Skip]fromReleasesCollectionTest::sortByVersionPutsPreReleasesBelowFinalRelease. - Run
vendor/bin/testo --filter=sortByVersionPutsPreReleasesBelowFinalRelease.
Additional context
The release lookup may be replaced by DLoad in #49, in which case this code goes away.
- 主要語言
- PHP
- 星號
- 30
- 分支
- 15
- 平均合併
- 9 小時 37 分鐘
- 30 天內合併 PR
- 16
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
roadrunner-php/cli 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
roadrunner-php/cli#67 ·
維護者通常 1 天內回覆
查看 roadrunner-php/cli 的全部 Issue
相似的 Issue
-
domain/discovery
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
neos/flow-development-collection#3639 · 1 則留言 ·
維護者通常 1 天內回覆
-
The PHP version check in prepare.php still allows PHP 7.2 and 7.3可能已有人在做 @ekamran 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
WordPress/phpunit-test-runner#359 ·
維護者通常 2 天內回覆
-
[ObjectMapper] Merge the objects that repeated `#[Map]` attributes map …可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉ObjectMapper
難度 2/5 1-3 小時 新手友好度 68/100
symfony/symfony-docs#23390 ·
維護者通常 2 天內回覆