-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Build Scan conditional publication #38102
Fix Build Scan conditional publication #38102
Conversation
…abled publication to be captured for republication
2b8efda
to
5d61c69
Compare
try { | ||
def storageLocationTmpDir = java.nio.file.Files.createTempDirectory(java.nio.file.Paths.get(System.env.RUNNER_TEMP), "buildScanTmp").toAbsolutePath() | ||
log.debug('Update storage location to ' + storageLocationTmpDir) | ||
gradleEnterprise.setStorageDirectory(storageLocationTmpDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this instance global to the build (or even to the module at hand)? Because if so, we would need to set it to the default value in the publish == true
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The storage directory is set to .m2/.gradle-enterprise
when the extension is configured on each build startup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this script is executed independently and gradleEnterprise
isn't global to the whole build and doesn't leak?
I was worried about gradleEnterprise
being global for the whole build and this case could then happen:
- module1 (storageDirectory == default)
- module2 (storageDirectory == default)
- test build in module 2 (storageDirectory == tmp dir)
- module3 (storageDirectory == tmp dir while we would like it to be the default)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I logged the storage directory and can confirm that it is reset on each and every build to the default value (even after a previous build setting it to a temporary directory)
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. You can consult the Develocity build scans. |
Issue
The Develocity Build Scan publication is disabled for test builds (see here).
Disabling the publication does not prevent the scan dump from being created and later on captured while running the Quarkus CI Github workflow.
Captured scan dumps are eventually published to Develocity in a separate workflow, which was not the intention.
Fix
There is no way to prevent the scan dump from being created, the best option is to make sure the scan dump won't be captured by changing its storage location on CI.