Skip to content
Open
Show file tree
Hide file tree
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
37 changes: 33 additions & 4 deletions scripts/fetch-countme.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ const OUT = resolve(__dirname, "../static/data/countme-history.json");
const CSV_URL =
"https://data-analysis.fedoraproject.org/csv-reports/countme/totals.csv";

const VARIANTS = ["bluefin", "bluefin-lts", "aurora", "bazzite", "fedora"];
const VARIANTS = [
"bluefin",
"bluefin-lts",
"dakota",
"utah",
"aurora",
"bazzite",
"fedora",
];

/**
* How a weekly number is derived from the CSV. Stamped into the payload so a
Expand All @@ -71,9 +79,11 @@ const BASE_REPO = /^fedora-\d+$/;
/**
* Variants with no fedora-N repo, counted across their own repos instead.
* Bluefin LTS is CentOS Stream based and reaches Fedora's counter only through
* EPEL. ublue-os/countme has this same carve-out.
* EPEL. ublue-os/countme has this same carve-out. Dakota is GNOME OS based,
* assembled from source with Apache BuildStream — there are no RPMs, so it has
* no fedora-N repo either.
*/
const NON_FEDORA_VARIANTS = new Set(["bluefin-lts"]);
const NON_FEDORA_VARIANTS = new Set(["bluefin-lts", "dakota"]);

/**
* Weeks upstream got wrong, skipped exactly as ublue-os/countme skips them.
Expand Down Expand Up @@ -169,7 +179,10 @@ export function parseCsvLine(line) {
* Returns null for unrecognised names — bucketing an unknown OS into a variant
* would inflate the headline number.
*
* ORDER MATTERS: LTS checks before generic bluefin.
* ORDER MATTERS: LTS, Dakota, and Utah check before generic bluefin. Dakota and
* Utah are Bluefin variants whose os_name carries a "bluefin-" prefix (e.g.
* "bluefin-dakota", "bluefin-utah"), so the broad startsWith("bluefin") branch
* would otherwise fold them into flagship Bluefin.
*/
export function normalizeVariant(osName) {
if (osName == null) return null;
Expand All @@ -184,6 +197,22 @@ export function normalizeVariant(osName) {
)
return "bluefin-lts";

// Dakota — GNOME OS / Apache BuildStream distroless prototype.
if (
s.includes("dakotaraptor") ||
s.startsWith("bluefin-dakota") ||
s.startsWith("dakota")
)
return "dakota";

// Utah — Fedora Hummingbird base with the GNOME 51 desktop stack.
if (
s.includes("utahraptor") ||
s.startsWith("bluefin-utah") ||
s.startsWith("utah")
)
return "utah";

if (s.startsWith("bluefin")) return "bluefin";
if (s.startsWith("aurora")) return "aurora";
if (s.startsWith("bazzite")) return "bazzite";
Expand Down
37 changes: 37 additions & 0 deletions scripts/fetch-countme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ test("normalizeVariant returns bluefin-lts for Bluefin LTS, not bluefin", () =>
assert.notEqual(normalizeVariant("Bluefin LTS"), "bluefin");
});

test("normalizeVariant recognises Dakota without folding it into flagship Bluefin", () => {
assert.equal(normalizeVariant("Dakota"), "dakota");
assert.equal(normalizeVariant("bluefin-dakota"), "dakota");
assert.equal(normalizeVariant("Dakotaraptor"), "dakota");
assert.notEqual(normalizeVariant("bluefin-dakota"), "bluefin");
});

test("normalizeVariant recognises Utah without folding it into flagship Bluefin", () => {
assert.equal(normalizeVariant("Utah"), "utah");
assert.equal(normalizeVariant("bluefin-utah"), "utah");
assert.equal(normalizeVariant("Utahraptor"), "utah");
assert.notEqual(normalizeVariant("bluefin-utah"), "bluefin");
});

// ── aggregateWeeks ───────────────────────────────────────────────────────
//
// The rules under test are ported from ublue-os/countme:data_processing.py.
Expand Down Expand Up @@ -180,6 +194,29 @@ test("aggregateWeeks counts Bluefin LTS across its own repos, having no fedora-N
assert.equal(weeks[0].bluefin, undefined);
});

test("aggregateWeeks counts Dakota across its own repos, having no fedora-N repo", () => {
// Dakota is GNOME OS assembled from source with Apache BuildStream — there
// are no RPMs, so it has no fedora-N repo to restrict to.
const rows = parseAll([
row({ os_name: "bluefin-dakota", repo_tag: "gnome-os", hits: 20 }),
row({ os_name: "bluefin-dakota", repo_tag: "gnome-os-testing", hits: 3 }),
]);
const weeks = aggregateWeeks(rows);
assert.equal(weeks[0].dakota, 23);
assert.equal(weeks[0].bluefin, undefined);
});

test("aggregateWeeks counts Utah restricted to its fedora-N repo", () => {
const rows = parseAll([
row({ os_name: "bluefin-utah", repo_tag: "fedora-44", hits: 8 }),
// A non-base repo hit from the same system must not double count.
row({ os_name: "bluefin-utah", repo_tag: "updates-released-f44", hits: 8 }),
]);
const weeks = aggregateWeeks(rows);
assert.equal(weeks[0].utah, 8);
assert.equal(weeks[0].bluefin, undefined);
});

test("aggregateWeeks skips the two weeks upstream got wrong", () => {
// 2024-12-29 is a partial year-end week; 2025-07-06 is a Fedora
// infrastructure migration that shows as a ~40% drop.
Expand Down