diff --git a/scripts/fetch-pin-state.js b/scripts/fetch-pin-state.js index 37e340a6..53400afd 100644 --- a/scripts/fetch-pin-state.js +++ b/scripts/fetch-pin-state.js @@ -1,8 +1,9 @@ /** * fetch-pin-state.js * - * Reads bluefin-lts HWE workflow YAML files from the GitHub Contents API - * and extracts any `kernel-pin` (or future `*-pin`) workflow inputs. + * Reads the active bluefin-lts build workflow YAML from the GitHub Contents + * API and extracts any `kernel_pin` (or future `*_pin`) input passed to the + * shared projectbluefin/actions reusable-build.yml workflow. * Writes static/data/stream-pins.json consumed by the docs UI to render * 📌 "Pinned" badges next to intentionally-held component versions. * @@ -17,12 +18,10 @@ const OUTPUT_FILE = path.join(__dirname, "..", "static", "data", "stream-pins.js const WORKFLOWS_TO_CHECK = [ { repo: "projectbluefin/bluefin-lts", - path: ".github/workflows/build-regular-hwe.yml", - stream: "bluefin-lts", - }, - { - repo: "projectbluefin/bluefin-lts", - path: ".github/workflows/build-dx-hwe.yml", + // bluefin-lts is HWE-only (no separate build-regular-hwe.yml/build-dx-hwe.yml + // since #437); build-regular.yml is the active workflow and passes an optional + // `kernel_pin` input to the shared reusable-build.yml when a kernel is pinned. + path: ".github/workflows/build-regular.yml", stream: "bluefin-lts", }, ]; @@ -47,11 +46,11 @@ async function fetchWorkflowContent(repo, filePath) { } /** - * Extract `kernel-pin` value from a workflow YAML string. - * Matches the pattern: kernel-pin: + * Extract `kernel_pin` value from a workflow YAML string. + * Matches the pattern: kernel_pin: */ function extractKernelPin(yamlContent) { - const match = yamlContent.match(/kernel-pin:\s*([^\s\n#]+)/); + const match = yamlContent.match(/kernel_pin:\s*([^\s\n#]+)/); return match ? match[1].trim() : null; } @@ -89,7 +88,7 @@ async function main() { if (kernelPin) { console.log(` ${stream} hweKernel pin: ${kernelPin}`); } else { - console.log(` ${stream}: no kernel-pin found (floating)`); + console.log(` ${stream}: no kernel_pin found (floating)`); } } catch (err) { console.warn(` Warning: could not fetch ${repo}/${filePath}: ${err.message}`); diff --git a/scripts/fetch-pin-state.test.js b/scripts/fetch-pin-state.test.js index beab02a9..53cabca2 100644 --- a/scripts/fetch-pin-state.test.js +++ b/scripts/fetch-pin-state.test.js @@ -6,21 +6,21 @@ const { extractKernelPin, } = require("./fetch-pin-state.js"); -test("extractKernelPin reads kernel-pin values and ignores missing pins", () => { - assert.equal(extractKernelPin("kernel-pin: 6.12.30-204 # comment"), "6.12.30-204"); - assert.equal(extractKernelPin("name: build-regular-hwe"), null); +test("extractKernelPin reads kernel_pin values and ignores missing pins", () => { + assert.equal(extractKernelPin("kernel_pin: 6.12.30-204 # comment"), "6.12.30-204"); + assert.equal(extractKernelPin("name: build-regular"), null); }); test("applyKernelPin stores a stream pin and rejects conflicting values", () => { const streamPins = {}; - applyKernelPin(streamPins, "bluefin-lts", "6.12.30-204", "build-regular-hwe.yml"); + applyKernelPin(streamPins, "bluefin-lts", "6.12.30-204", "build-regular.yml"); assert.deepEqual(streamPins, { "bluefin-lts": { hweKernel: "6.12.30-204" }, }); assert.throws( - () => applyKernelPin(streamPins, "bluefin-lts", "6.12.31-204", "build-dx-hwe.yml"), + () => applyKernelPin(streamPins, "bluefin-lts", "6.12.31-204", "build-regular.yml"), /Conflicting hweKernel pins/, ); }); diff --git a/static/data/stream-pins.json b/static/data/stream-pins.json index 2d9fb50a..73638d15 100644 --- a/static/data/stream-pins.json +++ b/static/data/stream-pins.json @@ -1,6 +1,7 @@ { - "generatedAt": "2026-07-21T05:48:34.788Z", + "generatedAt": "2026-09-08T15:03:46.365Z", "streams": { + "bluefin-lts": {}, "bluefin-stable": {} } }