Skip to content
Snippets Groups Projects

Add config file parser for Java Gradle `build.gradle`

Merged Leaminn Ma requested to merge add-java-gradle-build-config-file-class into master

What does this MR do and why?

Background

The Repository X-Ray is a tool that searches for dependency manager configuration files (aka "lock files") and then extracts a list of libraries from the content.

In #474306 (comment 2025085630), we decided to migrate the Repository X-Ray functionality into the GitLab Rails monolith. This gives us two main benefits: (i) it will eventually allow us to run the service outside of the CI pipeline, and (ii) we can maintain the parsing logic centrally so that other domains can utilize it.

Base MR

In !162313 (merged), we introduced the ConfigFiles::Base class where the intention is for each dependency manager config file type to be represented by a child class. The child class contains the parsing logic to extract a list of libraries and their versions from the file content.

This MR

In this MR, we introduce the JavaGradle config file class that parses build.gradle.

Also applied a minor change to config_file_shared_examples.rb to ignore array order for libs.

Resolves part of #476177 (closed).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #476177 (closed)

Edited by Leaminn Ma

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
  • Leaminn Ma resolved all threads

    resolved all threads

  • Leaminn Ma mentioned in issue #481317

    mentioned in issue #481317

  • Leaminn Ma added 1 commit

    added 1 commit

    • 198d5969 - Add Java Gradle config file class

    Compare with previous version

  • Leaminn Ma resolved all threads

    resolved all threads

  • Leaminn Ma
  • Author Maintainer

    Hi @emeraldjayde! Could you please give this a first backend review? If it looks okay, please forward it to maintainer review. Thanks! :hugging:

  • Leaminn Ma requested review from @emeraldjayde

    requested review from @emeraldjayde

  • Leaminn Ma changed the description

    changed the description

  • Emerald-Jayde Henao approved this merge request

    approved this merge request

  • @mikolaj_wawrzyniak can we get a maintainer review please? :pray:

    Edited by Emerald-Jayde Henao
  • requested review from @mikolaj_wawrzyniak

  • Leaminn Ma added 1 commit

    added 1 commit

    • 2c79b407 - Minor refactor of shared_example to ignore libs order

    Compare with previous version

  • Leaminn Ma changed the description

    changed the description

  • Leaminn Ma
  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 50884a82

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Verify      | 44     | 0      | 2       | 0     | 46    | ✅     |
    | Plan        | 73     | 0      | 0       | 0     | 73    | ✅     |
    | Govern      | 72     | 0      | 0       | 0     | 72    | ✅     |
    | Create      | 128    | 0      | 16      | 0     | 144   | ✅     |
    | Monitor     | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Package     | 20     | 0      | 12      | 0     | 32    | ✅     |
    | Data Stores | 31     | 0      | 1       | 0     | 32    | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Release     | 5      | 0      | 0       | 0     | 5     | ✅     |
    | Fulfillment | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Secure      | 3      | 0      | 0       | 0     | 3     | ✅     |
    | Manage      | 1      | 0      | 1       | 0     | 2     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 389    | 0      | 32      | 0     | 421   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-omnibus: :white_check_mark: test report for 50884a82

    expand test summary
    +-------------------------------------------------------------+
    |                       suites summary                        |
    +--------+--------+--------+---------+-------+-------+--------+
    |        | passed | failed | skipped | flaky | total | result |
    +--------+--------+--------+---------+-------+-------+--------+
    | Create | 557    | 0      | 68      | 0     | 625   | ✅     |
    +--------+--------+--------+---------+-------+-------+--------+
    | Total  | 557    | 0      | 68      | 0     | 625   | ✅     |
    +--------+--------+--------+---------+-------+-------+--------+
  • Mikołaj Wawrzyniak
  • Leaminn Ma added 1456 commits

    added 1456 commits

    Compare with previous version

  • requested review from @mikolaj_wawrzyniak

  • Mikołaj Wawrzyniak 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.

  • Mikołaj Wawrzyniak enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • Leaminn Ma resolved all threads

    resolved all threads

  • mentioned in commit 9fe2f915

  • Leaminn Ma mentioned in merge request !165260 (merged)

    mentioned in merge request !165260 (merged)

  • added workflowstaging label and removed workflowcanary label

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