我正在构建一个 ci 作业,该作业创建自定义代码质量报告,然后将工件发布到代码质量报告。管道识别出存在代码质量报告工件并显示 MR 小部件和管道选项卡,但两者都显示
No code quality issues found
。
我已检查工件是否已上传且 JSON 有效。
以下是作业发布工件的方式:
artifacts:
paths:
- pylama.txt
- pylama.svg
reports:
codequality: gl-code-quality-report.json
这是
gl-code-quality-report.json
文件中的 JSON 示例:
[
{
"type": "issue",
"check_name": "Error",
"description": "Unexpected keyword argument 'self' in function call",
"categories": "Error",
"fingerprint": "7c1f2ce887b2f1e2e4c1549f6901c18f",
"severity": "major",
"location": {
"path": "company_set/create_user.py",
"lines": {
"begin": "98"
}
}
},
{
"type": "issue",
"check_name": "Error",
"description": "Unexpected keyword argument 'self' in function call",
"categories": "Error",
"fingerprint": "7c1f2ce887b2f1e2e4c1549f6901c18f",
"severity": "major",
"location": {
"path": "project/compare_data.py",
"lines": {
"begin": "118"
}
}
},
]
我已验证位置的路径是否正确并且基于目录的根目录。
我还使用 this 源和 GitLabs Docs 验证了每个问题字典中都包含所有必需的密钥。
GitLab 不会解析结果,除非
lines.begin
是 integer
。