Skip to content

feat(issues): Add a same_title type to the related issues endpoint - #131717

Merged
Christinarlong merged 1 commit into
masterfrom
unified-similarity-api-same-title-type
Nov 19, 2026
Merged

Christinarlong merged 1 commit into
masterfrom
unified-similarity-api-same-title-type

Conversation

@Christinarlong

@Christinarlong Christinarlong commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Add back the same title matching to be removed in #131388 to the new related issues endpoint.

The matching methodology does differ a bit tho. Instead of grabbing the last 100 issues from postgres and then doing exact title comparisons on each. This approach queries snuba snuba instead for the exact title from any event in the past 14d and we're now only doing this process for error issues.

AI Overview

What?

GET /organizations/{org}/issues/{id}/related/?type=same_title returns error issues in the same project whose events have exactly the same title as this issue's event (the latest, or the one passed in eventId):

{
  "data": [{"issue": {"shortId": "PUMP-STATION-2", "...": "..."}, "relations": [{"type": "same_title"}]}],
  "meta": {"types": [{
    "type": "same_title", "status": "ok",
    "eventId": "60fc17404bf4445c81675be939ef74d6",
    "title": "ValueError: invalid literal for int() with base 10: 'abc'"
  }]}
}

It searches the last 14 days, most recently seen first, up to limit. Non-error issues get not_applicable.

Why?

Grouping splits errors by stack trace, so one cause reached from several places, or one outage seen by several callers, becomes several issues with the same title. similar_stacktrace misses these by design, and same_trace only finds them when they share a trace. The old same_root_cause type of /related-issues/ (removed in #131388) did this, but only compared the stored titles of a project's 100 oldest issues.

Rollout and failure modes

  • Everyone, no flag: the endpoint is private, and the Similar Issues drawer names the types it asks for, so it doesn't run this one.
  • Requests that leave out type now run it too. Types run one after another, so that adds one issue search.
  • A Snuba failure gives unavailable, and a 503 only when it's the only type requested.

Notes

  • Follows contributing.py: an issue search with the same referrer, SnubaError mapped to unavailable, and a meta entry built like same_trace's. The new logic is the search filter in same_title.py: issue.category:error through the issue search parser, plus a title filter built with use_raw_value, so titles need no escaping and a * in a title isn't a wildcard.
  • Matching is on each event's title, not the title stored on the issue, so an issue matches if any of its recent events has the title.
  • Open question: same project and 14 days keep generic titles (ChunkLoadError) bounded. Worth widening later?

🤖 Generated with Claude Code

/related/?type=same_title returns error issues in the same project whose events in the last 14 days have exactly the same title as the issue's event, most recently seen first. It runs the issue stream's title filter as an issue search, like the contributing type, so it checks every recent issue rather than a fixed sample.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 18, 2026
@Christinarlong
Christinarlong marked this pull request as ready for review November 18, 2026 23:51
@Christinarlong
Christinarlong requested review from a team as code owners November 18, 2026 23:51
@Christinarlong
Christinarlong merged commit b072155 into master Nov 19, 2026
84 checks passed
@Christinarlong
Christinarlong deleted the unified-similarity-api-same-title-type branch November 19, 2026 03:26
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