fix(github-project): fall back when search-index lag returns zero items - #12819
fix(github-project): fall back when search-index lag returns zero items#12819innocarpe wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 20 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughProject view item requests now accept nullable search queries. GraphQL omits the search variable and argument when the query is null. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a23e44d-117e-4b1d-9e10-4b130ad84244
📒 Files selected for processing (1)
src/main/github/project-view.ts
Unfiltered Project views still query with `query:""`, which uses GitHub's search index. When a fresh board is empty only in the index, retry once with plain items(first:N) so cards appear without a misleading empty state. Preserves true empty boards and all real view filters. Fixes stablyai#12648
Only replace a successful empty search-index result when the no-search retry itself succeeds, so a rate-limit on the fallback does not turn a real empty view into an error. Fixes CodeRabbit on stablyai#12819.
f6a8ebc to
f6c8b06
Compare
Sync update (
|
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git status --short
git show --stat --oneline --decorate --no-renames f6c8b06e964a0da58ca7087696ce86a7ab6e3955
git diff f6c8b06e964a0da58ca7087696ce86a7ab6e3955^ f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- src/main/github/project-view.ts
printf '\n--- source outline ---\n'
ast-grep outline src/main/github/project-view.ts --items all --view expanded
printf '\n--- project-view test candidates ---\n'
fd -t f -i 'project-view' . | sort
printf '\n--- fallback-related references ---\n'
rg -n -C 4 'getProjectViewTable|searchQuery|totalCount|items\(first' src test tests 2>/dev/null || trueLength of output: 201138 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- commit files ---'
git diff-tree --no-commit-id --name-status -r f6c8b06e964a0da58ca7087696ce86a7ab6e3955
printf '%s\n' '--- exact commit diff ---'
git diff --no-ext-diff --unified=80 \
f6c8b06e964a0da58ca7087696ce86a7ab6e3955^ \
f6c8b06e964a0da58ca7087696ce86a7ab6e3955 \
-- src/main/github/project-view.ts
printf '%s\n' '--- focused implementation ---'
rg -n -C 35 'async function getProjectViewTable|function getProjectViewTable|const getProjectViewTable|fetch.*Project.*Items|totalCount === 0|searchQuery' \
src/main/github/project-view.ts
printf '%s\n' '--- direct test files ---'
fd -t f -e ts -e tsx . | rg '(^|/)(project-view|github-project).*(test|spec)\.(ts|tsx)$' || true
printf '%s\n' '--- focused test cases ---'
rg -n -C 18 'getProjectViewTable|totalCount === 0|fallback|no-search|query: ""|search-index' \
--glob '*.{test,spec}.{ts,tsx}' \
src/main 2>/dev/null || trueLength of output: 201421 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- changed-file patch ---'
git show --format= --no-ext-diff --unified=50 \
f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- src/main/github/project-view.ts
printf '%s\n' '--- current changed file ---'
cat -n src/main/github/project-view.ts
printf '%s\n' '--- exact project-view test candidates ---'
rg --files | rg '(^|/)project-view[^/]*\.(test|spec)\.(ts|tsx)$|(^|/)project-view\.(test|spec)\.(ts|tsx)$' || true
printf '%s\n' '--- direct references to project-view module ---'
rg -n -l -g '*.{test,spec}.ts' -g '*.{test,spec}.tsx' \
"from ['\"].*project-view['\"]|import\(['\"].*project-view['\"]\)" . || trueLength of output: 80859 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- fallback test file ---'
cat -n src/main/github/project-view-index-lag-fallback.test.ts
printf '%s\n' '--- test changes in the sync commit ---'
git show --format= --name-status \
f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- \
src/main/github/project-view-index-lag-fallback.test.ts
git show --format= --no-ext-diff --unified=30 \
f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- \
src/main/github/project-view-index-lag-fallback.test.ts
printf '%s\n' '--- targeted fallback assertions ---'
rg -n -C 8 'preferSuccessfulIndexLagFallback|fallback|empty|ok:' \
src/main/github/project-view-index-lag-fallback.test.tsLength of output: 4103
The fallback now preserves the initial successful empty result when the no-search request fails. It replaces that result only when the fallback succeeds. The added regression tests cover both paths.
|
Description
When an unfiltered Project view returns totalCount 0 via the search-index
query:""path, retry once with plainitems(first:N)so index lag does not show a false empty board.Focused fix
getProjectViewTablePreserves
queryEvidence
pnpm exec vitest run --config config/vitest.config.ts src/main/github/project-view.test.ts src/main/github/project-view-host-auth.test.ts src/main/github/project-view/mutations.test.ts(44 passed)User-regression-tradeoffs
Fixes #12648