From 85bde83f73618d8010a92d3383c8b85c813ab4e3 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Tue, 2 Jan 2024 16:12:48 +0100 Subject: [PATCH] Fix listing release versions for bisect script. Use `maven-metadata.xml` to list released Scala versions instead of parsing HTML of Maven index. --- project/scripts/bisect.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/project/scripts/bisect.scala b/project/scripts/bisect.scala index dbb14f2c4587..9e423cf15162 100755 --- a/project/scripts/bisect.scala +++ b/project/scripts/bisect.scala @@ -169,9 +169,13 @@ class Releases(val releases: Vector[Release]) object Releases: lazy val allReleases: Vector[Release] = - val re = raw"""(?<=title=")(.+-bin-\d{8}-\w{7}-NIGHTLY)(?=/")""".r - val html = Source.fromURL("https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/") - re.findAllIn(html.mkString).map(Release.apply).toVector + val re = raw"(.+-bin-\d{8}-\w{7}-NIGHTLY)".r + val xml = io.Source.fromURL( + "https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/maven-metadata.xml" + ) + re.findAllMatchIn(xml.mkString) + .flatMap{ m => Option(m.group(1)).map(Release.apply) } + .toVector def fromRange(range: ReleasesRange): Vector[Release] = range.filter(allReleases)