Skip to content

fix tests, link projectrepository, remove unnecessary queries

65cb9ce
Select commit
Loading
Failed to load commit list.
Merged

feat(seer): Add Seer project connected repo endpoint #115199

fix tests, link projectrepository, remove unnecessary queries
65cb9ce
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: sentry-backend-bugs completed May 19, 2026 in 7m 20s

1 issue

sentry-backend-bugs: Found 1 issue (1 high)

High

IntegrityError on duplicate repository_id in replace_all_seer_project_repos - `src/sentry/seer/autofix/utils.py:927-931`

If repos_data contains duplicate repository_id values (not validated by the endpoint), get_or_create returns the same ProjectRepository on the second iteration and SeerProjectRepository.objects.create(project_repository=project_repo) raises an unhandled IntegrityError because SeerProjectRepository.project_repository has unique=True.

Also found at:

  • src/sentry/seer/endpoints/project_seer_repos.py:195-196
  • src/sentry/seer/endpoints/project_seer_repos.py:270-283

⏱ 6m 52s · 1.3M in / 49.6k out · $2.05

Annotations

Check failure on line 931 in src/sentry/seer/autofix/utils.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

IntegrityError on duplicate repository_id in replace_all_seer_project_repos

If `repos_data` contains duplicate `repository_id` values (not validated by the endpoint), `get_or_create` returns the same `ProjectRepository` on the second iteration and `SeerProjectRepository.objects.create(project_repository=project_repo)` raises an unhandled `IntegrityError` because `SeerProjectRepository.project_repository` has `unique=True`.

Check failure on line 196 in src/sentry/seer/endpoints/project_seer_repos.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

[SZM-EAL] IntegrityError on duplicate repository_id in replace_all_seer_project_repos (additional location)

If `repos_data` contains duplicate `repository_id` values (not validated by the endpoint), `get_or_create` returns the same `ProjectRepository` on the second iteration and `SeerProjectRepository.objects.create(project_repository=project_repo)` raises an unhandled `IntegrityError` because `SeerProjectRepository.project_repository` has `unique=True`.

Check failure on line 283 in src/sentry/seer/endpoints/project_seer_repos.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

[SZM-EAL] IntegrityError on duplicate repository_id in replace_all_seer_project_repos (additional location)

If `repos_data` contains duplicate `repository_id` values (not validated by the endpoint), `get_or_create` returns the same `ProjectRepository` on the second iteration and `SeerProjectRepository.objects.create(project_repository=project_repo)` raises an unhandled `IntegrityError` because `SeerProjectRepository.project_repository` has `unique=True`.