gradle / gradle-enterprise-build-validation-scripts

Executable scripts to assist in validating that your Gradle and Maven builds are in an optimal state in terms of maximizing work avoidance when using Develocity.
https://gradle.com/develocity
Apache License 2.0
77 stars 23 forks source link

Unable to generate API summary when access key is provisioned by Develocity plugin/extension #587

Open clayburn opened 3 months ago

clayburn commented 3 months ago

The API summary currently only looks for API keys in enterprise/keys.properties. As of Develocity Gradle Plugin 3.17, keys are generated and stored in develocity/keys.properties: https://docs.gradle.com/enterprise/gradle-plugin/current/#automated_access_key_provisioning

This means that users who provision a key with Develocity Gradle Plugin 3.17+ will not be able to properly generate the summary at the end of the experiments.

I assume the same is true for Maven as well.

bmuschko commented 2 months ago

I am experiencing something related if you do not define the API token at all. In my case, the build scans can be published but the summary cannot be produced due to permission issues. I'd suggest adding an initial verification call to the Develocity server that sends the token to check if it is valid. Only then proceed with generating the first build scan.

erichaagdev commented 2 months ago

For now we recommend you to use the older versions of the Gradle Enterprise Gradle plugin 3.16.2 and Gradle Enterprise Maven extension 1.20.1 to run the Build Validation Scripts.

You can use the latest versions of the Develocity Gradle plugin and Develocity Maven extension for all other use cases.

Note that if Publish build scans is not granted anonymously, then an access key granting the permission is required in at least one of the following places when using these older plugin/extension versions:

For Gradle:

For Maven:

If Access build data via the API is not granted anonymously and the Performance Characteristics section of the summary is desired, or in automation scenarios, then an access key granting the permission is required in at least one of any of the above mentioned locations.

In order to verify connectivity and that everything works as expected, you can run the following command:

For Gradle:

./01-validate-incremental-building.sh -t assemble -r https://github.com/gradle/gradle-build-scan-quickstart -e -s https://develocity.example.io

For Maven:

./01-validate-local-build-caching-same-location.sh -g compile -r https://github.com/gradle/maven-build-scan-quickstart -e -s https://develocity.example.io