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

未关闭
#1,554 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
cli, typescript
领域
cli

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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]

主要语言
TypeScript
星标
961
派生
179
平均合并
15 小时 33 分钟
30 天内合并 PR
476

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/toolkit 的其他 Issue

查看 getsentry/toolkit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。