Skip to content

Configure eslint job to output Code Quality report

Connor Gilbert requested to merge connorgilbert/pipeline-eslint-cq into master

What does this MR do?

  • Add a dependency that allows eslint to create JSON reports that GitLab Code Quality can import.
  • Configure the ESLint job to create such a report.

Note: the formatter only creates a report file if it detects that the process is running in CI. (It does this by looking for CI-related env vars.) This means that non-CI-based eslint runs are not affected and do not create such a file.

Verification

The functionality is demonstrated in a separate MR: !168587 (closed). That MR includes breaking a few lint rules to show that the report is successfully generated.

The report can be seen in a few places:

  • MR widget:

    Click to expand

    Screenshot_2024-11-13_at_4.55.20_PM

  • Pipeline report

    • This report can time out with large reports; this is a preexisting issue that is not specific to this particular Code Quality report. It will also be mitigated as we remove CodeClimate-based scanning.
  • MR Changes (diff) view:

    Click to expand

    Screenshot_2024-11-13_at_4.19.33_PM

Related issues

Dogfood new direction for Code Quality in gitla... (#382153)

This is part of replacing CodeClimate-based scanning with direct usage of scanning tools. Dogfooding this approach will help accelerate the transition for customers.

Documentation will soon include these specific steps: Docs: Add catalog of common tools integrated wi... (!172633 - merged).

Checklist

Pre-merge

Consider the effect of the changes in this merge request on the following:

If new jobs are added:

This will help keep track of expected pipeline time and cost increases.

Post-merge

Edited by Connor Gilbert

Merge request reports

Loading