Skip to content

Commit

Permalink
fix(core): upload issue without source if file not linked
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Feb 9, 2024
1 parent 973a648 commit 2923dbd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"node": ">=18.16"
},
"dependencies": {
"@code-pushup/portal-client": "^0.4.1",
"@code-pushup/portal-client": "^0.5.0",
"@isaacs/cliui": "^8.0.2",
"@poppinss/cliui": "^6.3.0",
"@swc/helpers": "0.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@code-pushup/models": "*",
"@code-pushup/utils": "*",
"@code-pushup/portal-client": "^0.4.1",
"@code-pushup/portal-client": "^0.5.0",
"chalk": "^5.3.0"
},
"type": "commonjs",
Expand Down
14 changes: 8 additions & 6 deletions packages/core/src/lib/implementation/json-to-gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ export function issuesToGql(issues: Issue[] | undefined) {
issues?.map(issue => ({
message: issue.message,
severity: transformSeverity(issue.severity),
sourceEndColumn: issue.source?.position?.endColumn,
sourceEndLine: issue.source?.position?.endLine,
sourceFilePath: issue.source?.file,
sourceStartColumn: issue.source?.position?.startColumn,
sourceStartLine: issue.source?.position?.startLine,
sourceType: IssueSourceType.SourceCode,
...(issue.source?.file && {
sourceType: IssueSourceType.SourceCode,
sourceFilePath: issue.source.file,
sourceStartLine: issue.source.position?.startLine,
sourceStartColumn: issue.source.position?.startColumn,
sourceEndLine: issue.source.position?.endLine,
sourceEndColumn: issue.source.position?.endColumn,
}),
})) ?? []
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"license": "MIT",
"dependencies": {
"zod": "^3.22.1",
"@code-pushup/portal-client": "^0.4.1"
"@code-pushup/portal-client": "^0.5.0"
}
}

0 comments on commit 2923dbd

Please sign in to comment.