Repository navigation
fix(website): FilePathMenu in-app menu tests -- stub the batched kind probe, not the per-path one - #19288
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 9b233c6 Description read[DESCRIPTION-READ] ba7a31bc3bbcd380482e687e374fa1cd3e3c3695546f883f715b11929e70772e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. [UX-REVIEWED] 9b233c6 Description read[DESCRIPTION-READ] 461c7799ceec84ef38b0c8eb576a66b8075cc9c88d43252dda160bf0b8777885 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
Status on head 0db6184: every lane is green except |
buluoray
left a comment
There was a problem hiding this comment.
Approving at 0db6184. This fixes the frontend red on main: #19121 stubbed the old per-path HEAD /api/file-read probe, but chips now use the batched POST /api/file-kinds, so four FilePathMenu.inApp.test.tsx tests fail (Frontend Tests shard 4 and Coverage Gate on 8f6baa0). Switching to the shared stubPathKinds helper is correct: null maps to missing, so the path:12 literal still resolves to the file plus its line. The only red on this head is Backend Tests (Windows) (1), which is the inherited test_app_cron_timeout_manifest.py failure fixed by #19280. #19298 is the same change opened later; this one came first.
0db6184 to
9b233c6
Compare
|
Status on head 9b233c6: every lane green except |
Problem / Motivation
Goal: Main's frontend suite is green again, so every open PR stops inheriting four red tests it did not cause.
Frontend Tests (4)is red on main. Four tests inwebsite/src/test/FilePathMenu.inApp.test.tsx›path chip menu threads the renderer handlersfail withAssertionError: expected null not to be null: the path chip never resolves todata-path-kind="file"(or"dir"), so the right-click menu is never reached. Red on main run 38206449233 and on two unrelated PR heads rebased onto it.Why it matters
CI tests the merge of a branch with main, so every PR that rebases onto current main turns red on a shard it never touched. Until the fix lands, no frontend PR can go green honestly.
Not a goal
usePathKind,InlineCode,FilePathMenuor any product code. The batched kind probe from perf(dashboard): resolve transcript path kinds in one batched request #18734 and the in-app rows from feat(website): add in-app open rows to the file-path menu #19121 are both correct.What changed (motivation → approach → change)
Two PRs landed in an order their reviews never saw. #18734 replaced the per-path
HEAD /api/file-read?path=…probe (answered with anX-Path-Kindheader) with onePOST /api/file-kindsbatch answered in a JSON body, and moved every chip test onto the sharedsrc/test/pathKindStub.ts. #19121 was written before that and merged eleven hours after it on a stale green: its last test run built its merge ref on a base without #18734. Its new test still stubsglobalThis.fetchwith the old per-path protocol, so the batched probe gets a 404, the chip is classified as missing, and the test'swaitForfor a resolved chip times out.The fix is the same move every other chip test already made:
stubKind()now callsstubPathKinds()from./pathKindStub, answeringnullfor apath:12literal so the citation still resolves to the file plus its cited line, exactly as the old stub did.HEAD …?path=+X-Path-KindheaderPOST /api/file-kindsbatchpathKindStub.tsBackwards compatibility
Compatible: test-only change; no product code or contract moves.
Removes nothing: the hand-rolled stub is replaced by the shared one that every other chip test uses.
Tests
website/src/test/FilePathMenu.inApp.test.tsx: the fourpath chip menu threads the renderer handlerstests now reach the chip's context menu and lock in that a transcript chip's menu carries the renderer'sonFileOpen/onFolderOpenhandlers (file with cited line, containing folder, directory, and the native-only menu when no handlers are passed).Determinism proof on this head (
cd website):npx vitest run src/test/FilePathMenu.inApp.test.tsx→ 14 passed. On the parentorigin/main(8f6baa0) the same command → 4 failed, 10 passed, deterministically.FilePathMenu.test.tsx,MarkdownRenderer.contextmenu.test.tsx,MarkdownRenderer.folderChip.test.tsxin one worker (--sequence.shuffle --no-file-parallelism, seeds 1791784089243, 1791784099964, 1791784110713, 1791784121457, 1791784132389) → 71 passed each time.npx tsc -p tsconfig.app.jsonandnpx eslinton the file: clean.Manual verification
N/A — unit coverage sufficient: the diff touches only a test's fetch stub, and the test itself is the proof.
Related Issues
Fixes #19284
Same shape as #19278.
Pattern harvest
Rule candidate: review-prompt
Pattern: a PR merged on a green older than a base commit that changed a request protocol its new test stubs by hand; a test that stubs
globalThis.fetchfor the kind probe instead of usingpathKindStub.tsis the tell.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)