Code review powered by LLMs (OpenAI GPT4, Sonnet 3.5) & Embeddings β‘οΈ Improve code quality and catch bugs before you break production π Lives in your Github/GitLab/Azure DevOps CI
Running on GitHub Actions passes and comments ππΌππ« on the PR even when it's riddled with errors. When looking at the logs, I can see these errors were indeed picked up but they were not output properly as json. the error message is as below:
ERROR Error parsing JSON response from the model: ```json
Expected Behavior:
Expected that the GitHub Actions workflow produces a meaningful comment on the PR listing the errors
ERROR Error parsing JSON response from the model: ```json
[
{
"fileName": "/home/runner/work/francis-pd/francis-pd/db_connect.py",
"riskScore": 5,
"details": "API keys and credentials are hard-coded in the code. This is a severe security risk. These should not be exposed in plain text. Consider using environment variables or a secure storage solution."
},
{
"fileName": "/home/runner/work/francis-pd/francis-pd/db_connect.py",
"riskScore": 4,
"details": "There is a SQL injection vulnerability in the 'update_item' function. User input should not be directly interpolated into SQL queries. Use parameterized queries to prevent SQL injection attacks."
},
{
"fileName": "/home/runner/work/francis-pd/francis-pd/db_connect.py",
"riskScore": 3,
"details": "The 'list_duplicator' function seems to be inefficient for duplicating items. Consider using list comprehension or other more efficient methods for duplicating items."
}
]
SyntaxError Unexpected token ` in JSON at position 0
error stack:
β’
β’ index.js Ge
/node_modules/code-review-gpt/dist/index.js:16
β’ index.js maxTry
/node_modules/code-review-gpt/dist/index.js:16
β’ task_queues process.processTicksAndRejections
internal/process/task_queues:95
ERROR Error in callModelJSON
Current Behavior:
Running on GitHub Actions passes and comments ππΌππ« on the PR even when it's riddled with errors. When looking at the logs, I can see these errors were indeed picked up but they were not output properly as json. the error message is as below:
Expected Behavior:
Expected that the GitHub Actions workflow produces a meaningful comment on the PR listing the errors
Steps To Reproduce:
Here is the workflow:
Environment:
Anything else:
Here's a snippet of the logs:
SyntaxError Unexpected token ` in JSON at position 0 error stack: β’
β’ index.js Ge /node_modules/code-review-gpt/dist/index.js:16 β’ index.js maxTry /node_modules/code-review-gpt/dist/index.js:16 β’ task_queues process.processTicksAndRejections internal/process/task_queues:95 ERROR Error in callModelJSON