Gradle Enterprise 2021.4

Gradle Enterprise 2021.4 features a preview of the upcoming Predictive Test Selection functionality, in the form of a simulator that shows the potential build acceleration for your projects. Predictive Test Selection intelligently reduces build times by skipping tests that are very unlikely to provide useful feedback for a change.

This release also features Build Scans for the Bazel build tool – a build tool based on Google’s internal build system – further expanding the build tools supported by Gradle Enterprise.

Read on for more details of these and other new features.

Use version 1.12.4 of the Gradle Enterprise Maven extension, version 3.8.1 of the Gradle Enterprise Gradle plugin, version 2.2.3 of the Gradle Enterprise Test Distribution Gradle plugin, version 1.6.14 of the Gradle Enterprise Test Distribution Agent, and version 11.1 of the Gradle Enterprise Build Cache Node for optimal usage of Gradle Enterprise.

Highlights

Predictive Test Selection Simulator

Predictive Test Selection intelligently reduces build times by skipping tests that are very unlikely to provide useful feedback for a change. Inspired by similar internal systems at Facebook and Google, this system automatically learns a test selection strategy from code changes and test execution history to predict relevant tests to run. It is particularly useful for large projects with test suites that take a considerable amount of time.

With this release of Gradle Enterprise, you can enable the “Predictive Test Selection Simulator” which allows you to see how Gradle Enterprise Predictive Test Selection would impact your project were it to be used. Future versions of Gradle Enterprise will allow you to actually use Predictive Test Selection to realize the benefits visualized by the simulator.

Simulate test selection using machine learning

The simulator allows you to estimate the effectiveness of Gradle Enterprise Predictive Test Selection for a target set of builds by comparing predictions to actual test results. Through the simulator you can inspect prediction results by test task and trace possible incorrect predictions to their test logs, in order to gain a full understanding of the efficacy of the system.

The Predictive Test Selection Simulator is not enabled by default for Gradle Enterprise installations. If you would like to enable it for your installation, please contact your customer success representative.

Gradle Enterprise Build Scans for Bazel builds

Gradle Enterprise now provides Build Scans for Bazel builds, further expanding the build tools supported by Gradle Enterprise.

Gradle Enterprise leverages Bazel’s native build event service and remote cache functionality, which allows Bazel builds to publish Build Scans to Gradle Enterprise without any significant build modifications.

After adding the following to your project’s .bazelrc file:

build –bes_backend=grpcs://«gradle-enterprise-server»
build –bes_results_url=https://«gradle-enterprise-server»/build/
Your Bazel build will display the following at the beginning and end of the build:

INFO: Streaming build results to: https://«gradle-enterprise-server»/build/66e6805b-7ce1-4e32-bc26-c0fa129c76a7
The link shown is your Build Scan link and can be used to observe the results of the build.

Bazel Build Scans provide shareable access to the console logging, build performance profile, action cache hit rate, requested target results and failure diagnostics, effective build configuration options, build environment and detailed individual test results. Additionally, the Tests Dashboard can be used to identify the slowest, most failing, and flakiest individual tests across many builds based on different search criteria.

For more information on configuring Bazel builds to publish Build Scans to Gradle Enterprise, please see the Bazel Configuration Guide.

Bazel Build Scans are not enabled by default for Gradle Enterprise installations. If you would like to enable it for your installation, please contact your customer success representative.

Visualize inputs normalization configuration differences for Gradle and Maven builds

Gradle 6.8 and Gradle Enterprise Maven extension 1.8 added directory sensitivity normalization for file inputs, while Gradle 7.2 and Gradle Enterprise Maven extension 1.11 added line ending sensitivity.  Gradle Enterprise 2021.4 visualizes these new normalization settings when comparing task or goal inputs, and when they differ between builds.

Additionally, the text displayed by the (?) icon next to the normalization settings provides more detailed information about the actual effect of the normalization settings.

Automatic target cache size management

