Repository navigation
[improve][ci] Publish Develocity Build Scans for the Docker images - #26832
Conversation
The two test image jobs publish a Build Scan for each image they build.
lhotari
left a comment
There was a problem hiding this comment.
👋 Hi Donat, Thank you! Do you know if there's a way to get this working with the public https://scans.gradle.com/ service?
We have setup the Pulsar build this way so that it uses develocity.apache.org when DEVELOCITY_ACCESS_KEY is available (it's not available for PRs from forks):
pulsar/.github/actions/setup-gradle/action.yml
Lines 55 to 79 in 546a40c
We have also limited publishing from other than public repositories in
.github/actions/setup-gradle/action.yml.
|
Hi @lhotari! Nice to find a familiar face around here :)
No, there's no Docker scans support available on scans.gradle.org.
This is a known limitation. No Docker scans for PRs from forks, unfortunately. |
Motivation
The Gradle builds in Pulsar CI already publish Build Scans to develocity.apache.org. The two test images built in the same workflow publish nothing, so their builds are visible only in the job log. A Build Scan for each image shows the duration and cache use of each Dockerfile step, the build log and the packages in the image.
Modifications
The
pulsar-java-test-imageandpulsar-test-latest-version-imagejobs gain aSetup Dockerstep before their image build. It runs the Develocity Docker build agent beside the build, using thesetup-dockeraction fromgradle/develocity-actions. The agent captures what reaches BuildKit, so the Dockerfiles and the GradledockerBuildtasks stay as they are.The scans go to develocity.apache.org under the
pulsarproject, with theDEVELOCITY_ACCESS_KEYsecret the Gradle builds already use. Pull request runs from forks have no access key, so they build the images as before and publish no scan.Documentation for the action: https://github.com/gradle/develocity-actions#setup-docker-action
The pinned version of the action is on the ASF actions allowlist: apache/infrastructure-actions#1364
Verifying this change
Tested on a mirror of this repository, where both image jobs built their images and published four Build Scans, two per job.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes