Skip to content

Fix bisect scripts - Maven metadata.xml releases are no longer ordered by release date #23410

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

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions project/scripts/bisect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import java.io.File
import java.nio.file.attribute.PosixFilePermissions
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.time.LocalDate
import java.time.format.DateTimeFormatter

val usageMessage = """
|Usage:
Expand Down Expand Up @@ -156,7 +158,6 @@ case class ReleasesRange(first: Option[String], last: Option[String]):
val index = releases.indexWhere(_.version == version)
assert(index > 0, s"${version} matches no nightly compiler release")
index

val startIdx = first.map(releaseIndex(_)).getOrElse(0)
val endIdx = last.map(releaseIndex(_) + 1).getOrElse(releases.length)
val filtered = releases.slice(startIdx, endIdx).toVector
Expand All @@ -183,12 +184,15 @@ object Releases:
re.findAllMatchIn(xml.mkString)
.flatMap{ m => Option(m.group(1)).map(Release.apply) }
.toVector
.sortBy: release =>
(release.version, release.date)

def fromRange(range: ReleasesRange): Vector[Release] = range.filter(allReleases)

case class Release(version: String):
private val re = raw".+-bin-(\d{8})-(\w{7})-NIGHTLY".r
def date: String =
def date: LocalDate = LocalDate.parse(dateString, DateTimeFormatter.BASIC_ISO_DATE)
def dateString: String =
version match
case re(date, _) => date
case _ => sys.error(s"Could not extract date from release name: $version")
Expand Down