feat(cli): Name filter (glob + fuzzy) for project, team, repo and other list commands

Open
#1,554 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cli, typescript
Domain
cli

Research direction

Start with packages/cli/src/lib/list-filter.ts and the existing org list implementation to see how filtering and pagination work. Then trace project list and buildOrgListCommand for the listed commands, including how positional arguments and --cursor are handled. Done means the requested filters work with pagination, --limit, and --platform as described; the issue leaves dashboard fuzzy filtering as a separate decision.

Written by the indexing model from the issue text.

Description

Follow-up from review of #1537 (thread).

sentry org list [filter] filters organizations by slug or name: a glob (acme-*) has to match a whole slug or name, and plain text goes through the shared fuzzy search (exact, prefix, substring, then small typos). #1537 moved that logic into packages/cli/src/lib/list-filter.ts (filterByName) so other list commands can use it. Right now only org list does.

Proposal

Add the same name filter to the other list commands, as an optional positional argument after the target, following sentry dashboard list [<org/project>] [<name-glob>]:

sentry project list my-org/ 'web-*'     # glob on project slug or name
sentry project list my-org/ frontnd     # fuzzy: finds "frontend"
sentry project list 'web-*'             # auto-detected org(s); a glob can't be a slug, so it's a filter
sentry team list my-org/ backend
sentry repo list my-org/ 'sentry-*'

Commands:

  • project list: slug and name
  • org-list framework commands (buildOrgListCommand): team list, repo list, monitor list, integration list
  • dashboard list: already has glob-only title filtering applied while it pages; switching it to filterByName (adding fuzzy text) is a separate decision because it filters page by page

Open questions and constraints

  • Pagination: fuzzy ranking needs the whole set, so a filter fetches every page. --cursor with a filter should be rejected rather than filtering one page at a time. --limit applies after filtering, as it does in org list.
  • Argument grammar: a single bare argument is still a project search (sentry project list web). Only a second positional, or a single argument containing glob characters, is treated as a filter.
  • --platform: project list --platform stays as it is and combines with the name filter.

via byk.

--

View Junior Session [Sentry]

Dominant language
TypeScript
Stars
961
Forks
179
Avg merge
15h 33m
Merged PRs (30d)
476

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/toolkit

All issues in getsentry/toolkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.