-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(open-pr-comments): get sentry projects and filenames #59952
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
Additional details and impacted files@@ Coverage Diff @@
## master #59952 +/- ##
=======================================
Coverage 80.76% 80.76%
=======================================
Files 5179 5179
Lines 227391 227401 +10
Branches 38253 38255 +2
=======================================
+ Hits 183654 183663 +9
Misses 38145 38145
- Partials 5592 5593 +1
|
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.
just comment on the raw sql 🤔
Can we chat w/ maybe @wedamija or someone and see if there's any better alternative?
RepositoryProjectPathConfig.objects.filter(organization_id=org_id) | ||
.annotate(substring_match=StrIndex(Value(pr_filename), "source_root")) | ||
.filter(substring_match=1) |
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.
StrIndex
returns the index in which there is a match, but uses 1-indexing. it returns 0 if there is no match
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.
Q: is this case-sensitive?
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.
i'm assuming it works like regular string indexing, but i can check
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.
Apparently it depends on the DB backend used. In our case it's PostgreSQL, where it's rendered as STRPOS()
, which is indeed case-sensitive.
99fbbb9
to
609597b
Compare
Reverse code map filenames from Github (
source_root
) to filenames as stored in Sentry (stack_root
). Also fetch the projects associated with these code mappings.For ER-1807