From 250aa225c9ab54feeee07d7caa2867f848859dea Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 24 Oct 2026 00:47:48 +0200 Subject: [PATCH] fix: picker reads the registry's release packs --- tests/test_site_r2_components.py | 5 +++-- website/src/components/FilePicker.astro | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/test_site_r2_components.py b/tests/test_site_r2_components.py index 07cbbe09..b69543b9 100644 --- a/tests/test_site_r2_components.py +++ b/tests/test_site_r2_components.py @@ -225,8 +225,9 @@ class Picker(unittest.TestCase): self.assertNotRegex(source, r"`\$\{files\.length\} files") self.assertIn("
Terminal
", source) self.assertIn("flex-direction: column;", source) - # The size gap is the release against the current list, from release.json. - self.assertIn("import release from '../../../release.json';", source) + # The size gap is the release against the current list, from the + # release record reduced to the registry's release_pack setups. + self.assertIn("import release from '../generated/release-advertised.json';", source) self.assertIn("It was built from the list of that day.", source) diff --git a/website/src/components/FilePicker.astro b/website/src/components/FilePicker.astro index 1c09e871..e37e7daf 100644 --- a/website/src/components/FilePicker.astro +++ b/website/src/components/FilePicker.astro @@ -4,19 +4,23 @@ // which convert.py derives from install/.json. The selection // follows install.py narrow(): a file is kept when one of its systems is // chosen, a file with no system when "other" is chosen. -// The list follows the current data; release.json says what the published -// ZIP of each setup holds, so the page can say when the two differ. -import release from '../../../release.json'; +// The list follows the current data. release-advertised.json says what the +// published ZIP of each setup holds, so the page can say when the two +// differ. generate_site.py writes it from release_record.load_advertised(): +// the release record reduced to the setups the registry marks release_pack, +// the rule the setup pages and get/ pages follow. A setup the release still +// holds a pack for but the registry no longer marks gets no ZIP line here. +import release from '../generated/release-advertised.json'; const base = import.meta.env.BASE_URL.replace(/\/?$/, '/'); const packs = Object.fromEntries( - Object.values(release.packs).flatMap((pack) => + Object.values(release.packs ?? {}).flatMap((pack) => pack.platforms.map((platform) => [platform, { files: pack.files, size: pack.extracted_size }]), ), ); --- -
+