Skip to content
Open
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
12 changes: 8 additions & 4 deletions command/issues/tests/golden_files/commit_scope_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
"endLine": 42,
"title": "Unchecked error return value of os.ReadFile",
"shortcode": "GO-W1007",
"explanation": "Return value of io.ReadAll is not checked for errors",
"category": "BUG_RISK",
"severity": "MAJOR"
"severity": "MAJOR",
"issue": {
"shortDescription": "Return value of io.ReadAll is not checked for errors"
}
}
},
{
Expand All @@ -31,9 +33,11 @@
"endLine": 91,
"title": "HTTP request built with user-controlled URL",
"shortcode": "GO-S1010",
"explanation": "Constructing HTTP request with user-controlled URL allows SSRF",
"category": "SECURITY",
"severity": "MAJOR"
"severity": "MAJOR",
"issue": {
"shortDescription": "Constructing HTTP request with user-controlled URL allows SSRF"
}
}
}
]
Expand Down
8 changes: 6 additions & 2 deletions command/issues/tests/golden_files/pr_scope_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"shortcode": "GO-W1007",
"category": "BUG_RISK",
"severity": "MAJOR",
"explanation": "Return value of io.ReadAll is not checked for errors"
"issue": {
"shortDescription": "Return value of io.ReadAll is not checked for errors"
}
}
},
{
Expand All @@ -26,7 +28,9 @@
"shortcode": "GO-S1010",
"category": "SECURITY",
"severity": "MAJOR",
"explanation": "Constructing HTTP request with user-controlled URL allows SSRF"
"issue": {
"shortDescription": "Constructing HTTP request with user-controlled URL allows SSRF"
}
}
}
],
Expand Down
10 changes: 7 additions & 3 deletions deepsource/issues/queries/pr_issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const fetchPRIssuesQuery = `query GetPRIssues(
shortcode
category
severity
explanation
issue {
shortDescription
}
}
}
pageInfo {
Expand Down Expand Up @@ -76,7 +78,9 @@ type PRIssuesListResponse struct {
Shortcode string `json:"shortcode"`
Category string `json:"category"`
Severity string `json:"severity"`
Explanation string `json:"explanation"`
Issue struct {
ShortDescription string `json:"shortDescription"`
} `json:"issue"`
} `json:"node"`
} `json:"edges"`
PageInfo pagination.PageInfo `json:"pageInfo"`
Expand Down Expand Up @@ -130,7 +134,7 @@ func (r *PRIssuesListRequest) Do(ctx context.Context) ([]issues.Issue, error) {
IssueCategory: node.Category,
IssueSeverity: node.Severity,
IssueSource: node.Source,
Description: node.Explanation,
Description: node.Issue.ShortDescription,
Location: issues.Location{
Path: node.Path,
Position: issues.Position{
Expand Down
10 changes: 7 additions & 3 deletions deepsource/issues/queries/run_issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ const fetchRunIssuesFlatQuery = `query GetRunIssues($commitOid: String!, $limit:
endLine
title
shortcode
explanation
category
severity
issue {
shortDescription
}
}
}
}
Expand Down Expand Up @@ -70,9 +72,11 @@ type RunIssuesFlatResponse struct {
EndLine int `json:"endLine"`
Title string `json:"title"`
Shortcode string `json:"shortcode"`
Explanation string `json:"explanation"`
Category string `json:"category"`
Severity string `json:"severity"`
Issue struct {
ShortDescription string `json:"shortDescription"`
} `json:"issue"`
} `json:"node"`
} `json:"edges"`
} `json:"issues"`
Expand Down Expand Up @@ -119,7 +123,7 @@ func (r *RunIssuesFlatRequest) Do(ctx context.Context) ([]issues.Issue, error) {
IssueCategory: node.Category,
IssueSeverity: node.Severity,
IssueSource: node.Source,
Description: node.Explanation,
Description: node.Issue.ShortDescription,
Location: issues.Location{
Path: node.Path,
Position: issues.Position{
Expand Down