Skip to content

fix(repo list): use search for private visibility#13053

Open
Maa-ly wants to merge 1 commit intocli:trunkfrom
Maa-ly:fix/repo-list-private-visibility
Open

fix(repo list): use search for private visibility#13053
Maa-ly wants to merge 1 commit intocli:trunkfrom
Maa-ly:fix/repo-list-private-visibility

Conversation

@Maa-ly
Copy link
Copy Markdown

@Maa-ly Maa-ly commented Mar 28, 2026

Summary

gh repo list --visibility private currently takes the GraphQL repository-owner path, which uses RepositoryPrivacy. That enum cannot distinguish PRIVATE from INTERNAL, so internal repositories are returned alongside truly private ones.

This change routes --visibility private through the existing search-backed listing path, matching the workaround and implementation direction discussed in #12900. The search API uses is:private, which excludes internal repositories correctly.

Changes

  • route gh repo list --visibility private through searchRepos(...)
  • keep the existing GraphQL path for visibilities that can still be represented accurately there
  • add a regression test that asserts the private filter now issues the is:private search query

Testing

  • go test ./pkg/cmd/repo/list

Closes #12900.

@Maa-ly Maa-ly requested a review from a team as a code owner March 28, 2026 08:03
@Maa-ly Maa-ly requested a review from babakks March 28, 2026 08:03
@github-actions
Copy link
Copy Markdown

Thanks for your pull request! Unfortunately, it doesn't meet the minimum requirements for review:

  • None of the referenced issues have the help wanted label

Please update your PR to address the above. Requirements:

  1. Include a detailed description of what this PR does
  2. Link to an issue with the help wanted label (use Fixes #123 or Closes #123 if it resolves the issue)

This PR will be automatically closed in 7 days if these requirements are not met.

@github-actions github-actions bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels Mar 28, 2026
@Maa-ly
Copy link
Copy Markdown
Author

Maa-ly commented Mar 28, 2026

This patch follows the search-path approach suggested on #12900 and passes go test ./pkg/cmd/repo/list. I’ve asked on the linked issue for maintainer triage on the missing help wanted label, since that repo policy is the current blocker rather than the implementation itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team needs-triage needs to be reviewed unmet-requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh repo list OWNER --visibility private returns internal repos

1 participant