Skip to content

feat: add endpoint to list only issues that have PRs created from Seer Explorer#107850

Merged
billyvg merged 22 commits intomasterfrom
billy/feat-seer-new-explorer-prs-endpoint
Feb 25, 2026
Merged

feat: add endpoint to list only issues that have PRs created from Seer Explorer#107850
billyvg merged 22 commits intomasterfrom
billy/feat-seer-new-explorer-prs-endpoint

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Feb 9, 2026

This exposes the endpoint on Seer and joins the results from Seer with serialized groups.

This will be used internally only for now for our macos app.

@github-actions github-actions bot added Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components labels Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@linear
Copy link

linear bot commented Feb 9, 2026

@billyvg billyvg changed the title wip: add endpoint to list issues that have PRs to fix them feat: add endpoint to list issues that have PRs to fix them Feb 9, 2026
@billyvg billyvg changed the title feat: add endpoint to list issues that have PRs to fix them feat: add endpoint to list only issues that have PRs created from Seer Explorer Feb 10, 2026
@billyvg billyvg force-pushed the billy/feat-seer-new-explorer-prs-endpoint branch from e2a828c to 5764824 Compare February 10, 2026 20:37
@billyvg billyvg force-pushed the billy/feat-seer-new-explorer-prs-endpoint branch from 559ac54 to 148a6a8 Compare February 10, 2026 20:42
@billyvg billyvg removed the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 10, 2026
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 10, 2026
Get a list of issues that have a PR created from Seer Explorer

Query Parameters:
None
Copy link
Member Author

Choose a reason for hiding this comment

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

I may add one to filter for current user only, not sure yet

Copy link
Member

Choose a reason for hiding this comment

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

nit - could maybe pass in the category_key + value?

Copy link
Member Author

Choose a reason for hiding this comment

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

@aliu39 I can take a look as a follow-up. when Seer Explorer creates a PR outside of an issue, is category_key still autofix? (trying to better understand how cat key/value is used)

Copy link
Member

@aliu39 aliu39 Feb 25, 2026

Choose a reason for hiding this comment

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

yeah PRs created by the floating explorer chat have category_key = None. categ is set on SeerExplorerClient init and that's saved to the ExplorerState + DbExplorerRun in seer

if ppl make more explorer-based features in the future, they can set other categs on their client

limit: int | None = None,
) -> list[ExplorerRun]:
expand: Literal["prs"] | None = None,
only_current_user: bool = True,
Copy link
Member Author

Choose a reason for hiding this comment

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

/explorer-runs/ requires that it filters for current user only.

@billyvg billyvg marked this pull request as ready for review February 10, 2026 21:39
@billyvg billyvg requested review from a team as code owners February 10, 2026 21:39
@billyvg billyvg requested a review from aliu39 February 10, 2026 21:40
@billyvg billyvg force-pushed the billy/feat-seer-new-explorer-prs-endpoint branch from cf2ef59 to 77cd597 Compare February 23, 2026 21:29
@billyvg billyvg marked this pull request as ready for review February 23, 2026 22:09
@billyvg billyvg requested review from Zylphrex and aliu39 February 23, 2026 22:09
Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

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

Mostly questions from reading the tests, as that is where I think my review is best left 😄

Comment on lines +255 to +260
pr_states = response.json()["data"][0]["repoPrStates"]
assert pr_states["getsentry/sentry"]["repoName"] == "getsentry/sentry"
assert pr_states["getsentry/sentry"]["branchName"] is None
assert pr_states["getsentry/sentry"]["prNumber"] is None
assert pr_states["getsentry/sentry"]["prUrl"] is None
assert pr_states["getsentry/sentry"]["prCreationStatus"] is None
Copy link
Member

Choose a reason for hiding this comment

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

Are there real life examples where we have a PR linked to an issue but none of this information? Or am I misunderstanding the test case?

Copy link
Member Author

Choose a reason for hiding this comment

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

No I think this is just based on the typing of repo_pr_states

Comment on lines +172 to +199
def test_get_no_matching_groups_returns_null_group(self) -> None:
"""When Seer returns group IDs that don't exist in the requested project, group is None."""
self.mock_client.get_runs.return_value = [self._make_seer_item(group_id=999999)]

response = self.client.get(self.url + f"?project={self.project.id}")

assert response.status_code == 200
data = response.json()["data"]
assert len(data) == 1
assert data[0]["group"] is None

def test_get_includes_null_group_id_runs(self) -> None:
"""Runs without a group_id are included with group=None."""
group = self.create_group(project=self.project)

self.mock_client.get_runs.return_value = [
self._make_seer_item(group_id=group.id, run_id=1),
self._make_seer_item(group_id=None, run_id=2),
]
self.mock_serialize.return_value = [{"id": str(group.id), "title": "Issue 1"}]

response = self.client.get(self.url + f"?project={self.project.id}")

assert response.status_code == 200
data = response.json()["data"]
assert len(data) == 2
assert data[0]["group"]["id"] == str(group.id)
assert data[1]["group"] is None
Copy link
Member

Choose a reason for hiding this comment

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

I don't know what group None implies, w.r.t. the native clients. Is this a response state we need to worry about, or is this just internal server logic? Looking at the client implementation, we only have this in one place, SentryIssueSummary.groupId, which is not an optional attribute, so we wouldn't be able to handle None if it came down in a response.

Copy link
Member Author

Choose a reason for hiding this comment

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

For native clients, we probably want to handle this case -- we can make Seer Explore runs that generate PRs that are not bound to an Issue.

Copy link
Member

@armcknight armcknight Feb 25, 2026

Choose a reason for hiding this comment

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

hmm interesting. i guess let's see what happens, would be easy enough to fix in the clients 👍🏻

Get a list of issues that have a PR created from Seer Explorer

Query Parameters:
None
Copy link
Member

Choose a reason for hiding this comment

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

nit - could maybe pass in the category_key + value?

@billyvg billyvg merged commit ff12004 into master Feb 25, 2026
78 checks passed
@billyvg billyvg deleted the billy/feat-seer-new-explorer-prs-endpoint branch February 25, 2026 14:40
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants