Skip to content

fix(website): FilePathMenu in-app menu tests -- stub the batched kind probe, not the per-path one - #19288

Merged
iamwhatever merged 1 commit into
mainfrom
unflaky/filepathmenu-inapp-main-red
Oct 12, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
unflaky/filepathmenu-inapp-main-red

Conversation

@CrysisDeu

Copy link
Copy Markdown
Contributor

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 in website/src/test/FilePathMenu.inApp.test.tsx › path chip menu threads the renderer handlers fail with AssertionError: expected null not to be null: the path chip never resolves to data-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

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 an X-Path-Kind header) with one POST /api/file-kinds batch answered in a JSON body, and moved every chip test onto the shared src/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 stubs globalThis.fetch with the old per-path protocol, so the batched probe gets a 404, the chip is classified as missing, and the test's waitFor for a resolved chip times out.

The fix is the same move every other chip test already made: stubKind() now calls stubPathKinds() from ./pathKindStub, answering null for a path:12 literal so the citation still resolves to the file plus its cited line, exactly as the old stub did.

before after
request stubbed HEAD …?path= + X-Path-Kind header POST /api/file-kinds batch
stub source hand-rolled in this file shared pathKindStub.ts
tests 4 failed, 10 passed 14 passed

Backwards 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 four path chip menu threads the renderer handlers tests now reach the chip's context menu and lock in that a transcript chip's menu carries the renderer's onFileOpen/onFolderOpen handlers (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 parent origin/main (8f6baa0) the same command → 4 failed, 10 passed, deterministically.
  • Five shuffled runs with the sibling files FilePathMenu.test.tsx, MarkdownRenderer.contextmenu.test.tsx, MarkdownRenderer.folderChip.test.tsx in one worker (--sequence.shuffle --no-file-parallelism, seeds 1791784089243, 1791784099964, 1791784110713, 1791784121457, 1791784132389) → 71 passed each time.
  • npx tsc -p tsconfig.app.json and npx eslint on 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.fetch for the kind probe instead of using pathKindStub.ts is the tell.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@CrysisDeu
CrysisDeu requested review from a team and KiroCrewCaptain as code owners October 12, 2026 06:04
@CrysisDeu
CrysisDeu requested a review from bolichen97 October 12, 2026 06:04
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 9b233c63026711550229d1319bfb9e3ab036bea2 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9b233c63026711550229d1319bfb9e3ab036bea2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 9b233c63026711550229d1319bfb9e3ab036bea2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9b233c63026711550229d1319bfb9e3ab036bea2 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9b233c6

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9b233c63026711550229d1319bfb9e3ab036bea2: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9b233c63026711550229d1319bfb9e3ab036bea2 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9b233c6

Verdict parsed from the review's SHA-scoped output markers for commit 9b233c63026711550229d1319bfb9e3ab036bea2.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9b233c63026711550229d1319bfb9e3ab036bea2: <one-sentence reason>

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Status on head 0db6184: every lane is green except Backend Tests (Windows) (1), which fails on the three test/test_app_cron_timeout_manifest.py tests from #19278 — main's own red, unrelated to this diff (test-only, website/). #19280 fixes it; this PR waits for that to merge, then rebases. No rerun, no override.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@buluoray
buluoray enabled auto-merge (squash) October 12, 2026 06:37
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@CrysisDeu
CrysisDeu force-pushed the unflaky/filepathmenu-inapp-main-red branch from 0db6184 to 9b233c6 Compare October 12, 2026 06:54
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Rebased onto main @ 52c3283 (carries #19280, the fix for the Windows shard-1 red). Head 9b233c6; the diff is unchanged from the approved head 0db6184 (one test-only hunk). #19298 is an independent, equivalent fix for the same break.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 12, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Status on head 9b233c6: every lane green except Backend Tests (Windows) (2), red on test/test_wait_discipline_ratchet.py::test_no_file_gains_a_short_fixed_wait — main's own red, tracked as #19317 (six test files merged after #19248's baseline). Reproduced on this worktree, which is main plus one website/ test hunk; this diff touches no Python. Waiting for the #19317 fix to land, then rebasing. No rerun, no override.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@iamwhatever
iamwhatever disabled auto-merge October 12, 2026 07:51
@iamwhatever
iamwhatever merged commit 0a47021 into main Oct 12, 2026
100 of 102 checks passed
@iamwhatever
iamwhatever deleted the unflaky/filepathmenu-inapp-main-red branch October 12, 2026 07:51
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 12, 2026
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.

main is red: FilePathMenu.inApp.test.tsx chip tests stub the per-path kind probe that #18734 replaced with a batch

3 participants