Repository navigation
fix(benchmark): keep the landing build and lint passing after a benchmark refresh - #1005
Merged
Merged
Conversation
The first benchmark refresh (db50062) rewrote benchmark-results.json in the current format, where clientBytes and sizes are filled in, while the frozen e2e fixture still has them null. benchmark-data.ts typed both as `typeof live`, so the fixture no longer matched and every landing build failed type checking. The page now declares only the fields Bench reads, which both files have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
formatJson put each item of a too-long array on its own line, but Prettier fills arrays of numbers several to a line. The first refresh therefore committed a benchmark/history.json that `bun run lint` rejects. Long number arrays are now filled the same way, and history.json is rewritten with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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
The first automatic benchmark refreshes (from #985) broke two checks for every PR. This fixes both.
1. Landing build: type error
benchmark-results.jsonin the current format, whereclientBytesandsizesare filled in. The frozen e2e fixture still has themnull, andbenchmark-data.tstyped both files astypeof live.benchmark-data.tsnow declares aBenchmarkResultsinterface with only the fieldsBench.tsxreads. A later refresh that changes other fields can no longer break the build, and rendering is unchanged.2.
bun run lint: Prettier rejectsbenchmark/history.jsonformatJsonputs every item of a too-long array on its own line, but Prettier fills arrays of numbers several to a line.formatJsonnow fills long number arrays the way Prettier does. Long string arrays stay one per line, as Prettier prints them.history.jsonis rewritten with the new formatter, including the entry main's latest refresh added.Verification
tsc --noEmitinapps/landing: thebenchmark-data.tserror is gone; before this change it is reported.prettier --check benchmark/history.json benchmark-results.jsonpasses, and the formatter's output for a synthetic deep array also passesprettier --check.benchmark-record.test.ts: 27 pass, andbenchmark-record.jshas 100% coverage. The format test now expects Prettier's fill, and the "checked files are formatted as written" test passes.요약
첫 자동 벤치마크 갱신(#985) 이후 모든 PR에서 검사 두 개가 깨졌고, 이 PR이 둘 다 고칩니다.
1. 랜딩 빌드 타입 에러
benchmark-results.json을 최신 형식으로 다시 썼고, 이 형식에서는clientBytes와sizes에 값이 들어 있습니다. 고정된 e2e fixture는 이 두 필드가 아직null인데,benchmark-data.ts가 두 파일을typeof live하나로 묶고 있었습니다.Bench.tsx가 실제로 읽는 필드만 담은BenchmarkResults인터페이스를 선언했습니다. 앞으로 갱신이 다른 필드를 바꿔도 빌드가 깨지지 않고, 화면 결과는 바뀌지 않습니다.2.
bun run lint: Prettier가benchmark/history.json을 거부formatJson은 한 줄에 안 들어가는 배열을 항목마다 한 줄씩 썼습니다. 그런데 Prettier는 숫자 배열을 한 줄에 여러 개씩 채워 씁니다.formatJson이 긴 숫자 배열을 Prettier와 똑같이 채워 씁니다. 긴 문자열 배열은 Prettier처럼 한 줄에 하나씩 그대로 둡니다. main의 최근 갱신이 추가한 항목까지 포함해history.json을 새 포매터로 다시 썼습니다.검증
apps/landing에서tsc --noEmit을 돌리면benchmark-data.ts에러가 사라졌습니다. 수정 전에는 이 에러가 나옵니다.prettier --check benchmark/history.json benchmark-results.json이 통과합니다. 깊게 중첩된 배열을 합성해 포매터로 쓴 결과도prettier --check를 통과합니다.benchmark-record.test.ts는 27개가 통과하고,benchmark-record.js커버리지는 100%입니다. 포맷 테스트는 이제 Prettier의 채워 쓰기를 기대하고, "체크인된 파일이 포매터 출력과 같은지" 확인하는 테스트도 통과합니다.🤖 Generated with Claude Code