-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Extended Gradle TOML support #12996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Extended Gradle TOML support #12996
Conversation
2363765 to
06193a9
Compare
|
Here’s the full rundown on PR #12996 from the Dependabot Core repo: 📦 Pull Request: #12996 — Extended Gradle TOML support 🧠 Purpose The PR expands Dependabot’s Gradle file discovery to handle multiple version catalog files (those .versions.toml files) beyond the default gradle/libs.versions.toml. ⚙️ What’s New Current behavior: gradle/libs.versions.toml New behavior: gradle/.versions.toml Essentially, any .versions.toml located inside gradle/ folders or module directories, following common conventions — without scanning the entire repo (for performance reasons). Implementation highlights: Adds new methods catalog_files and subproject_catalog_files in the Gradle FileFetcher to recursively discover TOML files in allowed directories. Removes the old SUPPORTED_VERSION_CATALOG_FILE_PATH constant (hardcoded single path). Updates tests for various Gradle project layouts to verify multi-catalog support. Adjusts CI smoke tests to point to a new temporary smoke test repo/branch: SMOKE_TEST_REPO: gmazzo/dependabot-smoke-tests instead of the usual dependabot/smoke-tests main branch. 🧪 Test Additions New integration tests confirm Dependabot can now pick up files like: gradle/libs.versions.toml and correctly fetch dependencies from them. ✅ Status Author: @gmazzo Created: Sept 2, 2025 Updated: Sept 24, 2025 State: Open and mergeable Checks: All tests and linting pass per author checklist. 🔍 Why It Matters This update closes a major gap in Dependabot’s Gradle support. Now it’s far more compatible with real-world Gradle ecosystems while keeping scanning efficient. If you’re testing this locally, you can confirm with: gh pr checkout 12996 That will verify the new catalog discovery logic across multiple Gradle setups. |
|
Hi @gmazzo! I’d like to propose a small extension to your change that would add support for |
fc99909 to
e019be9
Compare
I think I didn't documented it, but it should already be considering it, since |
|
@JamieMagee @markhallen Hello gents! |
|
@thavaahariharangit Hi! |
What are you trying to accomplish?
Extends Gradle's Catalog support (
.versions.tomlfiles) to collect more file locationsAnything you want to highlight for special attention from reviewers?
Currently,
dependabotwill only considergradle/libs.versions.tomlfile for pick dependencies. Even this may fit most of the standard cases, there some project setups that may require more catalog files.The proposal is to support more cases:
gradlefolder:gradle/*.versions.toml, i.e.:gradle/libs.versions.tomlgradle/buildSrc.versions.tomlgradle/shared.libs.versions.tomlbuildSrc/gradle/libs.versions.tomlbuild-logic/gradle/libs.versions.tomlapp/libs.versions.tomlapp/dependencies.versions.tomlmodule1/libs.versions.tomlNote
Even in theory, any
.version.tomlfile could be potentially a dependency file, I just limited to extend some "convention locations" to limit the queries and prevent scanning the whole repo.How will you know you've accomplished your goal?
Tests of
gradle/file_fetcher.rbwere updated, an itssmoke-gradle-version-catalog.yamlas wellChecklist