Filter repository search results to only return client repositories#588
Filter repository search results to only return client repositories#588
Conversation
WalkthroughTwo files modified to handle clientId preference: repository detail URLs now prioritize routing to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can generate walkthrough in a markdown collapsible section to save space.Enable the |
akita
|
||||||||||||||||||||||||||||
| Project |
akita
|
| Branch Review |
only-client-repositories
|
| Run status |
|
| Run duration | 03m 19s |
| Commit |
|
| Committer | Joseph Rhoads |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
3
|
|
|
0
|
|
|
47
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/data/queries/searchRepositoryQuery.ts`:
- Line 10: The GQL hook useSearchRepositoryQueryGQL lacks the client-only
constraint applied by useSearchRepositoryQuery; update
useSearchRepositoryQueryGQL to append the same "client_id:*" clause to its query
variables (e.g., build query the same way as query: [variables.query,
"client_id:*"].filter(Boolean).join(' AND ')) so both paths are consistent, and
ensure any related tests/types/comments reflect this change; alternatively, if
the GQL hook is not intended for use, mark useSearchRepositoryQueryGQL as
deprecated in its export/comment and add a deprecation notice in docs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e41fe611-6183-47d8-bab4-02126b67f2ee
📒 Files selected for processing (2)
src/components/RepositoryMetadata/RepositoryMetadata.tsxsrc/data/queries/searchRepositoryQuery.ts
Purpose
The purpose of this PR is to refine repository search results to ensure only Client Repositories are returned and to improve the navigation routing for these repositories within the application.
Approach
The approach involves updating the search query parameters to filter for records containing a
client_idand ensuring that the repository metadata component correctly uses theclientIdfor generating detail links.Key Modifications
src/data/queries/searchRepositoryQuery.tsto appendAND client_id:*to the repository search query. This ensures that only records classified as Client Repositories are fetched.src/components/RepositoryMetadata/RepositoryMetadata.tsxto prioritizerepo.clientIdwhen generating the detail URL, falling back torepo.idif necessary.Important Technical Details
filter(Boolean).join(' AND ')pattern to prevent malformed queries if the initial search variable is empty.Types of changes
Reviewer, please remember our guidelines:
Summary by CodeRabbit