feat(comfyui): Add ComfyUI Registry service, tests, fixture and docs
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.
| Warnings | |
|---|---|
| :warning: |
Found badge URL that may not follow our standard route abbreviations. |
| :warning: |
Found badge URL that may not follow our standard route abbreviations. |
| Messages | |
|---|---|
| :book: | :sparkles: Thanks for your contribution to Shields, @neverbiasu! |
| :book: |
Thanks for contributing to our documentation. We :heart: our documentarians! |
Generated by :no_entry_sign: dangerJS against 063c84e3165ce3e3a77488902c3ac1017de152a4
@PyvesB Hii, could you review my code.
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.
Hii, @PyvesB. Thx for your suggestions. I will try to use it.
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?
@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.