Repository navigation
ci: give Dependabot Docker Hub credentials - #395
Conversation
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]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideDependabot 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
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #395 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 2510 2510
=========================================
Hits 2510 2510
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
Summary
Dependabot's
helmjob for/examples/petstore/chartfails withprivate_source_authentication_failurefordocker.io/library/mongoanddocker.io/library/rabbitmq(job log of 2026-10-22). This adds Docker Hub as adocker-registryregistry 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 thehelmanddockerupdates. The same page says to usedocker-registry(nothelm-registry, which supports no OCI registries) for Helm, and Dependabot's Helm support updates the images invalues.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
dockerjob (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
yqparses.github/dependabot.yml;registriesis defined and referenced by thedockerandhelmupdates.helmjob (Insights → Dependency graph → Dependabot →/examples/petstore/chart→ Check for updates) and check that theprivate_source_authentication_failureerrors are gone. It fails today regardless, so this PR is merged once CI and reviews are green.Declined review findings
🤖 Generated with Claude Code
Summary by Sourcery
Configure Docker Hub credentials for Dependabot image updates.
Bug Fixes:
CI: