ref: Remove unused PUT handler from repository details endpoint#115896
Merged
evanpurkhiser merged 1 commit intoMay 20, 2026
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9915673. Configure here.
Comment on lines
+31
to
41
| # CASCADE, so children must be deleted before parents. | ||
| return [ | ||
| ModelRelation(Commit, {"repository_id": instance.id}), | ||
| ModelRelation(PullRequest, {"repository_id": instance.id}), | ||
| ModelRelation( | ||
| RepositoryProjectPathConfig, | ||
| {"project_repository__repository_id": instance.id}, | ||
| ), | ||
| ModelRelation( | ||
| SeerProjectRepositoryBranchOverride, | ||
| {"seer_project_repository__project_repository__repository_id": instance.id}, |
Contributor
There was a problem hiding this comment.
Bug: The deleted module sentry.tasks.repository is still referenced in TASKWORKER_IMPORTS, which will prevent the taskworker from starting.
Severity: CRITICAL
Suggested Fix
Remove the string "sentry.tasks.repository" from the TASKWORKER_IMPORTS list in src/sentry/conf/server.py to align with the module's deletion.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/sentry/deletions/defaults/repository.py#L15-L41
Potential issue: The `sentry.tasks.repository` module was deleted, but its import path
remains in the `TASKWORKER_IMPORTS` list located in `src/sentry/conf/server.py`. When
the taskworker process starts, it attempts to import all modules specified in this list.
Since `sentry.tasks.repository` no longer exists, this will raise an `ImportError`,
preventing the taskworker from starting. This will cause CI tests like
`test_import_paths` to fail and will lead to a production outage for the taskworker
service.
Also affects:
src/sentry/conf/server.py
Did we get this right? 👍 / 👎 to inform future reviews.
With repositories now auto-synced 1:1 from SCM providers, the frontend no longer exposes a way to hide or restore repositories. Datadog shows zero PUT calls to this endpoint in the last 7 days (vs. thousands in the 30 days before that, when the UI still called it). Remove the now-dead surface area: - The PUT method on OrganizationRepositoryDetailsEndpoint and its RepositorySerializer - The repository_cascade_delete_on_hide Celery task, whose only caller was that PUT handler, along with its tests and mypy weaklist entries - Inline _get_repository_child_relations into RepositoryDeletionTask -- its other caller is gone, and the comment distinguishing "hide" vs "delete" relations no longer applies GET and DELETE on the endpoint are unchanged.
9915673 to
7677d10
Compare
wedamija
approved these changes
May 20, 2026
JonasBa
pushed a commit
that referenced
this pull request
May 21, 2026
) With repositories now auto-synced 1:1 from SCM providers, the frontend no longer exposes a way to hide or restore repositories. Datadog shows zero PUT calls to this endpoint in the last 7 days (vs. thousands in the 30 days before that, while the UI was still calling it). This removes the now-dead surface area: - The `PUT` method on `OrganizationRepositoryDetailsEndpoint` and its `RepositorySerializer` - The `repository_cascade_delete_on_hide` Celery task, whose only caller was that `PUT` handler, along with its tests and mypy weaklist entries - Inlined `_get_repository_child_relations` into `RepositoryDeletionTask` — its other caller is gone, and the comment distinguishing "hide" vs "delete" relations no longer applies `GET` and `DELETE` on the endpoint are unchanged. `DELETE` is still receiving ~15 non-browser calls/day, so leaving it in place for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

With repositories now auto-synced 1:1 from SCM providers, the frontend no longer exposes a way to hide or restore repositories. Datadog shows zero PUT calls to this endpoint in the last 7 days (vs. thousands in the 30 days before that, while the UI was still calling it).
This removes the now-dead surface area:
PUTmethod onOrganizationRepositoryDetailsEndpointand itsRepositorySerializerrepository_cascade_delete_on_hideCelery task, whose only caller was thatPUThandler, along with its tests and mypy weaklist entries_get_repository_child_relationsintoRepositoryDeletionTask— its other caller is gone, and the comment distinguishing "hide" vs "delete" relations no longer appliesGETandDELETEon the endpoint are unchanged.DELETEis still receiving ~15 non-browser calls/day, so leaving it in place for now.