From 39a0f6390e8b04ca3e3f4e29b92fd7d3f56bf378 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Wed, 12 Aug 2026 14:49:39 +0200 Subject: [PATCH] build: skip prometheus v0 releases during doc import Some releases have version strings that are not semver compatible, e.g. v0.18.0rc1. Signed-off-by: Jan Fajerski --- scripts/fetch-repo-docs.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-repo-docs.ts b/scripts/fetch-repo-docs.ts index 87acd79b9..b8e98c2b6 100644 --- a/scripts/fetch-repo-docs.ts +++ b/scripts/fetch-repo-docs.ts @@ -113,10 +113,15 @@ const fetchRepoDocs = async ({ const allReleaseTags: string[] = []; for await (const { data: releases } of iterator) { - allReleaseTags.push(...releases.map((r) => r.tag_name)); + // Skip ancient releases. Some have non-semver compatible strings and the + // version comparison below breaks. Also note the lack of `v` in the tag. + const validReleases = (repo === "prometheus") + ? releases.filter((r) => !r.tag_name.startsWith("0.")) + : releases; + + allReleaseTags.push(...validReleases.map((r) => r.tag_name)); // For the Prometheus repo for efficieny-reasons, stop once we have found at least // one release starting with "v1.". - // Note: releases are sorted by date, so this works ok. // TODO: Do we even still want to show the latest v1 release? if ( owner === "prometheus" &&