Skip to content

ci: give Dependabot Docker Hub credentials - #395

Merged
uniqueg merged 2 commits into
devfrom
ci/dependabot-dockerhub
Oct 22, 2026
Merged

uniqueg merged 2 commits into
devfrom
ci/dependabot-dockerhub

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Dependabot's helm job for /examples/petstore/chart fails with private_source_authentication_failure for docker.io/library/mongo and docker.io/library/rabbitmq (job log of 2026-10-22). This adds Docker Hub as a docker-registry registry to .github/dependabot.yml, as in the Docker Hub example of GitHub's Configuring access to private registries for Dependabot (url: https://registry.hub.docker.com, replaces-base: true), and uses it for the helm and docker updates. The same page says to use docker-registry (not helm-registry, which supports no OCI registries) for Helm, and Dependabot's Helm support updates the images in values.yaml (Guidance for the configuration of private registries for Dependabot).

Closes #393

Required setup (admin)

Create two Dependabot secrets (Dependabot cannot read Actions secrets), in the repository's (or organization's) Settings → Secrets and variables → Dependabot → New secret:

  • DOCKERHUB_LOGIN: the Docker Hub user name (same name as the existing Actions secret)
  • DOCKERHUB_TOKEN: a Docker Hub personal access token with the scope "Public Repo Read-only" (same name as the existing Actions secret, but a separate read-only token is enough)

Until the secrets exist, Dependabot uses empty credentials for Docker Hub, so the docker job (which works today) may fail too.

Light lane

Configuration only (Dependabot, no workflow, no permission change): no reviewer subagents, no wait for a posted Sourcery review (CI and Sourcery's check still apply).

Verification

  • yq parses .github/dependabot.yml; registries is defined and referenced by the docker and helm updates.
  • The fix can only be verified after the secrets exist: then re-run the Dependabot helm job (Insights → Dependency graph → Dependabot → /examples/petstore/chart → Check for updates) and check that the private_source_authentication_failure errors are gone. It fails today regardless, so this PR is merged once CI and reviews are green.
  • CI: all checks pass.

Declined review findings

  • Sourcery (medium, "Docker and Helm updates fail" without the secrets): acknowledged; the admin creates the secrets (see above), the helm job fails today regardless. Replied and resolved.

🤖 Generated with Claude Code

Summary by Sourcery

Configure Docker Hub credentials for Dependabot image updates.

Bug Fixes:

  • Provide Dependabot with authenticated Docker Hub access so Docker image updates used by the Docker and Helm jobs can resolve private-source authentication failures.

CI:

  • Configure both Docker and Helm Dependabot update jobs to use the Docker Hub registry credentials.

Dependabot's helm job for the petstore chart fails with
private_source_authentication_failure for docker.io (mongo, rabbitmq).
Add Docker Hub as a docker-registry registry with the Dependabot
secrets DOCKERHUB_LOGIN and DOCKERHUB_TOKEN, as in GitHub's Docker Hub
example, and use it for the helm and docker updates.

Closes #393

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Dependabot is configured to authenticate to Docker Hub with dedicated read-only Dependabot secrets, and both Docker and Helm update jobs reference that registry to prevent private source authentication failures when resolving container images.

File-Level Changes

Change Details Files
Add authenticated Docker Hub registry configuration for Dependabot image resolution.
  • Define a docker-registry entry using Dependabot-specific Docker Hub secrets and replaces-base: true.
  • Document that repository or organization Dependabot secrets must be created with a read-only Docker Hub token.
.github/dependabot.yml
Apply the Docker Hub credentials to the relevant Dependabot update jobs.
  • Reference the dockerhub registry from the Docker ecosystem updates.
  • Reference the dockerhub registry from the Helm ecosystem updates so image references in the chart can authenticate.
.github/dependabot.yml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ec846ac) to head (0bc5611).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #395   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         2510      2510           
=========================================
  Hits          2510      2510           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 22, 2026 16:53

@sourcery-ai sourcery-ai 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/dependabot.yml" line_range="10-11" />
<code_context>
+  dockerhub:
+    type: docker-registry
+    url: https://registry.hub.docker.com
+    username: ${{secrets.DOCKERHUB_LOGIN}}
+    password: ${{secrets.DOCKERHUB_TOKEN}}
+    replaces-base: true
+
</code_context>
<issue_to_address>
**Docker and Helm updates fail**

When the Dependabot secrets have not been created and Docker Hub rejects the anonymous pull, `username` and `password` resolve to empty values, so Dependabot’s Docker and Helm updates authenticate with unusable credentials; the Docker update job fails instead of continuing with anonymous pulls as before.

Create the `DOCKERHUB_LOGIN` and `DOCKERHUB_TOKEN` Dependabot secrets before enabling this registry.

Also at `.github/dependabot.yml:49`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and dependabot will authenticate to Docker Hub with the configured token for Docker and Helm updates. If the token is broader than intended or is exposed, reverting stops future use but does not revoke it; the token would need to be rotated.

Blocking findings: .github/dependabot.yml:11


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/dependabot.yml Resolved
@uniqueg
uniqueg merged commit c7b4ce0 into dev Oct 22, 2026
15 checks passed
@uniqueg
uniqueg deleted the ci/dependabot-dockerhub branch October 22, 2026 17:04
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.

1 participant