feat(issue-detection): Add weighted project selection#113466
Merged
roggenkemper merged 5 commits intomasterfrom Apr 21, 2026
Merged
feat(issue-detection): Add weighted project selection#113466roggenkemper merged 5 commits intomasterfrom
roggenkemper merged 5 commits intomasterfrom
Conversation
Build a shuffled playlist of 20 project IDs weighted by transaction traffic and cache it per org for 7 days. Each dispatch pops the next project off the list. When exhausted, regenerates from a fresh Snuba query. Falls back to random selection if no traffic data available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…E_CHECKING Use LPOP/RPUSH on Redis directly instead of Django cache for consistency with the rest of the detection code. Also remove unnecessary TYPE_CHECKING guard for Organization import. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…et rebuild - Guard second lpop against None from concurrent workers draining the list - Handle Project.DoesNotExist for stale IDs from the 7-day playlist cache - Move set(project_ids) outside dict comprehension Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
bugbot run |
…to Redis Avoids an unnecessary lpop round trip after building the playlist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
bugbot run |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e491744. Configure here.
cvxluo
approved these changes
Apr 21, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
the new scheduling in #113060 means that we needed a better way to pick which projects we are running detection on. Now we will build a shuffled playlist of 20 project IDs weighted by transaction traffic and cache it per org for 7 days. Each dispatch pops the next project off the list. When exhausted, regenerates from a fresh Snuba query.