fix(search): (#169) migrate deprecated GitHub search queries to advanced_search#584
Conversation
…s to advanced_search
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
More reviews will be available in 19 minutes and 27 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refactors GitHub API search integration to address deprecations by introducing a typed schema for paginated responses, converting query construction from concatenation to array-based AND-joined parts, and adding explicit advanced search flags. Both the hook and consumer component are updated together to adopt the new pattern. ChangesGitHub API Advanced Search Upgrade
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🎉 Thank you @Shraddha3838 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/hooks/useGitHubData.ts`:
- Line 57: The current push uses unquoted user input
(queryParts.push(`${filters.search} in:title`)); change it to push a properly
quoted and escaped title phrase by trimming filters.search, escaping any
embedded double quotes (e.g., replace " with \"), and wrapping the whole phrase
in quotes for GitHub like in:title:"<phrase>"; update the call that constructs
the query (queryParts.push(...)) in src/hooks/useGitHubData.ts to use the
trimmed-and-escaped filters.search inside in:title:"...".
In `@src/pages/ContributorProfile/ContributorProfile.tsx`:
- Around line 37-41: The code currently sets PRs from prsData.items without
checking the HTTP response; update the fetch logic in the ContributorProfile
component (the prsRes/prsData handling) to first verify prsRes.ok and handle
non-OK responses by parsing the error (or reading text), logging or storing the
error, and setting a safe fallback like setPRs([]) so the UI never receives
undefined for prs; ensure you still await prsRes.json() only for ok responses or
handle parsing errors gracefully.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ea993b53-16a8-45c4-90c9-5a7d1a78bb3d
📒 Files selected for processing (2)
src/hooks/useGitHubData.tssrc/pages/ContributorProfile/ContributorProfile.tsx
…defensive query sanitization and resilient fetch handling
Related Issue
Description
This PR updates deprecated GitHub Search API query usage by migrating affected frontend search requests to the newer
advanced_searchquery format.Changes made
AND-based query compositionadvanced_search: trueto affected/search/issuesrequestsURLSearchParamsuseGitHubData.tsFiles changed
src/hooks/useGitHubData.tssrc/pages/ContributorProfile/ContributorProfile.tsxScope
The implementation was intentionally kept minimal and localized to the deprecated search query paths to avoid unrelated behavioral or architectural changes.
How Has This Been Tested?
npm run buildpassed successfullynpm run lintstill reports existing unrelated repository issues outside the scope of this PRScreenshots (if applicable)
N/A
Type of Change
Summary by CodeRabbit