Skip to content

Conversation

@nora-shap
Copy link
Member

Problem

EventFileCommittersEndpoint uses _get_serialized_committers_from_group_owners which filters for GroupOwners with commitId in context:

owner = next(filter(lambda go: go.context.get("commitId"), group_owners), None)

RELEASE_BASED suspect commits only store suspectCommitStrategy, not commitId, so they're never displayed on the Issue detail page.

Solution

Match the SCM_BASED pattern by:

  1. Tracking the highest-scoring commit for each author
  2. Storing commitId in context_defaults
  3. Including commitId in lookup_kwargs for proper deduplication

@linear
Copy link

linear bot commented Nov 8, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 8, 2025
"user_id": owner_id,
"project_id": project.id,
"organization_id": project.organization_id,
"context__asjsonb__commitId": owner_commits[owner_id],
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Owner Duplication: Lookup Prevents Record Updates

Including commitId in lookup_kwargs prevents updating existing GroupOwner records when the same author has a new suspect commit. Instead of updating the existing owner's commitId, a new GroupOwner is created, causing duplicate owners for the same user/group combination and breaking the PREFERRED_GROUP_OWNERS limit enforcement. The lookup should match on (group_id, type, user_id, project_id, organization_id) to update existing records, not create duplicates.

Fix in Cursor Fix in Web

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 want separate GroupOwners for separate commits. This record does not represent a Group + User, it represents a Group + Commit

@nora-shap nora-shap marked this pull request as ready for review November 10, 2025 17:09
@nora-shap nora-shap requested a review from a team as a code owner November 10, 2025 17:09
@nora-shap nora-shap requested a review from JoshFerge November 10, 2025 17:10
"user_id": owner_id,
"project_id": project.id,
"organization_id": project.organization_id,
"context__asjsonb__commitId": owner_commits[owner_id],
Copy link
Member

Choose a reason for hiding this comment

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

do we have any tests which will test that this task will successfully update a group owner with the right fields?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes - take a look at test_update_existing_entries https://github.com/getsentry/sentry/pull/103006/files#diff-b6e0afbaeb8ea99203894d42f9693cc2acc50110771a7ded33a4115cd26c62f0R272
Just added a better check for commitId
This shows we would not create duplicates but LMK if there are other test cases I should cover 👍

Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

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

looks good!

@nora-shap nora-shap merged commit ee69631 into master Nov 11, 2025
66 checks passed
@nora-shap nora-shap deleted the nora/rtc-1250 branch November 11, 2025 16:51
Jesse-Box pushed a commit that referenced this pull request Nov 12, 2025
…103006)

## Problem

`EventFileCommittersEndpoint` uses
`_get_serialized_committers_from_group_owners` which filters for
GroupOwners with `commitId` in context:

```python
owner = next(filter(lambda go: go.context.get("commitId"), group_owners), None)
```

RELEASE_BASED suspect commits only store `suspectCommitStrategy`, not
`commitId`, so they're never displayed on the Issue detail page.

## Solution

Match the SCM_BASED pattern by:

1. Tracking the highest-scoring commit for each author
2. Storing `commitId` in `context_defaults`
3. Including `commitId` in `lookup_kwargs` for proper deduplication
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
…103006)

## Problem

`EventFileCommittersEndpoint` uses
`_get_serialized_committers_from_group_owners` which filters for
GroupOwners with `commitId` in context:

```python
owner = next(filter(lambda go: go.context.get("commitId"), group_owners), None)
```

RELEASE_BASED suspect commits only store `suspectCommitStrategy`, not
`commitId`, so they're never displayed on the Issue detail page.

## Solution

Match the SCM_BASED pattern by:

1. Tracking the highest-scoring commit for each author
2. Storing `commitId` in `context_defaults`
3. Including `commitId` in `lookup_kwargs` for proper deduplication
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.

3 participants