Skip to content
Snippets Groups Projects

Configure eslint job to output Code Quality report

Merged 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 - closed)

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
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 7ec26e77 - Move '--format gitlab' to CI config, out of yarn scripts

    Compare with previous version

  • Connor Gilbert reset approvals from @djadmin by pushing to the branch

    reset approvals from @djadmin by pushing to the branch

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for aa3792d1

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 129    | 0      | 22      | 0     | 151   | ✅     |
    | Package     | 24     | 0      | 11      | 0     | 35    | ✅     |
    | Govern      | 75     | 0      | 3       | 0     | 78    | ✅     |
    | Plan        | 76     | 0      | 0       | 0     | 76    | ✅     |
    | Verify      | 43     | 0      | 2       | 0     | 45    | ✅     |
    | Fulfillment | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Data Stores | 33     | 0      | 1       | 0     | 34    | ✅     |
    | Monitor     | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Release     | 5      | 0      | 0       | 0     | 5     | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Ai-powered  | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Manage      | 1      | 0      | 1       | 0     | 2     | ✅     |
    | Secure      | 4      | 0      | 0       | 0     | 4     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 402    | 0      | 41      | 0     | 443   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-cng: :white_check_mark: test report for aa3792d1

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 140    | 0      | 20      | 0     | 160   | ✅     |
    | Fulfillment | 2      | 0      | 7       | 1     | 9     | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Verify      | 49     | 0      | 16      | 0     | 65    | ✅     |
    | Govern      | 84     | 0      | 9       | 1     | 93    | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Package     | 24     | 0      | 14      | 0     | 38    | ✅     |
    | Secure      | 2      | 0      | 5       | 0     | 7     | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | Analytics   | 2      | 0      | 0       | 1     | 2     | ✅     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 436    | 0      | 119     | 3     | 555   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-omnibus: :white_check_mark: test report for aa3792d1

    expand test summary
    +---------------------------------------------------------------------+
    |                           suites summary                            |
    +----------------+--------+--------+---------+-------+-------+--------+
    |                | passed | failed | skipped | flaky | total | result |
    +----------------+--------+--------+---------+-------+-------+--------+
    | Package        | 32     | 0      | 13      | 0     | 45    | ✅     |
    | Fulfillment    | 4      | 0      | 7       | 0     | 11    | ✅     |
    | Plan           | 83     | 0      | 8       | 0     | 91    | ✅     |
    | Data Stores    | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Create         | 563    | 0      | 81      | 8     | 644   | ✅     |
    | Govern         | 95     | 0      | 8       | 0     | 103   | ✅     |
    | Monitor        | 12     | 0      | 13      | 0     | 25    | ✅     |
    | GitLab Metrics | 2      | 0      | 1       | 0     | 3     | ✅     |
    | Verify         | 49     | 0      | 16      | 0     | 65    | ✅     |
    | Secure         | 5      | 0      | 3       | 0     | 8     | ✅     |
    | Manage         | 26     | 0      | 19      | 1     | 45    | ✅     |
    | Systems        | 6      | 0      | 1       | 0     | 7     | ✅     |
    | Analytics      | 3      | 0      | 0       | 0     | 3     | ✅     |
    | Release        | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Growth         | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Configure      | 1      | 0      | 3       | 0     | 4     | ✅     |
    | Ai-powered     | 1      | 0      | 2       | 1     | 3     | ✅     |
    | ModelOps       | 0      | 0      | 1       | 0     | 1     | ➖     |
    +----------------+--------+--------+---------+-------+-------+--------+
    | Total          | 920    | 0      | 189     | 10    | 1109  | ✅     |
    +----------------+--------+--------+---------+-------+-------+--------+
  • Dan Davison approved this merge request

    approved this merge request

  • Before you set this MR to auto-merge

    This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.

    Before you set this MR to auto-merge, please check the following:

    • You are the last maintainer of this merge request
    • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
    • This pipeline is recent enough (created in the last 8 hours)

    If all the criteria above apply, please set auto-merge for this merge request.

    See pipeline tiers and merging a merge request for more details.

  • Dan Davison unapproved this merge request

    unapproved this merge request

  • Connor Gilbert added 247 commits

    added 247 commits

    • 7ec26e77...33ffe6f4 - 245 commits from branch master
    • ec1b2a05 - Configure eslint job to output Code Quality report
    • aa3792d1 - Move '--format gitlab' to CI config, out of yarn scripts

    Compare with previous version

  • Connor Gilbert requested review from @djadmin

    requested review from @djadmin

  • Connor Gilbert requested review from @ddavison

    requested review from @ddavison

  • Vitaly Slobodin approved this merge request

    approved this merge request

  • Vitaly Slobodin removed review request for @vitallium

    removed review request for @vitallium

  • Dan Davison approved this merge request

    approved this merge request

  • Connor Gilbert resolved all threads

    resolved all threads

  • Connor Gilbert mentioned in merge request !168587 (closed)

    mentioned in merge request !168587 (closed)

  • mentioned in merge request gitlab-ui!4834 (closed)

  • mentioned in merge request gitlab-ui!4820 (merged)

  • Dheeraj Joshi approved this merge request

    approved this merge request

  • Dheeraj Joshi resolved all threads

    resolved all threads

  • Dheeraj Joshi enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading