Skip to content

[DockerVersion] Handle empty architectures in Docker Hub tags - #12319

Open
ZainnQureshii wants to merge 1 commit into
badges:masterfrom
ZainnQureshii:docker-version-empty-arch
Open

ZainnQureshii wants to merge 1 commit into
badges:masterfrom
ZainnQureshii:docker-version-empty-arch

Conversation

@ZainnQureshii

Copy link
Copy Markdown

Fixes #7583: Docker Hub signature tags with empty architectures invalidate otherwise usable version badges.
Accept empty architecture strings and exclude tags whose populated image lists contain only empty architectures; preserve existing empty-image-list behaviour.
Artifact-only responses return an error badge; artifact latest returns “tag not found” when explicitly requested, while date sorting selects the next usable tag.
Explicit tags such as 1.2 keep their existing digest matching, which this change does not touch; untagged semver sorting excludes the filtered artifacts.
Tests: npm run test:core -- --reporter dot, npm run test:services -- --only=dockerversion, npm run lint, and npm run prettier:check.

Live check before the fix: https://img.shields.io/docker/v/dnesting/nsd/latest.json returns "invalid response data"; replaying that Docker Hub response through the patched service gives v4.15.0-2cfcc4e (date sort) and v4.15.0 (semver sort).

DockerSize (services/docker/docker-size.service.js) has the same empty-architecture schema rule and fails the same way; it is left for a follow-up PR because its size selection needs its own decision.

AI disclosure: prepared with AI assistance (Claude Code with OpenAI Codex) and reviewed with GitHub Copilot.

🤖 Generated with Claude Code

Fixes badges#7583

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor
Warnings
⚠️ This PR modified service code for docker but not its test code.
That's okay so long as it's refactoring existing code.
⚠️

📚 Remember to ensure any changes to config.private in services/docker/docker-version.service.js are reflected in the server secrets documentation.

Messages
📖 ✨ Thanks for your contribution to Shields, @ZainnQureshii!

Generated by 🚫 dangerJS against c8346e8

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

Development

Successfully merging this pull request may close these issues.

Docker Version badge producing "invalid response data" error

1 participant