Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Alpha and beta releases sort above the final release

オープン 初心者向け
#58 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
cli

調査の方向性

ソートは src/Repository/ReleasesCollection.php の comparisonVersionString() にあります。この関数は -beta.1 形式のサフィックスを数値部分に書き換えますが、その結果を version_compare() が誤って順位付けしてしまいます。まず ReleasesCollectionTest::sortByVersionPutsPreReleasesBelowFinalRelease から #[Skip] を削除し、vendor/bin/testo --filter=sortByVersionPutsPreReleasesBelowFinalRelease を実行してください。このテストが通り、正式リリースが rc、beta、alpha より上に並ぶようになり、大文字の -RC も含めて正しく扱われれば完了です。リリース検索を置き換えるとこのコードが削除される可能性があるため、先に #49 を確認してください。

索引モデルが issue の本文から書いたものです。

説明

bug

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

  1. Remove #[Skip] from ReleasesCollectionTest::sortByVersionPutsPreReleasesBelowFinalRelease.
  2. 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
平均マージ
45分
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

roadrunner-php/cli のほかの issue

roadrunner-php/cli の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。