-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add repo name and service id to django admin repo search #591
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #591 +/- ##
=======================================
Coverage 92.53% 92.54%
=======================================
Files 1295 1296 +1
Lines 47678 47686 +8
Branches 1592 1592
=======================================
+ Hits 44121 44129 +8
Misses 3248 3248
Partials 309 309
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Should double-check that those fields are indexed or it's going to be slow as hell
Is service_id not just github, gitlab, etc?
2350489 to
ac9554d
Compare
| # Also search by repoid if the search term is numeric | ||
| try: | ||
| search_term_as_int = int(search_term) | ||
| except ValueError: | ||
| pass | ||
| else: | ||
| queryset |= self.model.objects.filter(repoid=search_term_as_int) | ||
| # avoid N+1 queries for foreign key author | ||
| queryset = queryset.select_related("author") |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
4db8f39 to
25c1372
Compare
apps/codecov-api/core/admin.py
Outdated
| request, | ||
| queryset, | ||
| search_term, | ||
| ) | ||
| .select_related("author") | ||
| ) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
25c1372 to
9a04e63
Compare
9a04e63 to
67bb126
Compare
67bb126 to
ebd56e2
Compare
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.
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.
ebd56e2 to
cb46d50
Compare
* feat: Add repo name and service id to django admin repo search * fix: Add service_id to search fields instead of custom * feat: Add GIN index for name field * feat: Add select_related for author in repos list * fix: Add select_related for original queryset * fix: Fix select_related usage * chore: Relabel migration with new dependencies
Closes https://linear.app/getsentry/issue/CCMRG-1906/allow-django-admin-repository-table-to-be-searchable-across-more
Note
Improves repository discoverability and search performance in Django admin.
RepositoryAdminsearch to includenameand exactservice_id, plus numericrepoidmatching; addsselect_related("author")to avoid N+1 queriesGinIndexonOpClass(Upper("name"), gin_trgm_ops)(repos_name_trgm_idx) with a migration to speed case-insensitive, trigram-based name searchesWritten by Cursor Bugbot for commit 98f30ba. This will update automatically on new commits. Configure here.