Publish gradle scans from PRs (#4696)

This commit is contained in:
Trask Stalnaker 2021-11-29 09:32:56 -08:00 committed by GitHub
parent 50bfdd1043
commit 9b49fc5ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -65,3 +65,16 @@ See [Debugging](docs/contributing/debugging.md)
### Understanding Muzzle
See [Understanding Muzzle](docs/contributing/muzzle.md)
### Troubleshooting PR build failures
The build logs are very long and there is a lot of parallelization, so the logs can be hard to
decipher, but if you scroll to the bottom you should see something like:
```
Publishing build scan...
https://gradle.com/s/ila4qwp5lcf5s
```
Opening the build scan link can sometimes take several seconds (it's a large build), but it
typically makes it a lot clearer what's failing.

View File

@ -28,9 +28,18 @@ dependencyResolutionManagement {
val gradleEnterpriseServer = "https://ge.opentelemetry.io"
val isCI = System.getenv("CI") != null
val geAccessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") ?: ""
// if GE access key is not given and we are in CI, then we publish to scans.gradle.com
gradleEnterprise {
server = gradleEnterpriseServer
if (geAccessKey.isNotEmpty()) {
server = gradleEnterpriseServer
}
buildScan {
if (isCI && geAccessKey.isEmpty()) {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
publishAlways()
this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()