Skip to content
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

Merged

Conversation

jprinet
Copy link
Contributor

@jprinet jprinet commented Jan 9, 2024

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.

…abled publication to be captured for republication
@jprinet jprinet force-pushed the fix/conditional-build-scan-publication branch from 2b8efda to 5d61c69 Compare January 9, 2024 14:05
@geoand geoand requested a review from gsmet January 9, 2024 14:21
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)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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)

Copy link
Contributor Author

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)

Copy link

quarkus-bot bot commented Jan 9, 2024

✔️ 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.

@geoand geoand merged commit e0c3af3 into quarkusio:main Jan 10, 2024
50 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 10, 2024
@gsmet gsmet modified the milestones: 3.7 - main, 3.6.6 Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants