Repository navigation
feat(cli): Name filter for project, team, repo, monitor and integration lists - #1575
Open
sentry-junior[bot] wants to merge 2 commits into
Open
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
…on lists Bring `sentry org list [filter]`'s name filter to the other org-scoped list commands, as an optional second positional: sentry project list my-org/ 'web-*' # glob on slug or name sentry team list my-org/ backnd # fuzzy text sentry project list 'web-*' # lone glob: auto-detected org(s) - `OrgListConfig.namesOf` opts a `buildOrgListCommand` command in (team, repo, monitor, integration); its default handlers filter each fetched set with `filterByName`. `project list` applies it in its own handlers, together with `--platform`. - Matching and fuzzy ranking need the whole set, so `<org>/` with a filter fetches every page instead of one cursor page, and `--cursor` with a filter is rejected. `--limit` applies to the matches. - `splitListTargetAndFilter` treats a lone glob (or `<org>/<glob>`) as a filter, since no slug contains glob characters. A lone bare name is still a project search. - Glob `*` now also matches `/`, so `*-sdk` matches repository names like `getsentry/sentry-python-sdk`. Refs #1554 Co-Authored-By: byk <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b9def56. Configure here.
A name filter on `<org>/` went through `listForOrg`, which for teams, repositories and integrations returns only the first API page, so later matches were dropped. It also used `fetchOrgSafe`, which turns a missing org, 403 or network failure into an empty "no matches" result. With a filter, the default handlers now walk every page of `listPaginated`, and org-all mode lets API errors propagate as the unfiltered `<org>/` listing does.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Brings
sentry org list [filter]'s name filter (glob, or fuzzy text throughfilterByName) to the other org-scoped list commands. It's an optional second positional, following thesentry dashboard list [<org/project>] [<name-glob>]pattern. Refs #1554, from this review thread.How it works
OrgListConfig.namesOfopts abuildOrgListCommandcommand in. That coversteam,repo,monitor, andintegrationlist. With a filter, the default handlers wrap the config's fetchers withfilterByName.entityPluralbecomesteams matching 'x', so progress, empty-result, and count messages say what was matched.project listoverrides every dispatch mode, so it gets the filter asctx.filterand applies it in its own handlers, together with--platform.<org>/fetches every page instead of one cursor page, and--cursorwith a filter is rejected with aValidationError.--limitapplies to the matches, as inorg list. Tips that point at the unfiltered paginated<org>/listing are left out when a filter is set.splitListTargetAndFiltertreats a lone glob (web-*) or<org>/<glob>as a filter, since no slug contains glob characters. A lone bare name (sentry project list web) is still a project search, so nothing existing changes meaning.*now also matches/(picomatchbash: true). Names aren't paths, and repository names areowner/name.Not in this PR:
dashboard liststill uses its own glob-only title filter, applied while it pages through server results. Moving it tofilterByNamewould add fuzzy matching but changes its paging behaviour, so it's left for a follow-up under #1554.Testing: new tests cover
splitListTargetAndFilter, the dispatcher's filter path (fetch everything, fuzzy ranking,--limit, project scope,--cursorrejection,ctx.filterfor overrides),project listend to end (glob, fuzzy,<org>/<glob>,--platform,--limit, empty hint,--cursor), andteam listwiring.tsc,oxlint, andoxfmtare clean. Generated command docs and skills are regenerated. The full localtest/lib+test/commandsrun fails only in tests that also fail locally without this change (sandbox permissions and therequire-shimloader); thecheck-*scripts pass when run directly.via BYK.
--
View Junior Session [Sentry]