fix(hive): search open labelled issues for Good First Issue - #1376
Conversation
Filter previously queried repositories by topic text, so repos without an open starter issue still appeared. Route label filters through Issues search, group by repo, and surface the issue link. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughRepository Hive now routes label searches through GitHub’s issues API, groups open matching issues by repository, supports pagination, cancels stale requests, and normalizes results through shared utilities. Cards display separate repository and matching issue links with issue-specific metrics and status text. ChangesRepository Hive search
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant RepositoryHive
participant repositoryHiveSearch
participant GitHubSearchAPI
User->>RepositoryHive: Submit search or change filter, sort, or page
RepositoryHive->>repositoryHiveSearch: Build paginated API URL
repositoryHiveSearch-->>RepositoryHive: Return issues or repositories API URL
RepositoryHive->>GitHubSearchAPI: Fetch search results
GitHubSearchAPI-->>RepositoryHive: Return issue or repository data
RepositoryHive->>repositoryHiveSearch: Normalize response and page metadata
repositoryHiveSearch-->>RepositoryHive: Return grouped repository results
RepositoryHive-->>User: Display repository, issue, metrics, and pagination links
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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 `@frontend/src/utils/repositoryHiveSearch.js`:
- Around line 161-171: Extend buildGitHubSearchUrl to accept a page parameter
and include it in issue-search requests, then add pagination state and controls
in the page component so users can navigate beyond the first response. Ensure
duplicate-repository grouping does not prematurely stop pagination when fewer
than perPage cards are produced, and add coverage for later-page requests and
duplicate-repository pages.
- Around line 44-47: Update the issue-backed result flow around ISSUE_SORT_MAP
and the normalized repository record to enrich each distinct repository with
actual repository metadata before rendering or sorting. Remove the
issue-specific stars/reactions and forks/comments mappings, along with
hard-coded repository counts, so RepositoryHive.jsx receives genuine repository
statistics and repository sort modes.
🪄 Autofix
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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ca9f7842-630c-4ca8-be26-bdef8ad9b9c7
📒 Files selected for processing (3)
frontend/src/pages/OpenSource/RepositoryHive.jsxfrontend/src/utils/repositoryHiveSearch.jsfrontend/src/utils/repositoryHiveSearch.unit.test.js
Use issue reactions/comments instead of fake repo stats, add page support to search URLs, and expose pagination controls. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@frontend/src/pages/OpenSource/RepositoryHive.jsx`:
- Around line 87-89: Update the request flow containing the response handling
with setRepositories and setPageInfo to track the latest request using
AbortController or a request sequence identifier. Prevent stale requests from
updating repositories, pageInfo, loading, or error state, and ensure the guard
covers both successful and failed requests when filters, sorting, pagination, or
submitted searches change.
🪄 Autofix
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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 09fd6379-ab17-4766-bfba-a126d8dc1650
📒 Files selected for processing (3)
frontend/src/pages/OpenSource/RepositoryHive.jsxfrontend/src/utils/repositoryHiveSearch.jsfrontend/src/utils/repositoryHiveSearch.unit.test.js
Cancel in-flight GitHub requests when filters, sort, page, or a new search changes so an older response cannot overwrite current results. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@frontend/src/pages/OpenSource/RepositoryHive.jsx`:
- Around line 92-93: Update the search-result pagination flow around
normalizeSearchResponse and getSearchPageInfo to paginate the deduplicated
repository collection rather than GitHub’s raw issue total_count. Ensure
repository cards are unique across pages and calculate page metadata from the
grouped repositories; alternatively, explicitly retain issue pagination while
preventing duplicate repositories across pages.
🪄 Autofix
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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 916c1991-88c4-499c-9ee8-9c884be4f60d
📒 Files selected for processing (1)
frontend/src/pages/OpenSource/RepositoryHive.jsx
| setRepositories(normalizeSearchResponse(selectedFilters, data)); | ||
| setPageInfo(getSearchPageInfo(data, page, PER_PAGE)); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Paginate grouped repositories instead of raw issues.
normalizeSearchResponse groups only the current page of issue results. getSearchPageInfo then uses GitHub’s raw issue total_count. If one repository has multiple matching issues, the page count is incorrect for repository cards, and the same repository can appear on multiple pages.
Use a pagination strategy that deduplicates repositories before calculating page metadata. Otherwise, present pagination as issue pagination and prevent duplicate repository cards across pages.
🤖 Prompt for 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.
In `@frontend/src/pages/OpenSource/RepositoryHive.jsx` around lines 92 - 93,
Update the search-result pagination flow around normalizeSearchResponse and
getSearchPageInfo to paginate the deduplicated repository collection rather than
GitHub’s raw issue total_count. Ensure repository cards are unique across pages
and calculate page metadata from the grouped repositories; alternatively,
explicitly retain issue pagination while preventing duplicate repositories
across pages.
Pull Request Description
Related Issue
Closes #932
Summary
Good First Issue was searching
search/repositorieswith a topic token, so metadata matches showed up even with no open starter issue. Label filters now hitsearch/issues(is:open+ label variants), results are grouped by repo, and each card links the matching issue. Empty state covers the no-open-issue case.Type of Change
How Has This Been Tested?
vitest run src/utils/repositoryHiveSearch.unit.test.js(5 passing)Screenshots (if applicable)
N/A
Checklist
Made with Cursor
Summary
Fixes the Good First Issue filter by searching GitHub’s open issues instead of repository metadata.
search/issueswithis:openand label variants.