-
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #591 +/- ##
=======================================
Coverage 93.89% 93.89%
=======================================
Files 1286 1287 +1
Lines 46807 46816 +9
Branches 1517 1517
=======================================
+ Hits 43951 43960 +9
Misses 2547 2547
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.
CodSpeed Performance ReportMerging #591 will not alter performanceComparing Summary
|
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
Closes https://linear.app/getsentry/issue/CCMRG-1906/allow-django-admin-repository-table-to-be-searchable-across-more
Note
Enhances repository discoverability in Django admin and optimizes name lookups.
RepositoryAdmin.search_fieldsto includenameandservice_idand extendsget_search_resultsto match numericrepoid; addsselect_related("author")to avoid N+1 queries (apps/codecov-api/core/admin.py).GinIndex(OpClass(Upper("name"), name="gin_trgm_ops"), name="repos_name_trgm_idx")toRepositorymodel (libs/shared/shared/django_apps/core/models.py).0077_repository_repos_name_trgm_idxcreating the GIN trigram index onrepos(UPPER(name))viaRiskyAddIndex.Written by Cursor Bugbot for commit 9a04e63. This will update automatically on new commits. Configure here.