Skip to content

Suppress Docker digest-only updates when tag version is unchanged#15103

Merged
markhallen merged 2 commits into
mainfrom
markhallen/suppress-docker-digest-only-updates
May 22, 2026
Merged

Suppress Docker digest-only updates when tag version is unchanged#15103
markhallen merged 2 commits into
mainfrom
markhallen/suppress-docker-digest-only-updates

Conversation

@markhallen
Copy link
Copy Markdown
Contributor

@markhallen markhallen commented May 21, 2026

What are you trying to accomplish?

Fixes #15081 — Dependabot is bumping Docker image digests when the tag value has not changed.

When a Dockerfile pins both a tag and a digest (e.g., FROM golang:1.26.3-bookworm@sha256:...), Dependabot proposes PRs that only update the digest when the same tag is re-pushed on the registry. This is noisy because the user's intent with a tag+digest pin is to track version changes while ensuring reproducibility for a given version — not to chase every tag re-push.

This adds a new experiment flag docker_digest_only_update_suppression that, when enabled, treats the digest as up-to-date if the latest resolved tag name matches the current pinned tag. Digest updates still occur whenever the tag version actually advances.

Anything you want to highlight for special attention from reviewers?

The fix is scoped entirely to the digest_up_to_date? method in the Docker update checker. When the experiment is enabled and a source has both a tag and a digest:

  • If latest_tag_from(source_tag).name == source_tag (tag hasn't changed), we short-circuit and treat the digest as current
  • If the tag has changed, we proceed with the normal digest comparison

This means:

  • Tag+digest pins: digest-only updates suppressed ✓
  • Digest-only pins (no tag): unaffected, still updates ✓
  • Tag-only pins (no digest): unaffected ✓
  • Experiment off: existing behavior preserved ✓

How will you know you've accomplished your goal?

After enabling the docker_digest_only_update_suppression experiment in production, we expect to observe:

  • Reduction in digest-only Docker PRs: Repositories that pin both a tag and digest (e.g., image:1.26.3@sha256:...) should stop receiving PRs that only update the @sha256: portion when the tag itself hasn't changed.
  • Version-advancing PRs still include digest updates: When a newer tag is available (e.g., 1.26.31.26.4), the PR should update both the tag and the digest as before.
  • No regression for digest-only references: Repositories using FROM image@sha256:... (no tag) should continue receiving digest update PRs normally.
  • Specifically for the reporter's case: Repos like atc0005/go-ci should no longer see PRs like #2510 that bump the digest for amd64/golang:1.26.3-bookworm without a version change.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@markhallen markhallen requested a review from a team as a code owner May 21, 2026 14:58
Copilot AI review requested due to automatic review settings May 21, 2026 14:58
@github-actions github-actions Bot added the L: docker Docker containers label May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an experiment flag (docker_digest_only_update_suppression) to reduce noise from Docker tag+digest pins by suppressing “digest-only” updates when the resolved latest tag name hasn’t changed, while preserving existing behavior when the experiment is disabled.

Changes:

  • Add short-circuit logic in the Docker update checker to treat the digest as up-to-date when the latest resolved tag matches the currently pinned tag (experiment-gated).
  • Add/update specs to cover experiment-enabled vs experiment-disabled behavior for tag+digest pins and digest-only pins.
Show a summary per file
File Description
docker/lib/dependabot/docker/update_checker.rb Adds experiment-gated suppression logic inside digest_up_to_date? for tag+digest sources when the tag hasn’t changed.
docker/spec/dependabot/docker/update_checker_spec.rb Adds specs validating suppression behavior when the experiment is enabled/disabled.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread docker/lib/dependabot/docker/update_checker.rb
Comment thread docker/spec/dependabot/docker/update_checker_spec.rb
Mark Allen and others added 2 commits May 22, 2026 17:28
When a Dockerfile pins both a tag and a digest (e.g.,
FROM golang:1.26.3@sha256:...), Dependabot would propose PRs that only
update the digest when the same tag was re-pushed on the registry, even
though the tag version hadn't changed.

This adds a new experiment flag docker_digest_only_update_suppression
that, when enabled, treats the digest as up-to-date if the latest
resolved tag name matches the current tag name. This prevents noisy
digest-only PRs while still updating the digest whenever the tag version
actually advances.

Fixes #15081

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Non-comparable tags (e.g., 'latest', distro codenames like 'artful')
should still receive digest updates since they cannot be version-compared.
Only versioned/comparable tags get digest-only suppression.

Adds test for non-comparable tag+digest pin scenario.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@markhallen markhallen force-pushed the markhallen/suppress-docker-digest-only-updates branch from a509d67 to 1d9912d Compare May 22, 2026 15:28
@markhallen markhallen enabled auto-merge (squash) May 22, 2026 15:28
@markhallen markhallen merged commit 92a378e into main May 22, 2026
91 checks passed
@markhallen markhallen deleted the markhallen/suppress-docker-digest-only-updates branch May 22, 2026 15:41
@yeikel
Copy link
Copy Markdown
Contributor

yeikel commented May 23, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: docker Docker containers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependabot is bumping Docker image digests when tag value has not changed

4 participants