Bug: Gradle `platform()` / `enforcedPlatform()` is only read for `implementation` and `api`

オープン 初心者向け
#713 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, typescript
領域
devtools

調査の方向性

src/core-open/scanners/java-scanner.ts の parseGradleBuild と GRADLE_CONFIG_NAMES から始め、その後 test/gradle-android-configurations.test.ts または test/sbom-gradle-scope.test.ts にある既存の Gradle スコープテストを読んでください。Groovy と Kotlin DSL の複数の構成にわたって platform() と enforcedPlatform() のケースを追加してください。受け入れケースが通り、既存の実装の platform フィクスチャが引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug good first issue
  • Difficulty: small
  • Area: Java / Gradle
Problem

parseGradleBuild in src/core-open/scanners/java-scanner.ts (around lines 588–592) only looks for BOMs on two configurations:

const platformRegex = /\b(?:implementation|api)\s*(?:\(?\s*)?platform\s*\(\s*['"]([^'"]+)['"]\s*\)/g;

GRADLE_CONFIG_NAMES (around lines 449–459) already includes testImplementation, androidTestImplementation, compileOnly, runtimeOnly, and the other configurations from #660. Those forms never reach platformRegex:

testImplementation platform('org.testcontainers:testcontainers-bom:1.20.0')
compileOnly platform('com.fasterxml.jackson:jackson-bom:2.17.0')
testImplementation(enforcedPlatform("org.springframework.boot:spring-boot-dependencies:3.3.0"))

A platform("g:a:v") call also does not match the ordinary implementation 'g:a:v' regex, because platform( sits between the configuration and the coordinate. The BOM is silently dropped. The fixtures in test/fixtures/gradle-scopes and test/fixtures/gradle-version-catalog only exercise implementation / api platform().

Expected behaviour

platform() and enforcedPlatform() are read for every name in GRADLE_CONFIG_NAMES, in both Groovy and Kotlin DSL. The configuration still controls the section (testImplementation is development, implementation is production). enforcedPlatform is recorded the same way as platform (a version pin), not dropped.

Acceptance
  • Extend test/gradle-android-configurations.test.ts or test/sbom-gradle-scope.test.ts.
  • testImplementation platform("g:a:v") and the Kotlin-DSL equivalent appear as a development row.
  • compileOnly platform('g:a:v') is kept.
  • enforcedPlatform(...) on implementation or testImplementation is kept.
  • Existing implementation platform(...) and api(platform(...)) fixtures still pass.

主要言語
TypeScript
スター
4
フォーク
3
平均マージ
1日 22時間
マージ済み PR(30日)
76

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vibgrate/cli のほかの issue

vibgrate/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。