Annotations in GitLab (pull request proposal)
See original GitHub issueIs your feature request related to a problem? Please describe.
Display annotations in GitLab in addition to standard CI output.
Describe the solution you’d like
Since GitLab version 13.2 (July 2020) Code Quality reports have been made available in the free tier.
The reports are based on the Code Climate issue spec as described in the Implementing a custom tool section.
I would like an option in the graphql-inspector diff
command to generate code climate JSON reports.
I propose the following mapping of severity levels:
Criticality Level | Code Climate Severity | GitHub Reference |
---|---|---|
DANGEROUS | major | Warning |
NON_BREAKING | info | Notice |
BREAKING | critical | Failure |
Icons can be seen on the Vulnerability Report page.
Example in pull requests:
And in the diff view (only for GitLab ultimate, urghhh):
The JSON for each change will look like the following:
Sample:
{
criticality: {
level: 'DANGEROUS',
reason: 'Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.'
},
type: 'ENUM_VALUE_ADDED',
message: "Enum value 'ABC' was added to enum 'EnumA'"
}
{
"type": "issue",
"check_name": "ENUM_VALUE_ADDED",
"description": "Enum value 'ABC' was added to enum 'EnumA'",
"content": "Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.",
"categories": ["level === 'NON_BREAKING' ? 'Compatibility' : 'Bug Risk'"],
"fingerprint": "hex(criticality.level + ':' + type + ':' + message)",
"severity": "major",
"location": {
"path": "schema/cool-schema.graphql",
"lines": {
"begin": 10,
"end": 15
}
}
}
The option would be --codeclimate "path/filenameString.json"
and it would output valid Code Climate JSON to said path.
I would like to contribute this feature via a pull request, but only if the feature gets merged.
Describe alternatives you’ve considered
Not applicable.
Additional context
Pinging @kamilkisiela as the only maintainer
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:10 (4 by maintainers)
Top GitHub Comments
@jord1e yes 😃
@jord1e sounds good!