Skip to content

fix(assisted-query): Treat empty list as all accessible projects for issues RPCs - #126806

Merged
aliu39 merged 2 commits into
masterfrom
fix/seer-rpc-empty-project-ids
Oct 8, 2026
Merged

aliu39 merged 2 commits into
masterfrom
fix/seer-rpc-empty-project-ids

Conversation

@aliu39

@aliu39 aliu39 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Problem

When Seer asked Sentry for issue data without naming any specific projects, the request failed outright. Four of the issue-related Seer tools were affected: searching issues, fetching issue stats, and the two that populate search filter suggestions.

The intent of an empty project list is "search everywhere I can see." Sentry instead read it as "no filter specified" and fell back to the caller's personal project memberships — of which Seer, as a service, has none. The result was a hard error rather than an org-wide search.

Fix

These calls now explicitly ask for all accessible projects when none are specified, so Seer gets results across the organization as intended.

Two related cleanups to the release-name suggestions:

  • They now understand the same "all projects" request, instead of silently returning nothing.
  • They no longer suggest releases that belong only to a project being deleted.

Impact

Behavior only changes where the request previously failed or returned nothing. Calls that name specific projects are unaffected. The same four tools are shared with the public organization-scoped Seer endpoint, so both benefit.

Testing

Nine tests added covering each affected path. Each was confirmed to fail without the fix. Full file passes: 67 tests.

relates to https://github.com/getsentry/seer/pull/8727 (merged)

The Seer issues RPCs forwarded an empty project_ids list to the
organization endpoints unchanged. An omitted project filter scopes those
endpoints to the caller's team memberships, and these calls authenticate
with an org API key that has none, so the endpoints rejected the request
with a 400 instead of searching the whole org.

Send the all-access sentinel when no projects are requested, and teach
the release-value helper to recognize it. The helper now also skips
releases whose only project is pending deletion.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 7, 2026
@aliu39 aliu39 changed the title fix(seer): Treat empty project lists as all accessible projects fix(seer-rpc): Treat empty project lists as all accessible projects Oct 7, 2026
@aliu39 aliu39 changed the title fix(seer-rpc): Treat empty project lists as all accessible projects fix(seer-rpc): Treat empty list as all accessible projects for issues RPCs Oct 7, 2026
@aliu39
aliu39 marked this pull request as ready for review October 7, 2026 23:18
@aliu39
aliu39 requested a review from a team as a code owner October 7, 2026 23:18
Removed comments explaining project filter logic.
@aliu39 aliu39 changed the title fix(seer-rpc): Treat empty list as all accessible projects for issues RPCs fix(seer): Treat empty list as all accessible projects for issues RPCs Oct 7, 2026
@aliu39 aliu39 changed the title fix(seer): Treat empty list as all accessible projects for issues RPCs fix(aq): Treat empty list as all accessible projects for issues RPCs Oct 7, 2026
@aliu39 aliu39 changed the title fix(aq): Treat empty list as all accessible projects for issues RPCs fix(assisted-query): Treat empty list as all accessible projects for issues RPCs Oct 7, 2026

@isaacwang-sentry isaacwang-sentry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment

params: dict[str, Any] = {
"query": query,
"project": project_ids,
"project": project_ids or [ALL_ACCESS_PROJECT_ID],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this bypass caller permissions?

@aliu39 aliu39 Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but this is an existing problem for all rpcs / non codemode 😅
its only possible to scope when you have an api request context / using codemode

@aliu39
aliu39 merged commit 99b4c2b into master Oct 8, 2026
75 checks passed
@aliu39
aliu39 deleted the fix/seer-rpc-empty-project-ids branch October 8, 2026 01:02
GemTails pushed a commit to GemLunaMarine/sentry that referenced this pull request Oct 8, 2026
…issues RPCs (getsentry#126806)

## Problem

When Seer asked Sentry for issue data without naming any specific
projects, the request failed outright. Four of the issue-related Seer
tools were affected: searching issues, fetching issue stats, and the two
that populate search filter suggestions.

The intent of an empty project list is "search everywhere I can see."
Sentry instead read it as "no filter specified" and fell back to the
caller's personal project memberships — of which Seer, as a service, has
none. The result was a hard error rather than an org-wide search.

## Fix

These calls now explicitly ask for all accessible projects when none are
specified, so Seer gets results across the organization as intended.

Two related cleanups to the release-name suggestions:
- They now understand the same "all projects" request, instead of
silently returning nothing.
- They **no longer suggest releases that belong only to a project being
deleted.**

## Impact

Behavior only changes where the request previously failed or returned
nothing. Calls that name specific projects are unaffected. The same four
tools are shared with the public organization-scoped Seer endpoint, so
both benefit.

## Testing

Nine tests added covering each affected path. Each was confirmed to fail
without the fix. Full file passes: 67 tests.

relates to https://github.com/getsentry/seer/pull/8727 (merged)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants