fix(cards): parse HTML release-feed tables before generating Bluefin cards - #1213
fix(cards): parse HTML release-feed tables before generating Bluefin cards#1213mrbobbytables wants to merge 1 commit into
Conversation
…cards Add HTML table and section extraction to card-feed-parser.mjs so that Bluefin and Bluefin LTS release feeds containing HTML representation are parsed properly instead of skipped. Cover with real feed fixtures. Closes projectbluefin#1099 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
hanthor
left a comment
There was a problem hiding this comment.
HTML parsing is properly tested. One undisclosed behaviour change and one dead export.
Verified non-vacuous
Merged into current main:
$ npm run test:coverage # origin/main + pr1213
ℹ tests 929
ℹ pass 929
ℹ fail 0
Baseline on unmodified main is 925 / 925 / 0, so 4 net new tests, all passing. Branch coverage on the touched file genuinely improves:
main: card-feed-parser.mjs | 96.33 | 69.39 | 100.00
+pr1213: card-feed-parser.mjs | 96.33 | 80.53 | 100.00
And the new tests actually exercise the new path — disabling HTML detection kills them:
$ sed -i 's|const isHtml = /<table/i.test(content);|const isHtml = false;|' scripts/lib/card-feed-parser.mjs
$ node --test scripts/generate-card-images.test.js
(exit 1)
So the fixtures are load-bearing, not decorative. Good.
1. Undisclosed tag remap
tag = tag.replace(/^latest-(\d{8})$/, "stable-daily-$1");The description covers the HTML parsing and says "Improves stream tag and CentOS version regex matching", which fairly describes the two regex widenings (centosMatch, prefixMatch). It does not cover this line, which is not a matching improvement — it is a semantic rename of one stream to another. Anything titled latest-YYYYMMDD now resolves to the bluefin-stable-daily SBOM stream via sbomKeyForRelease, and therefore gets enriched from a different cache bucket than before.
That may well be correct — bluefin-stable-daily is a declared stream and latest-* release titles plausibly belong to it — but it changes which SBOM data lands on published cards, independent of the HTML fix. Please call it out in the description and say what motivated it, or split it out. Same for the LTS: YYYYMMDD title fallback added just below it.
2. parseTwoColTable is exported but nothing imports it
export const parseTwoColTable = parseTwoColTableMd;Grepping the tree, the only parseTwoColTable in use is a locally defined function in src/utils/parseOsRelease.ts:246, which takes a tableHtml: string — a different signature, and not imported from this module:
src/utils/parseOsRelease.ts:246:function parseTwoColTable(tableHtml: string): ParsedMajorPackage[] {
src/utils/parseOsRelease.ts:392: majorPackages = parseTwoColTable(sections.get("Major packages") ?? "");
So this alias has no consumer, and having two same-named functions with incompatible signatures in the same codebase is a trap for the next person. Either drop it, or if the intent was to converge parseOsRelease.ts onto the shared parser, do that conversion here.
3. Non-blocking
stripHtml decodes numeric entities with String.fromCharCode, which is wrong above U+FFFF. Nothing in the current fixtures needs it (the ➡️ arrow is BMP), but String.fromCodePoint is a free correctness upgrade.
A large part of the diff is prettier reformatting of untouched lines, which makes the real changes harder to spot in review — not a problem to fix now, just noting it as the reason items 1 and 2 are easy to miss.
Generated by Claude Code
Summary
Fixes #1099.
scripts/lib/card-feed-parser.mjspreviously only accepted Markdown table syntax (| --- |), causing release feeds with HTML tables (such as Atom feeds for Bluefin and Bluefin LTS) to be skipped during release card image generation.This change:
stripHtml,parseHtmlTableRows,extractSectionsHtml) toscripts/lib/card-feed-parser.mjs.parseFeedItemto support both Markdown and HTML table representations.scripts/fixtures/bluefin-releases.fixture.jsonandscripts/fixtures/bluefin-lts-releases.fixture.json) and test cases covering HTML parsing.— hive: backend=copilot model=gemini-3.8-flash
🐝 Hive Agent:
contributor| SHA:2a856872