Skip malformed entries in generate-results.sh#869
Merged
Conversation
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>
# Conflicts: # generate-results.sh
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
undefinedselector that currently appears in the System / Machine / Cluster size rows on https://benchmark.clickhouse.com/.jqfails on a results JSON file, the previous loop still wrote the leading separator comma, producing,,indata.generated.js. JS treats that as a sparse hole and the spread operator yieldsundefined, which renders as a literalundefinedselector.data.generated.jscurrently has two such holes (lines 92 and 195), so two*/results/*.jsonfiles were unparseable when it was last regenerated.Fix
Capture
jqoutput first and only emit the separator comma plus the entry whenjqsucceeds; otherwise log and skip the file. The output stays free of,,regardless of how many inputs are bad.Test plan
generate-results.shand confirmdata.generated.jscontains no^,,lines.undefinedentry at the end of the System / Machine / Cluster size selector rows.🤖 Generated with Claude Code