Skip to content

Skip malformed entries in generate-results.sh#869

Merged
alexey-milovidov merged 2 commits into
mainfrom
fix-generator-skip-malformed
May 8, 2026
Merged

Skip malformed entries in generate-results.sh#869
alexey-milovidov merged 2 commits into
mainfrom
fix-generator-skip-malformed

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Summary

  • Fixes the stray undefined selector that currently appears in the System / Machine / Cluster size rows on https://benchmark.clickhouse.com/.
  • Root cause: when jq fails on a results JSON file, the previous loop still wrote the leading separator comma, producing ,, in data.generated.js. JS treats that as a sparse hole and the spread operator yields undefined, which renders as a literal undefined selector.
  • The deployed data.generated.js currently has two such holes (lines 92 and 195), so two */results/*.json files were unparseable when it was last regenerated.

Fix

Capture jq output first and only emit the separator comma plus the entry when jq succeeds; otherwise log and skip the file. The output stays free of ,, regardless of how many inputs are bad.

Test plan

  • Re-run generate-results.sh and confirm data.generated.js contains no ^,, lines.
  • Temporarily corrupt one results JSON, re-run, and confirm the file is skipped (with stderr message) and the array remains well-formed.
  • Open the rendered page and confirm no undefined entry at the end of the System / Machine / Cluster size selector rows.

🤖 Generated with Claude Code

alexey-milovidov and others added 2 commits May 8, 2026 16:06
When jq fails on a results JSON file, the previous logic still emitted the
leading comma, producing ",," in data.generated.js. That created sparse
holes in the data array, which the spread operator yielded as `undefined`
in the System / Machine / Cluster size selectors on the website.

Capture jq output first and only emit the separator comma plus the entry
when jq succeeds; otherwise log and skip the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant