Development: Replace deprecated Gradle build APIs - #13664
Conversation
End-to-End Test Results
❌ Failed Tests
Test Strategy: Running all tests (configuration or infrastructure changes detected) Overall: ❌ E2E: real (non-flaky) test failure 🔗 Workflow Run · 📊 Test Report |
|
Warning Review limit reachedNext included review available in 8 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🔵 Needs a closer look
SBOM generation still hard-codes the build/ output path in one place, which can diverge from the new layout.buildDirectory-based paths and cause subtle staging failures if the build directory is customized.
Pull request overview
Replaces deprecated Gradle build-script APIs related to SBOM staging and test reporting to stay compatible with upcoming Gradle 10 removals, while preserving the existing SBOM opt-in behavior and end-of-suite test summary output.
Changes:
- Switched dependency-versions plugin ID to
io.github.ben-manes.versions. - Migrated test summary reporting from
afterTest/afterSuiteclosures to aTestListener. - Refactored SBOM staging to capture configuration-time paths and use injected
FileSystemOperationsfor execution-time copying and cleanup.
File summaries
| File | Description |
|---|---|
| gradle/test.gradle | Replaces deprecated afterTest/afterSuite wiring with a TestListener while keeping failure tracking + final summary output. |
| gradle/sbom.gradle | Introduces injected FileSystemOperations, centralizes SBOM enablement flag, and modernizes SBOM staging/cleanup path handling. |
| build.gradle | Updates dependency-versions plugin ID and sets CycloneDX projectType via enum on the main script classpath. |
Review details
Suppressed comments (1)
gradle/sbom.gradle:23
cyclonedxDirectBomwritesjsonOutputto a hard-codedbuild/path, but later the copy task reads the server SBOM vialayout.buildDirectory. If the build directory is ever customized, the generator and copier will diverge; usinglayout.buildDirectoryforjsonOutputkeeps paths consistent and avoids hard-codingbuild/.
skipConfigs = ["testCompileClasspath", "testRuntimeClasspath", "checkstyle", "mockitoAgent", "liquibaseRuntime"]
includeBomSerialNumber = true
includeLicenseText = false
// Output configuration for v3.x - use file properties instead of destination/outputName/outputFormat
jsonOutput = file("build/reports/sbom/server-sbom.json")
- Files reviewed: 2/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Replace deprecated Gradle APIs in SBOM staging and test reporting, and use the current dependency-versions plugin ID. SBOM opt-in and stale-resource cleanup retain their existing behavior; test totals still print after the suite finishes.
Checklist
Motivation and Context
The develop warning audit found APIs scheduled for removal in Gradle 10. This change addresses the locally owned build-script warnings. The remaining
Project.container(Class, Closure)warning originates inorg.liquibase.gradle.LiquibasePlugin.doApplyExtensionin the already-current 3.1.0 plugin; migrating or patching that plugin is outside this small cleanup.Description
io.github.ben-manes.versionswithout changing its version.FileSystemOperationsfor execution-time copying.afterTest/afterSuiteclosure registration withTestListener, preserving failure collection and the final summary.Steps for Testing
./gradlew help copySbomsToResources checkstyleMain -x webapp --warning-mode all../gradlew test --tests '*UnionFindTest' -x webapp --warning-mode all; verify the final test-total summary.-Pprod -Psbom, excluding generation tasks, and compare staged contents. Run without the flags and verify stale staged SBOMs are removed.Validation
Review Progress