Build cache nodes can now be configured to use as much space as is available on the disk to store cache artifacts. This is often useful when the build cache node uses a dedicated storage volume, which is common when the build cache node is deployed in containerized environments. This setting avoids the need to synchronize the storage volume size with a target cache size.

By default, a free space buffer of 1 GiB will be maintained with the cache size being automatically reduced should another process or application use more of the available disk space.

To enable automatic target cache size management, change the Target cache size from Fixed to Maximum available.

Automatic target cache size management is available for Gradle Enterprise 2021.4’s built-in build cache node, and remote build cache nodes as of version 11.0.

Upgrade notes

If upgrading from a version of Gradle Enterprise prior to 2021.3, be sure to also consult the release notes for all interim versions.

Temporarily degraded performance due to data reindexing

Upon upgrading, a data reindexing process will be initiated in the background with Gradle Enterprise being usable for its duration. CPU usage will be increased and performance may be slightly degraded. For large installations storing many build scans, the reindexing process may take several hours. During this time, some builds may be omitted from cross-build data visualizations. Recent builds are prioritized, making their data available sooner.

Kubernetes database data and backup volume split

For Kubernetes installations, database backups will now be created in their own persistent volume and will no longer share the database data volume. Before applying this upgrade we strongly recommend copying any existing backups outside the cluster, as they will otherwise be lost.

By default, a new 250 GB persistent volume will be provisioned to store the database backups. This is configurable and may need to be increased inline with your database size and how many backups you wish to retain. You can execute the following command to see what your current backup storage requirements are:

kubectl –namespace=gradle-enterprise exec $(kubectl –namespace=gradle-enterprise get pods –selector=app=gradle-enterprise –selector=component=database -o jsonpath='{.items[*].metadata.name}’) — ls -lha /opt/gradle/backup/postgres

Changes

Feb 22, 2022
  • [FIX] - Gradle Build Scan failure for embedded Gradle build links to console output of embedded task
  • [FIX] - Build Scan task/goal inputs comparison indicates non-existent difference when builds use different platform file separator
  • [FIX] - Build Scans for Gradle 7.4 IDE sync builds cannot be viewed
  • [FIX] - Predictive Test Selection significantly increases database storage requirements for some builds
Feb 07, 2022
  • [NEW] - Predictive Test Selection Simulator supports Maven builds
  • [FIX] - Changing page of list Build Scan data while element is focussed causes error
  • [FIX] - Export API requires base64 encoded access key as bearer token
  • [FIX] - Disk space is not reclaimed while deleting many builds
  • [FIX] - Viewing build scans of large builds concurrently may cause out-of-memory error
Jan 13, 2022
  • [FIX] - Built-in build cache node does not warn when configuration is insecure
  • [FIX] - User-managed database setup scripts fail when used on Azure
  • [FIX] - Maven goal and Gradle task inputs comparison fails when goal uses root module dir as input
  • [FIX] - Upgrade Log4j to 2.17.1 (see https://security.gradle.com/advisory/2021-11)
  • [FIX] - Selecting a task in the timeline graph does not scroll to details view
  • [FIX] - Viewing a build scan summary for a very large can be sporadically very slow
Dec 20, 2021
  • [NEW] - Measure the potential benefits of the upcoming Predictive Test Selection
  • [NEW] - Build scans for Bazel builds
  • [NEW] - Visualize all inputs normalization features in build scans comparison
  • [NEW] - Automatically use the maximum possible target cache size
  • [FIX] - Update Log4j to version 2.17.0 (see https://security.gradle.com/advisory/2021-11)
  • [FIX] - Slowest tests are not visible on the Tests dashboard when there are no failing tests
  • [FIX] - Tests dashboard does not visualize test classes with more than 32K test methods
  • [FIX] - Administration error messages are not always cleared when discarding a configuration change
  • [FIX] - Build scan navigation menu items are not responsive when already selected
  • [FIX] - Build scan navigation breadcrumbs are not efficient for navigating
  • [FIX] - Build cache configuration warning message for early-included builds is confusing