Repository navigation
fix(github): list default issues via REST so account mismatches surface errors (#16244) - #16294
adityachaudhary99 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe change adds Merge Risk: 🔴 Critical · up to The current change references an undeclared query while constructing the PR request, creating a build/type-check blocker. Define a valid query before merging. 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 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
🧹 Nitpick comments (1)
src/main/github/client/list/work-item-list-request.ts (1)
103-108: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReduce this comment to one concise rationale.
Keep the repository-access error rationale. Remove the detailed behavior walk-through.
Proposed change
-// Why REST instead of Search for the default (no-query) listing: the Search -// API answers HTTP 200 with zero items when the authenticated gh account -// cannot see the repo, so an account switch or re-login silently empties the -// Tasks list with nothing to act on (`#16244`). The REST listing fails with a -// classifiable 403/404 instead, letting the existing error envelope explain -// the empty state. +// Why: REST surfaces repository-access errors instead of silently returning an empty list (`#16244`).As per coding guidelines, comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: dff6c024-c052-4447-a714-31760e8c78e6
📒 Files selected for processing (3)
src/main/github/client/list/list-recent-work-items-rest-issues.test.tssrc/main/github/client/list/work-item-list-request.tssrc/main/github/client/list/work-item-pages.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| const issueRequest = issueOwnerRepo | ||
| ? buildWorkItemListRequest({ | ||
| kind: 'issue', | ||
| ownerRepo: issueOwnerRepo, | ||
| limit, | ||
| query: recentQuery, | ||
| page | ||
| }) | ||
| ? buildRecentIssueListRequest({ ownerRepo: issueOwnerRepo, limit, page }) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
file="src/main/github/client/list/work-item-pages.ts"
printf '%s\n' '--- outline ---'
ast-grep outline "$file" 2>/dev/null || true
printf '%s\n' '--- relevant source ---'
cat -n "$file" | sed -n '1,90p'
printf '%s\n' '--- query/request symbols ---'
rg -n --glob '*.{ts,tsx,js,jsx}' \
'recentQuery|parseTaskQuery|buildRecentIssueListRequest|buildRecentPullRequestListRequest|prRequest' \
src/main/github/client src/main | head -200
printf '%s\n' '--- changed-file summary ---'
git diff --stat -- "$file"Repository: stablyai/orca
Length of output: 8303
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- request builder ---'
cat -n src/main/github/client/list/work-item-list-request.ts | sed -n '1,180p'
printf '%s\n' '--- ParsedTaskQuery definition and parser ---'
rg -n -A100 -B15 \
'export (type|interface).*ParsedTaskQuery|type ParsedTaskQuery|interface ParsedTaskQuery|function parseTaskQuery|const parseTaskQuery' \
src shared 2>/dev/null | head -240
printf '%s\n' '--- all declarations and uses of recentQuery ---'
python3 - <<'PY'
from pathlib import Path
needle = "recentQuery"
for p in Path(".").rglob("*"):
if p.is_file() and any(part in {"node_modules", ".git", "dist", "build"} for part in p.parts):
continue
try:
text = p.read_text()
except (UnicodeDecodeError, OSError):
continue
for n, line in enumerate(text.splitlines(), 1):
if needle in line:
print(f"{p}:{n}:{line}")
PYRepository: stablyai/orca
Length of output: 23131
Restore the PR query initialization.
recentQuery is undeclared, but buildWorkItemListRequest requires it. Define a valid ParsedTaskQuery before building prRequest.
Closes #16244
After switching/re-logging-in gh accounts, the Tasks issues panel went silently empty: the Search API answers HTTP 200 with zero items when the active account cannot see the repo, which read as "no issues".
Default (unfiltered) issue listing now uses the REST repo-issues endpoint instead, whose 403/404 flow through the existing classified-error envelope so failures become visible errors rather than an empty panel. Queried search and PR listing untouched.