Documentation
¶
Overview ¶
Package codequality renders engine reports as GitLab Code Quality reports (artifacts:reports:codequality), which GitLab shows in the merge request widget and the pipeline's Code Quality tab. Shared by the CLI's --output gitlab-codequality and the server's /api/v1/gate?format=gitlab-codequality endpoint.
Index ¶
Constants ¶
const ( // VirtualPrefix starts the location.path of an entry that has no file: // upgradescope/<finding key> or upgradescope/not-assessed/<capability>. // GitLab requires a path, and an entry it cannot place on a file still // shows in the merge request widget; its file link goes nowhere. VirtualPrefix = "upgradescope/" )
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write renders the report as a GitLab Code Quality report: a JSON array with one entry per (finding, object located in a file) — check_name the finding's key, location the object's file and line as in SARIF, or line 1 when only the file is known (SARIF leaves such an object unlocated; GitLab can still link the file) — and, since GitLab requires a location, one entry anchored to the virtual path upgradescope/<key>, line 1, per finding with no located object (live-cluster findings, add-ons, skew, a /gate stream posted without ?path=) and per located finding with affected objects that have no file or are not recorded. Severity: blocker → critical, warning → minor, info → info. A required assessment gap, which makes the verdict unknown, is a critical entry (check not-assessed/<capability>), a partial one is info, and an optional check that did not run is left out, as in SARIF. Suppressed findings are left out: GitLab has no dismissed state, and every other output lists them. Baseline-unchanged findings stay: GitLab compares the merge request's report with the target branch's itself.
Fingerprints hash the key and the object's file, namespace and name (the key and virtual path for an unlocated entry), never its line or counts, so an entry survives edits that move it; objects sharing an identity are numbered after the first. GitLab keys entries by fingerprint, so every one is unique. An empty report is [], not null.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package codequalitytest checks GitLab Code Quality reports against what GitLab accepts, for every package that emits one (the CLI's --output gitlab-codequality and the server's /api/v1/gate?format=gitlab-codequality).
|
Package codequalitytest checks GitLab Code Quality reports against what GitLab accepts, for every package that emits one (the CLI's --output gitlab-codequality and the server's /api/v1/gate?format=gitlab-codequality). |