fix(stacktrace-link): Fix gitlab integration url being incorrectly generated
Fixes an issue where gitlab urls were not being formatted correctly. Specifically:
- We were not stripping filepaths of their trailing slash
- We did change the url generation logic to parse backslashes correctly after Windows code mappings were supported
@MichaelSun48 could you add a test to verify that backslashes will work with stack trace linking? I'm not sure this is the right place since the request to check if a file exists is in the gitlab client check_file() which doesn't look like it calls this function.
I think the right place to do this would be in convert_stacktrace_frame_path_to_source_path so that the transformation happens earlier.
@malwilley Thanks for the call out! After digging into it I'm pretty sure you're right – I added a test and modified convert_stacktrace_frame_path_to_source_path to support backslash paths and code mappings
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 78.02%. Comparing base (
082f15e) to head (4e2bc31). Report is 49 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #73531 +/- ##
==========================================
+ Coverage 70.49% 78.02% +7.53%
==========================================
Files 6635 6638 +3
Lines 296699 296898 +199
Branches 51091 51127 +36
==========================================
+ Hits 209150 231657 +22507
+ Misses 80777 58967 -21810
+ Partials 6772 6274 -498
| Files | Coverage Δ | |
|---|---|---|
| src/sentry/integrations/utils/code_mapping.py | 89.31% <100.00%> (+12.79%) |
:arrow_up: |