Filter repository search results to only return client repositories#588
Filter repository search results to only return client repositories#588
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThree files updated: repository detail URL construction now prefers Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
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 |
akita
|
||||||||||||||||||||||||||||
| Project |
akita
|
| Branch Review |
only-client-repositories
|
| Run status |
|
| Run duration | 01m 55s |
| Commit |
|
| Committer | Joseph Rhoads |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
2
|
|
|
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
6bd107c to
de45e32
Compare
|
@coderabbitai please review |
|
✅ Actions performedReview triggered.
|
de45e32 to
646da4e
Compare
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
Bug Fixes
UI