test(frontend): await diagram data before search assertion (deflake main) - #738
test(frontend): await diagram data before search assertion (deflake main)#738seonghobae wants to merge 3 commits into
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
Pull request was converted to draft
…mer tests Same race as the diagram-search flake: four tests click the first 열기 button immediately after navigating to 다이어그램, before the async snapshot list has rendered. Wait for the buttons (real timers) before enabling fake timers, matching the guard already used elsewhere in this file. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@coderabbitai review Please review exact current head |
|
@opencode-agent Please review exact current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='60b482da234158ab0aca53a5f4a4c1da46127fcc'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
if [ "$actual" != "$expected" ]; then
echo 'ERROR: checked-out HEAD does not match the requested commit' >&2
exit 1
fi
echo '--- changed files and diff against first parent ---'
git diff --stat HEAD^ HEAD
git diff --find-renames --unified=80 HEAD^ HEAD -- frontend/src/App.coverage.test.tsx
echo '--- AST outline: affected test file ---'
ast-grep outline frontend/src/App.coverage.test.tsx --items all --view expanded
echo '--- empty-state and diagram search references ---'
rg -n -C 4 --glob '*.{ts,tsx}' \
'아직 다이어그램 스냅샷이 없습니다|다이어그램 검색' frontendLength of output: 20002 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- commit metadata ---'
git show -s --format='commit=%H%nparent=%P%nsubject=%s%nbody=%b' HEAD
echo '--- diagram-search test: parent versus current ---'
for revision in HEAD^ HEAD; do
echo "### $revision: frontend/src/App.coverage.test.tsx Lines 315-342"
git show "${revision}:frontend/src/App.coverage.test.tsx" | sed -n '315,342p'
done
echo '--- current changed test blocks ---'
sed -n '585,790p' frontend/src/App.coverage.test.tsx
echo '--- test setup and async API mocks ---'
sed -n '248,315p' frontend/src/App.coverage.test.tsx
echo '--- PR metadata ---'
gh pr view 738 --repo ContextualWisdomLab/pg-erd-cloud \
--json number,title,baseRefOid,headRefOid,commits \
--jq '{number,title,baseRefOid,headRefOid,commits:[.commits[]|{oid:.oid,messageHeadline:.messageHeadline}]}'Length of output: 17183 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='72afe6db712b145baaba084f64a1ff4fb36d9fd0'
head='60b482da234158ab0aca53a5f4a4c1da46127fcc'
echo '--- complete PR diff: base to requested head ---'
git diff --check "$base" "$head"
git diff --stat "$base" "$head"
git diff --unified=30 "$base" "$head" -- frontend/src/App.coverage.test.tsx
echo '--- readiness-guard pattern in the coverage test ---'
rg -n -C 2 --glob 'App.coverage.test.tsx' \
"waitFor\\(\\(\\) => expect\\(screen\\.getAllByRole\\('button', \\{ name: '열기' \\}\\)\\.length\\)\\.toBeGreaterThan\\(0\\)\\)" \
frontend/src
echo '--- current PR check summary ---'
gh pr checks 738 --repo ContextualWisdomLab/pg-erd-cloudLength of output: 20630
No findings remain. The PR waits for snapshot-list readiness before the diagram search. It also applies the same guard before fake timers in related diagram-opening tests. The complete base-to-head diff only changes [approve] You are interacting with an AI system. |
|
@cwl-noema-review Please independently review exact current head |
Pull request was converted to draft
|
@opencode-agent Please review exact head |
|
@cwl-noema-review Please independently review exact head |
|
@opencode-agent @cwl-noema-review Please independently review exact current head |
|
@opencode-agent @cwl-noema-review Please perform a fresh independent review of current head |
|
@coderabbitai review Please review the exact live head only. Verify the frontend flake is removed by waiting for the asynchronous diagram snapshot state before search assertions, without weakening the assertion, adding sleeps, or changing production behavior. Require current frontend typecheck, complete tests and 100% configured coverage, production build, security gates, and zero unresolved actionable threads. Review only; do not update the branch, merge, release, or alter protections. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/pg-erd-cloud'
pr='738'
echo '--- live pull request metadata ---'
gh pr view "$pr" --repo "$repo" \
--json number,title,state,isDraft,baseRefOid,headRefOid,mergeStateStatus,reviewDecision \
--jq '{number,title,state,isDraft,baseRefOid,headRefOid,mergeStateStatus,reviewDecision}'
live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
local_head="$(git rev-parse HEAD)"
printf '\n--- head verification ---\nlive_head=%s\nchecked_out_head=%s\n' "$live_head" "$local_head"
if [ "$live_head" != "$local_head" ]; then
echo 'ERROR: checked-out repository does not match the live PR head.' >&2
exit 2
fi
base="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"
echo '--- complete base-to-head diff summary ---'
git diff --check "$base" "$live_head"
git diff --stat "$base" "$live_head"
git diff --name-status "$base" "$live_head"
echo '--- affected file outline ---'
ast-grep outline frontend/src/App.coverage.test.tsx --items all --view expanded
echo '--- complete pull request diff ---'
git diff --find-renames --unified=40 "$base" "$live_head" -- frontend/src/App.coverage.test.tsx
echo '--- async readiness, search, and assertion references ---'
rg -n -C 5 --glob 'App.coverage.test.tsx' \
"waitFor\(|다이어그램 검색|아직 다이어그램 스냅샷이 없습니다|fireEvent\.change|expect\(" \
frontend/src/App.coverage.test.tsx
echo '--- current check results ---'
gh pr checks "$pr" --repo "$repo" --json name,state,link,workflow \
--jq '.[] | {name,state,workflow,link}'
echo '--- review threads ---'
gh api graphql -F owner='ContextualWisdomLab' -F name='pg-erd-cloud' -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
path
line
comments(first: 10) {
nodes { author { login } body }
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] |
select(.isResolved == false) |
{isOutdated,path,line,comments:[.comments.nodes[]|{author:.author.login,body:.body}]}'Length of output: 46211 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/pg-erd-cloud'
pr='738'
head='60b482da234158ab0aca53a5f4a4c1da46127fcc'
echo '--- frontend workflow job steps and conclusions ---'
gh run view 30888424270 --repo "$repo" --json jobs \
--jq '.jobs[] | select(.name == "frontend") | {name,conclusion,startedAt,completedAt,steps:[.steps[]|{name,conclusion}]}'
echo '--- locate frontend CI configuration and package manifests ---'
fd -HI -t f '^(package\.json|pnpm-lock\.yaml|yarn\.lock|package-lock\.json|.*\.(yml|yaml))$' . \
| sed -n '1,240p'
echo '--- frontend package test, typecheck, coverage, and build scripts ---'
if [ -f frontend/package.json ]; then
jq '{scripts,devDependencies,dependencies}' frontend/package.json
fi
echo '--- workflow commands that invoke frontend validation ---'
rg -n -i -C 4 \
'(frontend|typecheck|type-check|coverage|vitest|test:|build)' \
.github 2>/dev/null || true
echo '--- asynchronous snapshot fixture and surrounding test setup ---'
sed -n '248,310p' frontend/src/App.coverage.test.tsx
echo '--- exact changed test block at current head ---'
sed -n '315,345p' frontend/src/App.coverage.test.tsx
echo '--- confirm the live head has not changed during review ---'
current_live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
printf 'expected=%s\nlive_now=%s\n' "$head" "$current_live_head"
test "$current_live_head" = "$head"Length of output: 11561 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/pg-erd-cloud'
pr='738'
head='60b482da234158ab0aca53a5f4a4c1da46127fcc'
run='30888422764'
echo '--- coverage-evidence job steps and conclusions ---'
gh run view "$run" --repo "$repo" --json jobs \
--jq '.jobs[] | select(.name == "coverage-evidence") |
{name,conclusion,startedAt,completedAt,steps:[.steps[]|{name,conclusion}]}'
echo '--- OpenCode Review workflow coverage references ---'
gh api "repos/$repo/actions/workflows" --paginate \
--jq '.workflows[] | select(.name == "OpenCode Review") | {id,path,name}' \
> /tmp/opencode-workflow.json
cat /tmp/opencode-workflow.json
workflow_path="$(jq -r .path /tmp/opencode-workflow.json)"
if [ -n "$workflow_path" ] && [ "$workflow_path" != "null" ]; then
echo "--- $workflow_path coverage configuration ---"
git show "HEAD:$workflow_path" | grep -n -i -C 5 'coverage\|threshold\|100' || true
fi
echo '--- coverage configuration files ---'
fd -HI -t f . frontend \
| grep -Ei '(vitest|vite|coverage|test).*\.(ts|tsx|js|mjs|cjs|json)$' \
| sort
for file in $(fd -HI -t f . frontend | grep -Ei '(vitest|vite|coverage|test).*\.(ts|tsx|js|mjs|cjs|json)$' | sort); do
if [ "$(basename "$file")" != "App.coverage.test.tsx" ]; then
echo "--- $file ---"
sed -n '1,220p' "$file"
fi
done
echo '--- current PR check state for coverage evidence ---'
gh pr checks "$pr" --repo "$repo" --json name,state,workflow \
--jq '.[] | select(.name == "coverage-evidence" or .name == "frontend") | {name,state,workflow}'
echo '--- final live-head verification ---'
live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
printf 'reviewed=%s\nlive_now=%s\n' "$head" "$live_head"
test "$live_head" = "$head"Length of output: 2241 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/pg-erd-cloud'
pr='738'
head='60b482da234158ab0aca53a5f4a4c1da46127fcc'
job_id='91932487236'
echo '--- coverage-evidence GitHub Actions job ---'
gh api "repos/$repo/actions/jobs/$job_id" \
--jq '{id,name,status,conclusion,started_at,completed_at,steps:[.steps[]|{name,status,conclusion,number}]}'
echo '--- coverage-evidence check-run output ---'
gh api "repos/$repo/check-runs/$job_id" \
--jq '{id,name,status,conclusion,details_url,output:{title:.output.title,summary:.output.summary,text:.output.text}}'
echo '--- local frontend coverage configuration ---'
fd -HI -t f . frontend | grep -Ei '(vitest|vite|coverage).*\.(ts|tsx|js|mjs|cjs|json)$' | sort | while IFS= read -r file; do
echo "--- $file ---"
sed -n '1,240p' "$file"
done
echo '--- current relevant check states ---'
gh pr checks "$pr" --repo "$repo" --json name,state,workflow \
--jq '.[] | select(.name == "frontend" or .name == "coverage-evidence" or .name == "dependency-review" or .name == "Semgrep OSS" or .name == "Semgrep (multi-language SAST)" or .name == "strix" or .name == "osv-scan" or .name == "trivy-fs" or .name == "Analyze (javascript-typescript)" or .name == "Analyze (python)") | {name,state,workflow}'
echo '--- final live-head verification ---'
live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
printf 'reviewed=%s\nlive_now=%s\n' "$head" "$live_head"
test "$live_head" = "$head"Length of output: 45674
The test-only change correctly waits for the asynchronous diagram snapshot state before it changes Frontend type checking, complete frontend tests, and the production build passed. Current security and static-analysis checks passed. No unresolved review threads were returned. I cannot approve under the requested coverage requirement.
|
|
Exact-current-head review request for @coderabbitai review Do not modify the branch, bypass protection, merge, tag, release, or publish. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/pg-erd-cloud'
pr='738'
expected='60b482da234158ab0aca53a5f4a4c1da46127fcc'
echo '--- live pull request metadata ---'
gh pr view "$pr" --repo "$repo" \
--json number,state,isDraft,baseRefOid,headRefOid,mergeStateStatus,reviewDecision \
--jq '{number,state,isDraft,baseRefOid,headRefOid,mergeStateStatus,reviewDecision}'
live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
local_head="$(git rev-parse HEAD)"
printf '\n--- head verification ---\nexpected=%s\nlive=%s\nchecked_out=%s\n' \
"$expected" "$live_head" "$local_head"
test "$live_head" = "$expected"
test "$local_head" = "$expected"
base="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"
echo '--- complete base-to-head change set ---'
git diff --check "$base" "$expected"
git diff --stat "$base" "$expected"
git diff --name-status "$base" "$expected"
git diff --unified=50 "$base" "$expected" -- frontend/src/App.coverage.test.tsx
echo '--- affected test-file outline ---'
ast-grep outline frontend/src/App.coverage.test.tsx --items all --view expanded
echo '--- async test setup and changed-test context ---'
sed -n '240,360p' frontend/src/App.coverage.test.tsx
sed -n '580,800p' frontend/src/App.coverage.test.tsx
echo '--- readiness waits, search events, and relevant assertions ---'
rg -n -C 4 --glob 'App.coverage.test.tsx' \
"waitFor\\(|다이어그램 검색|아직 다이어그램 스냅샷이 없습니다|fireEvent\\.change|expect\\(" \
frontend/src/App.coverage.test.tsx
echo '--- current required check results ---'
gh pr checks "$pr" --repo "$repo" --json name,state,workflow,link \
--jq '.[] | {name,state,workflow,link}'
echo '--- unresolved review threads ---'
gh api graphql -F owner='ContextualWisdomLab' -F name='pg-erd-cloud' -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
path
line
comments(first: 10) {
nodes { author { login } body }
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] |
select(.isResolved == false) |
{isOutdated,path,line,comments:[.comments.nodes[]|{author:.author.login,body:.body}]}'
echo '--- final live-head verification ---'
final_live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
printf 'reviewed=%s\nlive_now=%s\n' "$expected" "$final_live_head"
test "$final_live_head" = "$expected"Length of output: 63169
No blocking findings remain. The PR changes only The added readiness waits use rendered UI state. They do not use arbitrary sleeps. The change does not modify production code. The frontend, security, Semgrep, CodeQL, and CodeRabbit checks are successful. No unresolved review threads remain. [approve] You are interacting with an AI system. |
|
Queued @cwl-noema-review for PR #738 at head |
|
Queued @cwl-noema-review for PR #738 at head |
Summary
The test
navigates dashboard, project, and diagram states including empty/search branchesinfrontend/src/App.coverage.test.tsxis flaky onmain: it fires the diagram search (fireEvent.changeon다이어그램 검색) before the async snapshot list has loaded, so the assertion intermittently sees the empty state instead of search results. This has been failing the frontend job on unrelated PRs — e.g. the docs-only #735.Fix
Cherry-pick of the single test hunk from commit 06a7eae on #700 (
bolt/optimize-handle-lookup-17383827529551263442):await waitForfor the empty-state text (아직 다이어그램 스냅샷이 없습니다...) to disappear before firing the search.waitForwas already imported.#700 is still open with checks stalled, so this lands the deflake standalone to stop the queue-wide flake; #700's own copy of the hunk will no-op on merge.
🤖 Generated with Claude Code