Skip to content

Conversation

@neverbiasu
Copy link

Summary
Add ComfyUI Registry badges (downloads, version, stars) with a resilient fetcher, tests, fixture and docs.

What this PR does

  • Implements service: comfyui-registry.service.js
    • Routes: /comfyui/:node/downloads, /comfyui/:node/version, /comfyui/:node/stars
    • Respects upstream Cache-Control max-age, supports ETag conditional GET (304), and uses a conservative fallback TTL when max-age=0 and no ETag.
    • Inflight request coalescing and retry with exponential backoff on network/5xx errors.
    • Version badge uses the node identifier as the label (e.g. comfyui-image-captioner).
  • Tests + fixture: comfyui-registry.spec.js, comfyui_node.json
  • Docs: comfyui-registry.md (usage & implementation notes)
  • Removed root-level legacy placeholders to avoid duplicate exports.

Testing (local)

  • Focused unit tests:
    NODE_CONFIG_ENV=test npx mocha comfyui-registry.spec.js --timeout 5000
    -> 3 passing locally
  • Configurable fallback TTL: set COMFYUI_FALLBACK_TTL (seconds) for testing behavior when upstream returns max-age=0 without ETag.

Notes for reviewers

  • Please check caching/ETag logic and error mapping (404 -> NotFound, 401/403 -> Inaccessible).
  • Verify doc examples and the new short-route contract.
  • No PRD/DEV/TODO drafts are included in this PR by request.

Changelog entry

  • Added: ComfyUI Registry badges (downloads, version, stars) with caching and ETag revalidation.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

Warnings
⚠️

Found badge URL that may not follow our standard route abbreviations.
Please ensure you've reviewed our conventions

⚠️

Found badge URL that may not follow our standard route abbreviations.
Please ensure you've reviewed our conventions

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

Thanks for contributing to our documentation. We ❤️ our documentarians!

Generated by 🚫 dangerJS against 063c84e

@neverbiasu
Copy link
Author

@PyvesB Hii, could you review my code.

@PyvesB
Copy link
Member

PyvesB commented Nov 13, 2025

Hello @neverbiasu 👋🏻 What is the rationale for adding a cache layer for this badge? We typically cache at the CDN layer, which has the advantage of being shared across all running Shields.io instances and completely bypasses any processing.

@neverbiasu
Copy link
Author

neverbiasu commented Nov 14, 2025

Hii, @PyvesB. Thx for your suggestions. I will try to use it.

@PyvesB
Copy link
Member

PyvesB commented Nov 14, 2025

I'd suggest following our tutorial and generally speaking keeping things as simple as possible: https://github.com/badges/shields/blob/master/doc/TUTORIAL.md

By the way, do you have any information on the API's rate limits?

@neverbiasu
Copy link
Author

@PyvesB Thx for the suggestions, I have rewrite in the format mentioned in TUTOTIAL.md. I didn't know the API's rate limits but I can ask the backend dev of ComfyUI and answer it later.

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.

2 participants