Skip to content

Publish Develocity Build Scans for the Docker image - #5727

Open
donat wants to merge 1 commit into
apache:mainfrom
donat:develocity-docker-build-scans
Open

donat wants to merge 1 commit into
apache:mainfrom
donat:develocity-docker-build-scans

Conversation

@donat

@donat donat commented Oct 7, 2026 •

Copy link
Copy Markdown

Publishes a Develocity Build Scan for the image the Polaris Docker Image Build job builds. The Gradle builds already publish Build Scans to develocity.apache.org. With this change the image build does too, showing the duration and cache use of each Dockerfile step, the build log and the packages in the image.

A new Start Develocity Docker build agent step runs the Develocity Docker build agent beside the build, using the setup-docker action from gradle/develocity-actions. The agent captures what reaches BuildKit, so the Dockerfile and the Quarkus image build stay as they are.

The scans go to develocity.apache.org under the polaris project, with the DEVELOCITY_ACCESS_KEY secret the Gradle builds already use. The step runs only on branch builds of apache/polaris. These are the runs that publish the Gradle Build Scans to develocity.apache.org. Other runs skip the step and build the image as before.

For each build the agent sends the BuildKit record: the Dockerfile steps with their timings, cache hits and logs, the git repository and commit, the image name, the hostname, user name and OS, and a link to the CI run. It also sends the list of packages in the image, which develocity-package-scan-enabled: false turns off. It sends no IP addresses.

Tested on a mirror of this repository, where the job built the image and published its Build 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

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

@donat
donat marked this pull request as ready for review October 8, 2026 08:03
Copilot AI balanced review requested due to automatic review settings October 8, 2026 08:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open findings
What changed in this PR

Adds Develocity Docker Build Scan publishing to the Docker image build in CI, so BuildKit step timing/cache/log/package info is captured in develocity.apache.org.

Changes:

  • Adds a Setup Docker step using gradle/develocity-actions/setup-docker to run the Develocity Docker build agent during the image build.
  • Configures the agent to publish scans to develocity.apache.org under the polaris project using DEVELOCITY_ACCESS_KEY.
File Description
.github/​workflows/​ci.yml Adds Develocity Docker agent setup before the image build so Docker Build Scans can be published.

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +225 to +230
- name: Setup Docker
uses: gradle/develocity-actions/setup-docker@f852d93dada312948b1ba533226c28e05d756866 # v2.4
with:
develocity-url: https://develocity.apache.org
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # zizmor: ignore[secrets-outside-env]
develocity-project-id: polaris

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The step now runs only on branch builds of apache/polaris.

Comment thread .github/workflows/ci.yml
uses: gradle/develocity-actions/setup-docker@f852d93dada312948b1ba533226c28e05d756866 # v2.4
with:
develocity-url: https://develocity.apache.org
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # zizmor: ignore[secrets-outside-env]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix the audit suggests is a deployment environment. That would cover every job that uses this secret, so it belongs in its own change.

@dimas-b

dimas-b commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for your contribution, @donat !

Polaris uses Quarkus for building the docker image. So we do not have much control over the internals of that process. I wonder whether publishing those docker scans is useful for Polaris CI 🤔

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the stale label Nov 11, 2026
@donat

donat commented Nov 11, 2026

Copy link
Copy Markdown
Author

Hi @dimas-b! This is the first public release of the Docker build scan agent. It may not be useful in the current form. However, we need feedback on i) whether the data collected is already useful and ii) what features are missing that would make it valuable for you and for users at large.

@snazy

snazy commented Nov 11, 2026

Copy link
Copy Markdown
Member

I’m still missing a concrete Polaris use case for this integration. What issue in our image build would these scans help diagnose, and what actionable information would they provide beyond the existing logs and Gradle scans?

The lack of scans for PR builds also limits the usefulness for reviewing changes. Additionally, the setup step runs unconditionally, so those builds still download and start the agent even though they cannot publish a scan. What is the measured overhead, including package scanning and cleanup, and could setup be skipped when publishing is unavailable?

With limited review capacity, I’d like to see a demonstrated benefit to Polaris beyond the existing Gradle build scans and a clear understanding of the ongoing CI cost before prioritizing this integration.

@dimas-b

dimas-b commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Hi @donat !
#5727 (comment)

we need feedback [...]

My point is that I am not sure the changes in this PR actually connect with the Quarkus build action that produces Polaris docker images.

Were you able to get any scans published with this change? Could you share links to them?

@github-actions github-actions Bot removed the stale label Nov 12, 2026
@donat
donat force-pushed the develocity-docker-build-scans branch from 666e0e8 to a7886d5 Compare November 12, 2026 09:11
@donat

donat commented Nov 12, 2026 •

Copy link
Copy Markdown
Author

I was able to publish a build scan from the Polaris build locally with the same command as CI’s Image build step (ie running the :polaris-server:quarkusBuild Gradle task).

I don't have publish access to any DV instances that's publicly accessible, but I can share screenshots:

Screenshot 2026-11-12 at 13 59 14 Screenshot 2026-11-12 at 13 59 20 Screenshot 2026-11-12 at 13 59 22 Screenshot 2026-11-12 at 13 59 24

@orca-review-bot orca-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small CI-only change. The guard keeps the secret away from PR runs: ci-pr.yml doesn't pass DEVELOCITY_ACCESS_KEY, and the refs/heads/ check skips refs/pull/.... The action is SHA-pinned. A few small asks are inline.

Not anchored to a line:

  • Can we update the DEVELOCITY_ACCESS_KEY row in .github/SECRETS.md so it mentions the Docker image scans too?
  • Two questions from the thread are still open. snazy asked how much overhead the agent adds to the job, including package scanning and cleanup. dimas-b asked whether the agent actually sees the Quarkus-driven image build in CI. A link to a real scan from a branch run, or a before/after job duration from the mirror, would help maintainers decide.
  • No CHANGELOG entry is needed, since nothing user-facing changes.

🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
@stefanobaghino

Copy link
Copy Markdown

I’m still missing a concrete Polaris use case for this integration. What issue in our image build would these scans help diagnose, and what actionable information would they provide beyond the existing logs and Gradle scans?

Hi @snazy, I'm a colleague of Donát from Develocity. Internally we are already using this and although as Donát said this is the first iteration, coupled with the MCP it can be pretty powerful already: the Docker build agent is able to capture cache usage and performance information and, speaking from experience, with a couple of questions an AI agent it was able to identify a couple of one-liners that ended up saving us a lot of CI agent time. It also already integrates with failure grouping, hopefully helping with troubleshooting. These are a couple of things that come to mind, I hope it helps.

Branch builds of apache/polaris publish a Build Scan for the image the
Docker image build job builds.
@donat
donat force-pushed the develocity-docker-build-scans branch from a7886d5 to 22ce45a Compare November 19, 2026 09:39
@donat

donat commented Nov 19, 2026

Copy link
Copy Markdown
Author

I've addressed the review items on this PR.

This branch has not been deployed

No deployments
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.

6 participants