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! |
|
Hey, this is something I would find useful. I've been working on the same feature but with a slightly different approach: rather than scanning the repo to find catalogs in conventional locations, my implementation updates The branch is here: https://github.com/dimitripantelli/dependabot-core/tree/multiple-version-catalog-support Feel free to incorporate any of this if it's useful (or let me know if you'd like to collab). Unfortunately I missed this PR until I was about to open my own. |
That's even a more robust approach, to be honest. Feel free to push it instead of this one. This PR has lost its momentum, since it has not been reviewed in a long while. Or if you want, open a PR to my fork to replace the implementation with yours, and we can reuse all the tests/smokes this PR has. Up to you. I don't have much time to focus on this right now, but I still want to push for the change. |
Thanks for the quick response and validation! Since you mentioned you're short on time, I've raised a PR (#14067) to keep things moving and avoid a bottleneck on your end. Will try and get this through. |
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