Skip to content

fix(seer-prefs): repo cleanup for org deleted repos #95768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 17, 2025
Merged

Conversation

jennmueng
Copy link
Member

@jennmueng jennmueng commented Jul 17, 2025

When you delete a repo from the UI (the PUT endpoint) we'll delete it from seer preferences as well.

Tested locally with sentry <-> seer

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 17, 2025
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 99.12281% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tests/sentry/tasks/test_seer.py 97.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #95768       +/-   ##
===========================================
+ Coverage   38.57%   87.78%   +49.21%     
===========================================
  Files        9966    10577      +611     
  Lines      559498   610100    +50602     
  Branches    23972    23844      -128     
===========================================
+ Hits       215806   535560   +319754     
+ Misses     343408    74246   -269162     
- Partials      284      294       +10     

@jennmueng jennmueng marked this pull request as ready for review July 17, 2025 17:52
@jennmueng jennmueng requested review from a team as code owners July 17, 2025 17:52
@jennmueng jennmueng requested a review from a team July 17, 2025 17:52
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Seer API Provider Format Inconsistency

The cleanup_seer_repository_preferences task sends repo.provider to the Seer API. However, the repo.provider field can be inconsistently formatted: it may include an "integrations:" prefix (e.g., "integrations:github") when the repository is linked via an integration, while other cases might use just the provider name (e.g., "github"). This inconsistency can cause issues if Seer expects a uniform provider format.

src/sentry/integrations/api/endpoints/organization_repository_details.py#L100-L108

if repo.external_id and repo.provider:
cleanup_seer_repository_preferences.apply_async(
kwargs={
"organization_id": repo.organization_id,
"repo_external_id": repo.external_id,
"repo_provider": repo.provider,
}
)

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@jennmueng jennmueng merged commit fb753cc into master Jul 17, 2025
64 checks passed
@jennmueng jennmueng deleted the jenn/repo-cleanup branch July 17, 2025 19:21
cursor bot pushed a commit that referenced this pull request Jul 18, 2025
When you delete a repo from the UI (the `PUT` endpoint) we'll delete it
from seer preferences as well.

Tested locally with sentry <-> seer
andrewshie-sentry pushed a commit that referenced this pull request Jul 21, 2025
When you delete a repo from the UI (the `PUT` endpoint) we'll delete it
from seer preferences as well.

Tested locally with sentry <-> seer
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