Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_file_and_repo_matches(request: Request, organization: Organization) -> l

def get_frame_info_from_request(request: Request) -> FrameInfo:
frame = {
"absPath": request.GET.get("absPath"),
"abs_path": request.GET.get("absPath"),
# Currently, the only required parameter, thus, avoiding the `get` method
"filename": request.GET["stacktraceFilename"],
"module": request.GET.get("module"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,32 @@ def test_get_single_match(self, mock_get_trees_for_org: Any) -> None:
assert response.status_code == 200, response.content
assert response.data == expected_matches

@patch("sentry.integrations.github.integration.GitHubIntegration.get_trees_for_org")
def test_get_frame_with_module(self, mock_get_trees_for_org: Any) -> None:
config_data = {
"absPath": "Billing.kt",
"module": "com.waffleware.billing.Billing$1",
"platform": "java",
"stacktraceFilename": "Billing.kt",
}
expected_matches = [
{
"filename": "Billing.kt",
"repo_name": "getsentry/codemap",
"repo_branch": "master",
"stacktrace_root": "com/waffleware/",
"source_path": "app/src/main/java/com/waffleware/",
}
]
with patch(
"sentry.issues.auto_source_code_config.code_mapping.CodeMappingTreesHelper.get_file_and_repo_matches",
return_value=expected_matches,
):
response = self.client.get(self.url, data=config_data, format="json")
assert mock_get_trees_for_org.call_count == 1
assert response.status_code == 200, response.content
assert response.data == expected_matches

@patch("sentry.integrations.github.integration.GitHubIntegration.get_trees_for_org")
def test_get_start_with_backslash(self, mock_get_trees_for_org: Any) -> None:
file = "stack/root/file.py"
Expand Down
Loading