-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore(preprod): Remove final read of deprecated columns #106593
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| Q(mobile_app_info__app_name__icontains=search_term) | ||
| | Q(app_id__icontains=search_term) | ||
| | Q(build_version__icontains=search_term) | ||
| | Q(mobile_app_info__build_version__icontains=search_term) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The search query's use of mobile_app_info__... creates an INNER JOIN, hiding artifacts that lack a PreprodArtifactMobileAppInfo record from search results.
Severity: HIGH
Suggested Fix
To fix this, the query should use an outer join. This can be achieved by either restructuring the query or by using a subquery with Exists() to check for the related fields without filtering out the parent records. Alternatively, ensure that every PreprodArtifact has a PreprodArtifactMobileAppInfo record, even if its fields are empty.
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/preprod/api/endpoints/builds.py#L135-L137
Potential issue: The new search query uses lookups across the `mobile_app_info`
relationship, such as `Q(mobile_app_info__app_name__icontains=search_term)`. This forces
the Django ORM to perform an `INNER JOIN`. However, the backfill migration and factory
logic only create `PreprodArtifactMobileAppInfo` records for artifacts that already have
mobile app data. As a result, any `PreprodArtifact` without a corresponding
`mobile_app_info` record will be excluded from search results, even if other search
criteria (like `app_id`) should match. This will cause existing artifacts to disappear
from search.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine/what we'd intend

In prep for finally wiping the deprecated mobile-app specific cols from PreprodArtifact, this removes one final read I caught.