Skip to content

Filter repository search results to only return client repositories#588

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

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

Conversation

@jrhoads
Copy link
Copy Markdown
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

    • Repository detail navigation now prioritizes the repository's client identifier when present.
    • Repository search results are now restricted to repositories with assigned client identifiers.
  • UI

    • Updated example repository links shown in the "no repositories found" messaging and search UI.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 88c4f90d-12ca-4fc6-ab1a-ebf7fabdae2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Three files updated: repository detail URL construction now prefers repo.clientId when present; repository search params append a client_id:* clause to the query; example repository links and minor JSX formatting were updated in the search UI component.

Changes

Cohort / File(s) Summary
Repository Detail URL Resolution
src/components/RepositoryMetadata/RepositoryMetadata.tsx
detailUrl() now uses repo.clientId to build /repositories/{clientId} when available, falling back to repo.id.
Repository Search Query Filter
src/data/queries/searchRepositoryQuery.ts
buildRepositorySearchParams now appends client_id:* to the query param using AND, changing search/filter behavior to require a wildcard client_id.
Search UI examples & formatting
src/components/SearchRepository/SearchRepository.tsx
Replaced six hardcoded example repository links to /repositories/<prefix>.<id> variants and adjusted JSX indentation/parenthesization in renderFacets (no functional change beyond link updates).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 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 clearly and accurately summarizes the primary change: filtering repository search results to return only client repositories, which is the main objective across all three modified files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch only-client-repositories

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.

@cypress
Copy link
Copy Markdown

cypress bot commented Mar 16, 2026

akita    Run #1990

Run Properties:  status check passed Passed #1990  •  git commit fc8c01607c ℹ️: Merge 646da4e6f529e703f9ec7bd55eddb324d167275b into fdfed8a27dd8b5369732d75bba47...
Project akita
Branch Review only-client-repositories
Run status status check passed Passed #1990
Run duration 01m 55s
Commit git commit fc8c01607c ℹ️: Merge 646da4e6f529e703f9ec7bd55eddb324d167275b into fdfed8a27dd8b5369732d75bba47...
Committer Joseph Rhoads
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
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
Copy Markdown
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

Comment thread 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
@bklaing2 bklaing2 force-pushed the only-client-repositories branch from 6bd107c to de45e32 Compare April 14, 2026 21:20
@bklaing2 bklaing2 self-assigned this Apr 15, 2026
@bklaing2
Copy link
Copy Markdown
Member

@coderabbitai please review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

@bklaing2 Sure! I'll review the changes in PR #588 now.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bklaing2 bklaing2 force-pushed the only-client-repositories branch from de45e32 to 646da4e Compare April 16, 2026 01:30
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.

3 participants