Skip to content

Filter repository search results to only return client repositories#588

Draft
jrhoads wants to merge 2 commits intomasterfrom
only-client-repositories
Draft

Filter repository search results to only return client repositories#588
jrhoads wants to merge 2 commits intomasterfrom
only-client-repositories

Conversation

@jrhoads
Copy link
Contributor

@jrhoads jrhoads commented Mar 16, 2026

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_id and ensuring that the repository metadata component correctly uses the clientId for generating detail links.

Key Modifications

  • Search Query: Modified src/data/queries/searchRepositoryQuery.ts to append AND client_id:* to the repository search query. This ensures that only records classified as Client Repositories are fetched.
  • Navigation Logic: Updated src/components/RepositoryMetadata/RepositoryMetadata.tsx to prioritize repo.clientId when generating the detail URL, falling back to repo.id if necessary.

Important Technical Details

  • The search filter uses the filter(Boolean).join(' AND ') pattern to prevent malformed queries if the initial search variable is empty.
  • By filtering at the API query level, we reduce unnecessary data processing on the frontend and ensure search pagination remains accurate.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

Summary by CodeRabbit

  • Bug Fixes
    • Improved repository detail page navigation routing to prioritize client identifier when available.
    • Repository search now filters results to display only repositories with assigned client identifiers.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

Walkthrough

Two files modified to handle clientId preference: repository detail URLs now prioritize routing to /repositories/{clientId} when available, and search queries append a client_id:* filter to narrow results. Total of 4 lines added, 1 removed.

Changes

Cohort / File(s) Summary
Repository Detail URL Resolution
src/components/RepositoryMetadata/RepositoryMetadata.tsx
Modified detailUrl() logic to prefer repo.clientId for constructing navigation URLs; falls back to repo.id if clientId is unavailable.
Repository Search Query Filter
src/data/queries/searchRepositoryQuery.ts
Appended client_id:* filter to search query using AND operator, narrowing results to items matching the wildcard client_id condition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: filtering repository search results to return only client repositories, which is directly supported by the query filter update in searchRepositoryQuery.ts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch only-client-repositories
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

@cypress
Copy link

cypress bot commented Mar 16, 2026

akita    Run #1936

Run Properties:  status check passed Passed #1936  •  git commit 860f1614b1 ℹ️: Merge 6bd107cf7ac358d1171bce416dd4a0beca692fc5 into 5bba547805a8c982d748951095c0...
Project akita
Branch Review only-client-repositories
Run status status check passed Passed #1936
Run duration 03m 19s
Commit git commit 860f1614b1 ℹ️: Merge 6bd107cf7ac358d1171bce416dd4a0beca692fc5 into 5bba547805a8c982d748951095c0...
Committer Joseph Rhoads
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 3
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 47
View all changes introduced in this branch ↗︎

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5bba547 and 6bd107c.

📒 Files selected for processing (2)
  • src/components/RepositoryMetadata/RepositoryMetadata.tsx
  • src/data/queries/searchRepositoryQuery.ts

@jrhoads jrhoads requested review from a team, KellyStathis and codycooperross March 16, 2026 12:08
@jrhoads jrhoads marked this pull request as draft March 16, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants